From 9ad21e44149e5788ecb7eff5f1b433316e8ae801 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Tue, 11 Jun 2024 23:09:30 -0700 Subject: [PATCH 01/16] NodeNext Overhaul --- .github/workflows/ci.yml | 38 + .gitignore | 12 +- .npmignore | 10 - README.md | 111 +- assets/docs/favicon.ico | Bin 0 -> 15406 bytes assets/icon/gl-matrix-icon-512.webp | Bin 0 -> 87394 bytes assets/icon/gl-matrix-icon-64.webp | Bin 0 -> 4826 bytes assets/icon/gl-matrix-icon-mono-64.webp | Bin 0 -> 4026 bytes esm-d-ts.config.js | 28 + package-lock.json | 6797 +++++++++++++++++---- package.json | 142 +- scripts/bundle.js | 157 + scripts/bundle.mjs | 70 - scripts/gen-f64.js | 64 + scripts/gen-f64.mjs | 48 - scripts/gen-swizzle.js | 152 + scripts/gen-swizzle.mjs | 95 - src/{mat2.ts => _lib/f32/Mat2.ts} | 58 +- src/{mat2d.ts => _lib/f32/Mat2d.ts} | 65 +- src/{mat3.ts => _lib/f32/Mat3.ts} | 73 +- src/{mat4.ts => _lib/f32/Mat4.ts} | 127 +- src/{quat.ts => _lib/f32/Quat.ts} | 107 +- src/{quat2.ts => _lib/f32/Quat2.ts} | 69 +- src/{vec2.ts => _lib/f32/Vec2.ts} | 1907 +++--- src/{vec3.ts => _lib/f32/Vec3.ts} | 46 +- src/{vec4.ts => _lib/f32/Vec4.ts} | 39 +- src/_lib/f32/index.ts | 9 + src/_lib/f64/Mat2.ts | 598 ++ src/_lib/f64/Mat2d.ts | 619 ++ src/_lib/f64/Mat3.ts | 1030 ++++ src/_lib/f64/Mat4.ts | 2511 ++++++++ src/_lib/f64/Quat.ts | 1068 ++++ src/_lib/f64/Quat2.ts | 997 +++ src/_lib/f64/Vec2.ts | 950 +++ src/_lib/f64/Vec3.ts | 1161 ++++ src/_lib/f64/Vec4.ts | 1030 ++++ src/_lib/f64/index.ts | 9 + src/classic/index.ts | 28 + src/common.ts | 31 - src/common/index.ts | 10 + src/f64/index.ts | 23 + src/index.ts | 36 +- src/swizzle/f64/index.ts | 127 + src/{swizzle.ts => swizzle/index.ts} | 118 +- src/types/index.ts | 108 + src/types/swizzle/f64/index.ts | 1997 ++++++ src/types/swizzle/index.ts | 1997 ++++++ src/util/angleConversion.ts | 29 + src/util/index.ts | 13 + tests/classic-api.spec.ts | 22 + tests/common.spec.ts | 19 - tests/f32/Mat2.spec.ts | 394 ++ tests/f32/Mat2d.spec.ts | 387 ++ tests/f32/Mat3.spec.ts | 572 ++ tests/f32/Mat4.spec.ts | 1165 ++++ tests/f32/Quat.spec.ts | 750 +++ tests/f32/Quat2.spec.ts | 787 +++ tests/f32/Vec2-swizzle.spec.ts | 521 ++ tests/f32/Vec2.spec.ts | 799 +++ tests/f32/Vec3-swizzle.spec.ts | 2123 +++++++ tests/f32/Vec3.spec.ts | 727 +++ tests/f32/Vec4-swizzle.spec.ts | 6065 +++++++++++++++++++ tests/f32/Vec4.spec.ts | 700 +++ tests/f32/util.spec.ts | 19 + tests/f64/Mat2.spec.ts | 394 ++ tests/f64/Mat2d.spec.ts | 387 ++ tests/f64/Mat3.spec.ts | 572 ++ tests/f64/Mat4.spec.ts | 1165 ++++ tests/f64/Quat.spec.ts | 750 +++ tests/f64/Quat2.spec.ts | 787 +++ tests/f64/Vec2-swizzle.spec.ts | 521 ++ tests/f64/Vec2.spec.ts | 799 +++ tests/f64/Vec3-swizzle.spec.ts | 2123 +++++++ tests/f64/Vec3.spec.ts | 727 +++ tests/f64/Vec4-swizzle.spec.ts | 6065 +++++++++++++++++++ tests/f64/Vec4.spec.ts | 700 +++ tests/f64/util.spec.ts | 19 + tests/mat2.spec.ts | 386 -- tests/mat2d.spec.ts | 374 -- tests/mat3.spec.ts | 560 -- tests/mat4.spec.ts | 1182 ---- tests/quat.spec.ts | 801 --- tests/quat2.spec.ts | 759 --- tests/{test-utils.ts => setupExtend.ts} | 57 +- tests/setupGlobal.js | 6 + tests/vec2-swizzle.spec.ts | 633 -- tests/vec2.spec.ts | 785 --- tests/vec3-swizzle.spec.ts | 2591 -------- tests/vec3.spec.ts | 702 --- tests/vec4-swizzle.spec.ts | 7409 ----------------------- tests/vec4.spec.ts | 689 --- tests/vitest.d.ts | 13 + tsconfig-build.json | 7 + tsconfig.json | 20 +- tsconfig64.json | 14 - typedoc.json | 15 - vitest.config.ts | 20 + 97 files changed, 51953 insertions(+), 19843 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .npmignore create mode 100644 assets/docs/favicon.ico create mode 100644 assets/icon/gl-matrix-icon-512.webp create mode 100644 assets/icon/gl-matrix-icon-64.webp create mode 100644 assets/icon/gl-matrix-icon-mono-64.webp create mode 100644 esm-d-ts.config.js create mode 100644 scripts/bundle.js delete mode 100644 scripts/bundle.mjs create mode 100644 scripts/gen-f64.js delete mode 100644 scripts/gen-f64.mjs create mode 100644 scripts/gen-swizzle.js delete mode 100644 scripts/gen-swizzle.mjs rename src/{mat2.ts => _lib/f32/Mat2.ts} (93%) rename src/{mat2d.ts => _lib/f32/Mat2d.ts} (92%) rename src/{mat3.ts => _lib/f32/Mat3.ts} (93%) rename src/{mat4.ts => _lib/f32/Mat4.ts} (95%) rename src/{quat.ts => _lib/f32/Quat.ts} (92%) rename src/{quat2.ts => _lib/f32/Quat2.ts} (94%) rename src/{vec2.ts => _lib/f32/Vec2.ts} (93%) rename src/{vec3.ts => _lib/f32/Vec3.ts} (97%) rename src/{vec4.ts => _lib/f32/Vec4.ts} (96%) create mode 100644 src/_lib/f32/index.ts create mode 100644 src/_lib/f64/Mat2.ts create mode 100644 src/_lib/f64/Mat2d.ts create mode 100644 src/_lib/f64/Mat3.ts create mode 100644 src/_lib/f64/Mat4.ts create mode 100644 src/_lib/f64/Quat.ts create mode 100644 src/_lib/f64/Quat2.ts create mode 100644 src/_lib/f64/Vec2.ts create mode 100644 src/_lib/f64/Vec3.ts create mode 100644 src/_lib/f64/Vec4.ts create mode 100644 src/_lib/f64/index.ts create mode 100644 src/classic/index.ts delete mode 100644 src/common.ts create mode 100644 src/common/index.ts create mode 100644 src/f64/index.ts create mode 100644 src/swizzle/f64/index.ts rename src/{swizzle.ts => swizzle/index.ts} (68%) create mode 100644 src/types/index.ts create mode 100644 src/types/swizzle/f64/index.ts create mode 100644 src/types/swizzle/index.ts create mode 100644 src/util/angleConversion.ts create mode 100644 src/util/index.ts create mode 100644 tests/classic-api.spec.ts delete mode 100644 tests/common.spec.ts create mode 100644 tests/f32/Mat2.spec.ts create mode 100644 tests/f32/Mat2d.spec.ts create mode 100644 tests/f32/Mat3.spec.ts create mode 100644 tests/f32/Mat4.spec.ts create mode 100644 tests/f32/Quat.spec.ts create mode 100644 tests/f32/Quat2.spec.ts create mode 100644 tests/f32/Vec2-swizzle.spec.ts create mode 100644 tests/f32/Vec2.spec.ts create mode 100644 tests/f32/Vec3-swizzle.spec.ts create mode 100644 tests/f32/Vec3.spec.ts create mode 100644 tests/f32/Vec4-swizzle.spec.ts create mode 100644 tests/f32/Vec4.spec.ts create mode 100644 tests/f32/util.spec.ts create mode 100644 tests/f64/Mat2.spec.ts create mode 100644 tests/f64/Mat2d.spec.ts create mode 100644 tests/f64/Mat3.spec.ts create mode 100644 tests/f64/Mat4.spec.ts create mode 100644 tests/f64/Quat.spec.ts create mode 100644 tests/f64/Quat2.spec.ts create mode 100644 tests/f64/Vec2-swizzle.spec.ts create mode 100644 tests/f64/Vec2.spec.ts create mode 100644 tests/f64/Vec3-swizzle.spec.ts create mode 100644 tests/f64/Vec3.spec.ts create mode 100644 tests/f64/Vec4-swizzle.spec.ts create mode 100644 tests/f64/Vec4.spec.ts create mode 100644 tests/f64/util.spec.ts delete mode 100644 tests/mat2.spec.ts delete mode 100644 tests/mat2d.spec.ts delete mode 100644 tests/mat3.spec.ts delete mode 100644 tests/mat4.spec.ts delete mode 100644 tests/quat.spec.ts delete mode 100644 tests/quat2.spec.ts rename tests/{test-utils.ts => setupExtend.ts} (51%) create mode 100644 tests/setupGlobal.js delete mode 100644 tests/vec2-swizzle.spec.ts delete mode 100644 tests/vec2.spec.ts delete mode 100644 tests/vec3-swizzle.spec.ts delete mode 100644 tests/vec3.spec.ts delete mode 100644 tests/vec4-swizzle.spec.ts delete mode 100644 tests/vec4.spec.ts create mode 100644 tests/vitest.d.ts create mode 100644 tsconfig-build.json delete mode 100644 tsconfig64.json delete mode 100644 typedoc.json create mode 100644 vitest.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b93f807d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI/CD + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-node: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: [18.x, 20.x, 22.x] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Run Tests + run: npm run test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittests diff --git a/.gitignore b/.gitignore index 1a829597..74f19e2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ +.idea .rvmrc .DS_Store -node_modules npm-debug.log -dist -docs -f64 \ No newline at end of file +/.dts +/coverage +/dist +/dist-cdn +/docs +/html +/node_modules diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 8b741a6d..00000000 --- a/.npmignore +++ /dev/null @@ -1,10 +0,0 @@ -.rvmrc -npm-debug.log -docs -f64 -scripts -src -tests -tsconfig.json -tsconfig64.json -typedoc.json \ No newline at end of file diff --git a/README.md b/README.md index 35beae90..2ed19472 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,114 @@ -## Fast, flexible vector and matrix math for JavaScript - [![NPM Version](https://img.shields.io/npm/v/gl-matrix.svg)](https://www.npmjs.com/package/gl-matrix) -[![Build Status](https://travis-ci.org/toji/gl-matrix.svg)](https://travis-ci.org/toji/gl-matrix) +[![License](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat)](https://github.com/typhonjs-svelte/trie-search/blob/main/LICENSE) +[![API Docs](https://img.shields.io/badge/API%20Documentation-476ff0)](https://glmatrix.net/docs/v4/) + +`gl-matrix` is a versatile and high-performance JavaScript / TypeScript library for vector and matrix operations, +optimized for real-time 3D graphics APIs such as WebGL and WebGPU. -glMatrix is a high performance, very flexible library for vector and matrix operations in JavaScript/TypeScript, designed for the needs of realtime 3D graphics APIs like WebGL and WebGPU. +## Using Float32Array -## Docs +The version 4 release offers a new class based API. -Documentation is available at [https://glmatrix.net/docs/v4/](https://glmatrix.net/docs/v4/) +```js +import { Vec3 } from 'gl-matrix'; + +const vec = new Vec3(0, 1, 2); +``` ## Using Float64Array -If your use case requires additional precision beyond the default 32-bit floats used by default, you can instead use a 64-bit verions of the library by importing from the `f64/` directory of your chosen build type. For example: +If your use case requires additional precision beyond 32-bit floats used by default you can instead use a +64-bit version of the library by importing from the `gl-matrix/f64` sub-path export. + +```js +import { Vec3 } from 'gl-matrix/f64'; + +const vec = new Vec3(0, 1, 2); +``` + +If you have a need to mix and match the 64-bit and 32-bit versions you can do so by importing them as different names. ```js -import { Vec3 } from './gl-matrix/dist/esm/f64/vec3.js'; +import { Vec3 as Vec3F32 } from 'gl-matrix'; +import { Vec3 as Vec3F64 } from 'gl-matrix/f64'; ``` -If you have a need to mix and match the 64 bit and 32 bit versions, you can do so by importing them as different names: +All API calls are identical between the two versions and the only difference is the type of TypedArray which the classes extend. +## Using Typescript / Type Aliases + +All Typescript type aliases are shared across library variants and located in the `gl-matrix/types` sub-path export. + +For Typescript: +```ts +import type { Vec3Like } from 'gl-matrix/types'; +``` + +For JSDoc using the new Typescript 5.5 `@import` tag: +```js +/** + * @import { Vec3Like } from 'gl-matrix/types' + */ +``` + +For JSDoc using the older `import types` Typescript mechanism: ```js -import { Vec3 as Vec3F32 } from './gl-matrix/dist/esm/vec3.js'; -import { Vec3 as Vec3F64 } from './gl-matrix/dist/esm/f64/vec3.js'; +/** + * @type {import('gl-matrix/types').Vec3Like} + */ ``` -All API calls are identical between the two versions, the only difference is the type of TypedArray which the classes extend. \ No newline at end of file +## Classic API + +To facilitate easier adoption of version 4 of `gl-matrix` and maintain essential compatability with existing codebases the modern +API can be accessed via remapped exports matching the version 3 API from the `gl-matrix/classic` sub-path export. The +only change required is altering imports from `gl-matrix` to `gl-matrix/classic`. + +```js +import { vec3 } from 'gl-matrix/classic'; + +const vec = vec3.create(); +``` + +## Enabling Swizzling + +To enable additional swizzle accessors for vector classes invoke the `EnableSwizzles` function from +the `gl-matrix/swizzle` sub-path export. + +```ts +import { Vec3 } from 'gl-matrix'; +import { EnableSwizzles } from 'gl-matrix/swizzle'; + +EnableSwizzles(); + +const vec = new Vec3(0, 1, 2); +const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). +``` + +To enable the 64-bit swizzle accessors use the `gl-matrix/swizzle/f64` sub-path export and invoke `EnableSwizzlesF64`. + +```ts +import { Vec3 } from 'gl-matrix/f64'; +import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + +EnableSwizzlesF64(); + +const vec = new Vec3(0, 1, 2); +const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). +``` + +Additionally, you may enable ambient module declarations for the respective 32-bit or 64-bit +vector classes when enabling swizzling. This is accomplished by using `side effect` imports as follows. + +```ts +// For `gl-matrix` / 32-bit vector classes. +import 'gl-matrix/types/swizzle'; + +// For `gl-matrix/f64` / 64-bit vector classes. +import 'gl-matrix/types/swizzle/f64'; +``` + +## CommonJS + +This package supports both ES Module and CommonJS formats. For CommonJS usage, replace `import` statements with +`require`. All functionality remains consistent across both module systems. diff --git a/assets/docs/favicon.ico b/assets/docs/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..6038e83d4648ff568b9267d5258d7eff3c899ff8 GIT binary patch literal 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_f)?JK|Z^Q?x-6X>ZyRZFZ!^6K{#&`RFHk&Lbwu|KRX0mi>I;^pS}`Ga>qa{;gl# z8a-lY!L{DqBVLJEpB@>+s!4x686Vjro$2x^-ru6ma%m#=hw0*(>PHOOpYy_`*o1u~6zb~?3MTC`Q}@siTvJg6aS|m(tFD?p`1g~oASN* zAB)cSlJ25zM|&boZ-}JnEYCh(Pn%frbk>yGtIHQOt=_P5TK=k4Q|z~H R-AYLNzrX*^!2jPF_#fUX!@d9j literal 0 HcmV?d00001 diff --git a/assets/icon/gl-matrix-icon-512.webp b/assets/icon/gl-matrix-icon-512.webp new file mode 100644 index 0000000000000000000000000000000000000000..3a4cf40c8dba551f8c38be1b249950a14320cc92 GIT binary patch literal 87394 zcmb@sV{~Of*DktabZm8Oqhs5)J2pCYI(EmlI<{@wwr%bt`}F&Lciiv%IOqPlRjXD# z>zVVJtLCgfHO5*h(h?Fn>RLydjx>z*_zln zLka-^cJ?k#Dv~0^TG~3qFsA@00Ny_{8vxPB#Mx0^RYL7Q-v8(JybJ*Qk7a@3Ke7JL zKL1x1(bUY@1ONad{^ucN;^^e^5C8m!Iow?w|AW*1VGI*XBh!Dl@*k#m`nSM;c=bQL z@qgpX|6q&%!vB>NhLf6#=)c@B{_(^X{~I>`->`|Llifd`AOC#FP3`Re#Ru2=Z*2M> z?DHRNXY2ZJZU5E&lOckcy}IhZnf%`%07wF)0rCJP05QNA;0mw;*aBPt4F6{Pe~dFg z<)2;T|Dyj-WeNT%UH>U<|0zuVDZ~H{06T!uf9V1L*@J&R|Jwi5*4dnm^}i@E1Q7rL zY8wQ4pa1}15&?kEI1mV!4+4D_000o106?$(|L7g^006G1e|+5kaOAlF0CF$@&^-7* zoN+1u&=Lj!;H)_sIT`)edm#SZ!OhJ9fcp{v08twNK%WHw;C27IZvSlmu>%TM006ar zwUV0x0Mau607{F0vGx8hdBgq_{J(Yk|MdBP>L)CxBy|Y=Z?|v5>_E8EUm*S*Y4r{p zTV4H_yUBHqFq@6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}EM25|!9R85!0~HZ)w&qt4`ilRVas1vr?Hu`JY9C@qW3v&4 zj?`CABnjf(<_li1x!x^I4R2+C4T^#(KUJ;>=4+VqdMAgL*H`+B#WRHTVg(gH`@smX zOW)QTUgefvX{<_5qDttJCX_hj!_uds{G)@>lh%gTtx_4|WDuCu^MTYiim}mYT19NJ zwEO?O*y_Q%kUBBaY8Xk#xCgEnNDrzDO|dY|Sw6uj`7VZQ?Jq=7Jwq#KiPLU|T;rUPi4GEW9uJAPv>WSxFShuAQGs{#TtM$B#1LKS_C zc~Yo8B`cUwfXw;m`X9pmhgJ6eg+)b$Wh&0F--XR1i`$wWw!0(co?09G(`3pVjAZ@ukW+k z(-1n+h>Y5m#YgM?kVeD#ITj{}-%!!v%NL53tw_5DStC#h>{Tc&kB22|KQAkU+yR^y zgwJTpvya~YtYF-phVlfX&HD(i8z}1CZLh@f%&BO{DqK%h#Ym|avwQ#>UOrLezks}9 zr$<}F+e%u0%H6!gh2i4(caC9K{S3j;o@$kgdD_SyF8<~)d%>~w{1rw2!Ab>>NhLf* zXFPstqk-b)b@O7kT=3*04xaum>UN5P9O1guOzv!*6tQ}_{|0w&IPHHY;UgTbaAS`4 xIRFIL{hgpA(_y#OIFc@{G3Gq0{AUK@BqG(pArB7 literal 0 HcmV?d00001 diff --git a/assets/icon/gl-matrix-icon-64.webp b/assets/icon/gl-matrix-icon-64.webp new file mode 100644 index 0000000000000000000000000000000000000000..ce4c86959b55854187db72b326e98e8779f9a8bd GIT binary patch literal 4826 zcmaKrby!qg*TxSeNXLMbbR!`MGIS%|DM$<@$j~7o{Qv@jAP%8Y0}n_e(lv^73P?91 zT_RF5bH35{yT0fB<9)wcEGW8aDdNm&cZPS=I-c>;|d(# z^1~ev$1}fmr+@L@Z+82`e~N>=MFB1$Jq;xTOZ%* zU+nyw!+x{Zqd?r*{*2!hlDojoO>r|1?q&tF0Bt}YFakILCm;}b2s{D;01?~_$0`1R z2`;YsU;Mv2%ZhUb;+&6g4j9g%4tN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Z5yI&oP^Mb|Cm80%J$wR z@hE4SsNva!;SLqgq!ER=!{WtF@YLGnc6j*Pv%vtqV6)W29oXbtOgL%8<=0ELj690t zbLJ^^dh8KGLG1J5WbMTa6K`{y_LBbHVq|ozTko9f$=$rjK{|4h=0yd=8-~elP}U!( zq0BU_=zbS*L^)sd(DT6HwP1PTC@18%WfJMG+)kO~-EFQLkHMVrXsi8pnE4hTG*9MU zV$}MNXkq14w%x{n$0Vwk1P&}D+O^>KE1OT*t$|XDq8n2|nJ?Lb2V1i{=M4n!Uhg2N z3kSqYms{Lo^t|$KpXJThxc9fgatGTwd1w6aKtU)xIp!#%`P7d=bb6^Krv*;#@x(Y~ zdEy7{mk!>HG`hbOqobnX^@fh`F=ra&QIeF%tX-j0;jqV;UA52i&r-&FFE_ucp}W;% zJB_37+J+R_)t3w|Oba+WV^n41!;slG>oUm~vKjTeR2}1-ioAq!KZ;*_)nA7p3CTSz z@@>fNi+VWrEOJcfT{&$k{o5{6%#*#bM2mds?X{1+`{PXuu4JqSi%f*K*YM`vRQ-4) zImNM^z)qIB;6F}h9!6-RGKy&@b?Uqbbkd)oV2E@TeAe{j{p%@(Pxq?uKTpx?CLdnsKvF6kC2IF__-f|D9tSxP5?M2ap$pRI zY8WS+D(S%ZBrYkVC1k2~Pb9`^aHP7m)b$HoLxM$I)#QurrtUoH88w1k7BLiTz+iEm bO-qhIcQ@N&M+54?*pctNz)h`>27vzoR==4D literal 0 HcmV?d00001 diff --git a/assets/icon/gl-matrix-icon-mono-64.webp b/assets/icon/gl-matrix-icon-mono-64.webp new file mode 100644 index 0000000000000000000000000000000000000000..2ae64c0c9ff0b2b04662a296d62eb3dcd5afea4f GIT binary patch literal 4026 zcmaKvXIK+kx5qcAG-*;rdIu2!73m~&IjD3DHFTszArz?w5Qqg1ARR&K;n1W@M+9k# z6p>=`AO}KA<_6Dw?s-4F=k8}__HX`c{rAjTGxK3g^mTP>m;kt=qiJMeq==vc z0LYSe*so1rOUo#il6(p%bG@8U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{$=L4L#1eVwT-47)@uM zj16-0@HV}By-w;(V}ye9ji<)PEQNRFGo;!T4!03=b%U(PD?@PZn6jkeI~i>1tE8Qr zDS5g-yt9*vzXnp%e3~sR-Fk!wi_lvOn(WE3x%AhK(?#hle4--P34=^3UtPan3zSEQ zE)JtTU1I1d0i$g4r+KLKkEgqZ_@oOa29m~w@v>LhrDWyaP%n<5*;_lvzXAUP DZy^{T literal 0 HcmV?d00001 diff --git a/esm-d-ts.config.js b/esm-d-ts.config.js new file mode 100644 index 00000000..3906523d --- /dev/null +++ b/esm-d-ts.config.js @@ -0,0 +1,28 @@ +/** + * Generates bundled type declaration for main and all sub-path exports: classic / common / f64 / swizzle, etc. + */ + +// Enables handling `imports` from `package.json` as local package paths transforming them and marking them external in +// bundling. +const importsLocal = true; + +// The ambient module declaration names need explicit replacement. This option performs a regex replacement on the +// final bundle. +const dtsReplace = { '#gl-matrix': 'gl-matrix' }; + +/** @type {import('@typhonjs-build-test/esm-d-ts').GenerateConfig[]} */ +const configs = [ + // Bundles main and all sub-path export types configured in `package.json` exports. + { input: './src/index.ts', output: './dist/index.d.mts', importsLocal }, + { input: './src/classic/index.ts', output: './dist/classic/index.d.mts', importsLocal }, + { input: './src/common/index.ts', output: './dist/common/index.d.mts', importsLocal }, + { input: './src/f64/index.ts', output: './dist/f64/index.d.mts', importsLocal }, + { input: './src/swizzle/index.ts', output: './dist/swizzle/index.d.mts', importsLocal }, + { input: './src/swizzle/f64/index.ts', output: './dist/swizzle/f64/index.d.mts', importsLocal }, + { input: './src/types/index.ts', output: './dist/types/index.d.mts', importsLocal }, + { input: './src/types/swizzle/index.ts', output: './dist/types/swizzle/index.d.mts', importsLocal, dtsReplace }, + { input: './src/types/swizzle/f64/index.ts', output: './dist/types/swizzle/f64/index.d.mts', importsLocal, dtsReplace }, + { input: './src/util/index.ts', output: './dist/util/index.d.mts', importsLocal } +]; + +export default configs; diff --git a/package-lock.json b/package-lock.json index 04e7fc48..3a67c60d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,162 @@ { "name": "gl-matrix", - "version": "4.0.0-beta.1", + "version": "4.0.0-beta.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gl-matrix", - "version": "4.0.0-beta.1", + "version": "4.0.0-beta.3", "license": "MIT", "devDependencies": { - "esbuild": "^0.15.15", - "typedoc": "^0.23.21", - "typescript": "^5.0.0", - "vitest": "^0.25.8" + "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", + "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", + "@typhonjs-utils/file-util": "^0.1.0", + "@vitest/coverage-v8": "^1.6.0", + "@vitest/ui": "^1.6.0", + "esbuild": "^0.21.0", + "typedoc": "0.25.12", + "typescript": "^5.4.0", + "vitest": "^1.6.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", + "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "dev": true, + "optional": true, + "dependencies": { + "@babel/highlight": "^7.24.6", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", + "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", + "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "dev": true, + "optional": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.6", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "optional": true + }, + "node_modules/@babel/parser": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.6.tgz", + "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.6.tgz", + "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.6", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", + "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", + "dev": true, + "dependencies": { + "@types/eslint": "^8.56.5", + "@types/estree": "^1.0.5", + "@typescript-eslint/types": "^7.2.0", + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" } }, "node_modules/@esbuild/android-arm": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", - "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", + "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", "cpu": [ "arm" ], @@ -32,9 +170,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz", - "integrity": "sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -48,9 +186,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.12.tgz", - "integrity": "sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -64,9 +202,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz", - "integrity": "sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -80,9 +218,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz", - "integrity": "sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -96,9 +234,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz", - "integrity": "sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -112,9 +250,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz", - "integrity": "sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -128,9 +266,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz", - "integrity": "sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -144,9 +282,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz", - "integrity": "sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -160,9 +298,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz", - "integrity": "sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -176,9 +314,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", - "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", + "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", "cpu": [ "loong64" ], @@ -192,9 +330,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz", - "integrity": "sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -208,9 +346,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz", - "integrity": "sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -224,9 +362,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz", - "integrity": "sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -240,9 +378,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz", - "integrity": "sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -256,9 +394,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz", - "integrity": "sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -272,9 +410,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz", - "integrity": "sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -288,9 +426,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz", - "integrity": "sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -304,9 +442,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz", - "integrity": "sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -320,9 +458,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz", - "integrity": "sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -336,9 +474,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz", - "integrity": "sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -352,9 +490,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz", - "integrity": "sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -367,223 +505,193 @@ "node": ">=12" } }, - "node_modules/@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true - }, - "node_modules/@types/chai-subset": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", - "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, "dependencies": { - "@types/chai": "*" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" } }, - "node_modules/@types/node": { - "version": "18.15.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz", - "integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==", - "dev": true + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "@sinclair/typebox": "^0.27.8" }, "engines": { - "node": ">=0.4.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, "engines": { - "node": ">=0.4.0" + "node": ">=6.0.0" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", - "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==", - "dev": true + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { - "node": "*" + "node": ">=6.0.0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": ">=4" + "node": ">= 8" } }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { - "node": "*" + "node": ">= 8" } }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "ms": "2.1.2" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 8" } }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, + "optional": true, "engines": { - "node": ">=6" + "node": ">=14" } }, - "node_modules/esbuild": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", - "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "node_modules/@polka/url": { + "version": "1.0.0-next.25", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", + "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", + "dev": true + }, + "node_modules/@rollup/plugin-alias": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz", + "integrity": "sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==", "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" + "dependencies": { + "slash": "^4.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.0.0" }, - "optionalDependencies": { - "@esbuild/android-arm": "0.15.18", - "@esbuild/linux-loong64": "0.15.18", - "esbuild-android-64": "0.15.18", - "esbuild-android-arm64": "0.15.18", - "esbuild-darwin-64": "0.15.18", - "esbuild-darwin-arm64": "0.15.18", - "esbuild-freebsd-64": "0.15.18", - "esbuild-freebsd-arm64": "0.15.18", - "esbuild-linux-32": "0.15.18", - "esbuild-linux-64": "0.15.18", - "esbuild-linux-arm": "0.15.18", - "esbuild-linux-arm64": "0.15.18", - "esbuild-linux-mips64le": "0.15.18", - "esbuild-linux-ppc64le": "0.15.18", - "esbuild-linux-riscv64": "0.15.18", - "esbuild-linux-s390x": "0.15.18", - "esbuild-netbsd-64": "0.15.18", - "esbuild-openbsd-64": "0.15.18", - "esbuild-sunos-64": "0.15.18", - "esbuild-windows-32": "0.15.18", - "esbuild-windows-64": "0.15.18", - "esbuild-windows-arm64": "0.15.18" - } - }, - "node_modules/esbuild-android-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz", - "integrity": "sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } } }, - "node_modules/esbuild-android-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz", - "integrity": "sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==", + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", "cpu": [ - "arm64" + "arm" ], "dev": true, "optional": true, "os": [ "android" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-darwin-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz", - "integrity": "sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==", + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", "cpu": [ - "x64" + "arm64" ], "dev": true, "optional": true, "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } + "android" + ] }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", - "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", "cpu": [ "arm64" ], @@ -591,79 +699,38 @@ "optional": true, "os": [ "darwin" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-freebsd-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz", - "integrity": "sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==", + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz", - "integrity": "sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz", - "integrity": "sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } + "darwin" + ] }, - "node_modules/esbuild-linux-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz", - "integrity": "sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==", + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", "cpu": [ - "x64" + "arm" ], "dev": true, "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-linux-arm": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz", - "integrity": "sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==", + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", "cpu": [ "arm" ], @@ -671,15 +738,12 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-linux-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz", - "integrity": "sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==", + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", "cpu": [ "arm64" ], @@ -687,31 +751,25 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz", - "integrity": "sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==", + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", "cpu": [ - "mips64el" + "arm64" ], "dev": true, "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz", - "integrity": "sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==", + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", "cpu": [ "ppc64" ], @@ -719,15 +777,12 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz", - "integrity": "sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==", + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", "cpu": [ "riscv64" ], @@ -735,15 +790,12 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-linux-s390x": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz", - "integrity": "sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==", + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", "cpu": [ "s390x" ], @@ -751,63 +803,51 @@ "optional": true, "os": [ "linux" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-netbsd-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz", - "integrity": "sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==", + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } + "linux" + ] }, - "node_modules/esbuild-openbsd-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz", - "integrity": "sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==", + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } + "linux" + ] }, - "node_modules/esbuild-sunos-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz", - "integrity": "sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==", + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", "cpu": [ - "x64" + "arm64" ], "dev": true, "optional": true, "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } + "win32" + ] }, - "node_modules/esbuild-windows-32": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz", - "integrity": "sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==", + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", "cpu": [ "ia32" ], @@ -815,15 +855,12 @@ "optional": true, "os": [ "win32" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-windows-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz", - "integrity": "sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==", + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", "cpu": [ "x64" ], @@ -831,412 +868,816 @@ "optional": true, "os": [ "win32" - ], - "engines": { - "node": ">=12" - } + ] }, - "node_modules/esbuild-windows-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz", - "integrity": "sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==", - "cpu": [ - "arm64" - ], + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@ts-morph/common": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", + "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" + "dependencies": { + "fast-glob": "^3.3.2", + "minimatch": "^9.0.3", + "mkdirp": "^3.0.1", + "path-browserify": "^1.0.1" } }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/@types/cytoscape": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.2.tgz", + "integrity": "sha512-eadSCH9hbRV9Ej93S8wact/Oe0DuQV4qlWfST/I6k4lBu6RgqI6mVFzvppcIGzWpzZRu7iyFjFhS2qW0w7KFRA==", + "dev": true + }, + "node_modules/@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, - "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@typescript-eslint/types": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", + "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", "dev": true, "engines": { - "node": "*" + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/@typhonjs-build-test/esm-d-ts": { + "version": "0.3.0-next.7", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", + "integrity": "sha512-xZS7Zz0LJZhdCV6z5NpwrKIMdghQdzypxSZ5iYB0FY+UQers5YkGW7BRs19XW8os0+LnP2ktZzWR2W5SkyHNuQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1" + "@es-joy/jsdoccomment": "^0.43.0", + "@rollup/plugin-alias": "^5.1.0", + "@types/cytoscape": "^3.21.2", + "@typhonjs-build-test/rollup-plugin-pkg-imports": "^0.5.0", + "@typhonjs-plugin/manager": "^0.1.2", + "@typhonjs-utils/file-util": "^0.1.0", + "@typhonjs-utils/logger-color": "^0.1.0", + "@typhonjs-utils/object": "^0.1.0", + "@typhonjs-utils/package-json": "^0.7.0", + "comment-parser": "^1.4.0", + "cytoscape": "^3.29.0", + "es-module-lexer": "^1.5.0", + "fs-extra": "^11.2.0", + "glob-to-regexp": "^0.4.0", + "import-meta-resolve": "^4.1.0", + "prettier": "^3.2.0", + "resolve.exports": "^2.0.2", + "rollup-plugin-dts": "^6.1.0", + "sade": "^1.8.1", + "ts-morph": "^22.0.0", + "type-fest": "^4.18.0", + "upath": "^2.0.1" + }, + "bin": { + "esm-d-ts": "src/cli/index.js" }, "engines": { - "node": ">= 0.4.0" + "node": ">=18" + }, + "peerDependencies": { + "rollup": "3.3 - 4", + "typescript": ">=5.1" } }, - "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "node_modules/@typhonjs-build-test/rollup-plugin-pkg-imports": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/rollup-plugin-pkg-imports/-/rollup-plugin-pkg-imports-0.5.0.tgz", + "integrity": "sha512-YAcRIETyEw4zMuQsJNQrOFHo/lqml88lligtClSSAQXnGT6ez0jiluDhxjzkJAQ2NGdALh09CGNL/xZgtUecCQ==", "dev": true, "dependencies": { - "has": "^1.0.3" + "@typhonjs-utils/package-json": "^0.7.0", + "glob-to-regexp": "^0.4.1", + "import-meta-resolve": "^4.0.0", + "resolve.exports": "^2.0.2" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=18.0" + }, + "peerDependencies": { + "rollup": "3.3 - 4" } }, - "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, - "node_modules/local-pkg": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", - "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "node_modules/@typhonjs-plugin/manager": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@typhonjs-plugin/manager/-/manager-0.1.2.tgz", + "integrity": "sha512-bMtnjVlqeiPjmW/U+rBm5Mb+ZoZs7uKyZYN3Rtq0DXzndyMrIDBOiQyssSwGxpFVDC7V9yArvt0EoGWDxAIYLQ==", "dev": true, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" + "node": ">=14.18" } }, - "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "node_modules/@typhonjs-typedoc/ts-lib-docs": { + "version": "2023.7.12", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2023.7.12.tgz", + "integrity": "sha512-vaiDbYGjnx7+gMM7KWSgNpGFxqr2Gw5MYpi9hvLWt8/nZ98EaTo1M4WjT6XtgbCw0w0x7greMlYWLgk7Mak/TA==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.0" + "peerDependencies": { + "typedoc": ">=0.24.8" } }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, - "node_modules/marked": { - "version": "4.2.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", - "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", + "node_modules/@typhonjs-typedoc/typedoc-pkg": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.0.5.tgz", + "integrity": "sha512-+0sLiuJJqEpptYizN/od1tzEmJIkheWIeJ+xV8ONzbNeXtWkUAHA5PzBEmXr2xxJQRpUhV5cYI0fQOAwOFcx5Q==", "dev": true, + "dependencies": { + "@typhonjs-typedoc/ts-lib-docs": "2023.7.12", + "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0-next.14", + "@typhonjs-utils/file-util": "^0.1.0", + "@typhonjs-utils/logger-color": "^0.1.0", + "@typhonjs-utils/object": "^0.1.0", + "@typhonjs-utils/package-json": "^0.7.0", + "glob": "^10.3.10", + "is-glob": "^4.0.3", + "resolve.exports": "^2.0.2", + "sade": "^1.8.1", + "upath": "^2" + }, "bin": { - "marked": "bin/marked.js" + "typedoc-pkg": "src/cli/index.js" }, "engines": { - "node": ">= 12" + "node": ">=18" + }, + "peerDependencies": { + "typedoc": ">=0.25.10 <0.26.0", + "typescript": ">=5.1.0 <6" } }, - "node_modules/minimatch": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", - "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", + "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { + "version": "0.2.0-next.14", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0-next.14.tgz", + "integrity": "sha512-ucMzhwtF/MKGqHxkCIpfrWMgZxdhfWLcAvwiEkgWpbmCmQUKhh6V+yGyHUG9TqRkZJCGXvgqNoziVyEYQKt/xw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "cheerio": "^1.0.0-rc.12" }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependencies": { + "typedoc": ">=0.25.10" } }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "node_modules/@typhonjs-utils/file-util": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", + "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" + "dependencies": { + "upath": "^2" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=16" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "node_modules/@typhonjs-utils/logger-color": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/logger-color/-/logger-color-0.1.0.tgz", + "integrity": "sha512-BWXSwxs5ZDVs4vi/YxJLLN3287+i4Z/KXqQuKUN5o5qWc4ioYU+ws9svZSL1XzqkLpF+j2oALhE8l0pmPydWxg==", + "dev": true, + "engines": { + "node": ">=14.18" + } }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "node_modules/@typhonjs-utils/object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/object/-/object-0.1.0.tgz", + "integrity": "sha512-XCG2Qae6FZzzm81q0ya3D/xBRKlXF8lELi5T2E+nNYjqzi9T+2LTCUKR84dpo856wXAFn3CdTvDQKn5OVVnLlQ==", "dev": true, "engines": { - "node": "*" + "node": ">=14.18" } }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "node_modules/@typhonjs-utils/package-json": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/package-json/-/package-json-0.7.0.tgz", + "integrity": "sha512-aFoXJuGJqUuPJ+00/voU/iIc1bPDx0nJBGHt0ntyc1XmQOZDuwq7mLpHGsdIXZlF1lMSX/B9AFtlLATSyVWrVQ==", + "dev": true, + "engines": { + "node": ">=12" + } }, - "node_modules/postcss": { - "version": "8.4.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", - "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", + "node_modules/@vitest/coverage-v8": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", + "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - } - ], "dependencies": { - "nanoid": "^3.3.4", + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.4", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0" }, - "engines": { - "node": "^10 || ^12 || >=14" + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "1.6.0" } }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "node_modules/@vitest/expect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "chai": "^4.3.10" }, - "bin": { - "resolve": "bin/resolve" + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.6.0", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://opencollective.com/vitest" } }, - "node_modules/rollup": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.19.1.tgz", - "integrity": "sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==", + "node_modules/@vitest/snapshot": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dev": true, - "bin": { - "rollup": "dist/bin/rollup" + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" }, - "engines": { - "node": ">=14.18.0", - "npm": ">=8.0.0" + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/shiki": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.1.tgz", - "integrity": "sha512-+Jz4nBkCBe0mEDqo1eKRcCdjRtrCjozmcbTUjbPTX7OOJfEbTZzlUWlZtGe3Gb5oV1/jnojhG//YZc3rs9zSEw==", + "node_modules/@vitest/ui": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", + "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", "dev": true, "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" + "@vitest/utils": "1.6.0", + "fast-glob": "^3.3.2", + "fflate": "^0.8.1", + "flatted": "^3.2.9", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "sirv": "^2.0.4" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "1.6.0" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/@vitest/utils": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">=0.10.0" + "node": ">=0.4.0" } }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.4.0" } }, - "node_modules/strip-literal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz", - "integrity": "sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==", + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, - "dependencies": { - "acorn": "^8.8.2" + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/ansi-sequence-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", + "dev": true + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/tinybench": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.4.0.tgz", - "integrity": "sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==", + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/tinypool": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.1.tgz", - "integrity": "sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==", + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, "engines": { - "node": ">=14.0.0" + "node": ">=8" } }, - "node_modules/tinyspy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.1.1.tgz", - "integrity": "sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==", + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, "engines": { - "node": ">=14.0.0" + "node": ">=8" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, "engines": { "node": ">=4" } }, - "node_modules/typedoc": { - "version": "0.23.28", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.28.tgz", - "integrity": "sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==", + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "optional": true, "dependencies": { - "lunr": "^2.3.9", - "marked": "^4.2.12", - "minimatch": "^7.1.3", - "shiki": "^0.14.1" - }, - "bin": { - "typedoc": "bin/typedoc" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">= 14.14" - }, - "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x" + "node": ">=4" } }, - "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "optional": true, + "dependencies": { + "color-convert": "^1.9.0" }, "engines": { - "node": ">=12.20" + "node": ">=4" } }, - "node_modules/vite": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz", - "integrity": "sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==", + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, "dependencies": { - "esbuild": "^0.17.5", - "postcss": "^8.4.21", - "resolve": "^1.22.1", - "rollup": "^3.18.0" - }, - "bin": { - "vite": "bin/vite.js" + "get-func-name": "^2.0.2" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "*" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dev": true, + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "engines": { + "node": ">= 6" }, - "peerDependencies": { - "@types/node": ">= 14", - "less": "*", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", + "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==", + "dev": true + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "optional": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "optional": true + }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cytoscape": { + "version": "3.29.2", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.29.2.tgz", + "integrity": "sha512-2G1ycU28Nh7OHT9rkXRLpCDP30MKH1dXJORZuBhtEhEW7pKwgPi77ImqlCWinouyE1PNepIOGZBOrE84DG7LyQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" }, "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { + "supports-color": { "optional": true } } }, - "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", - "integrity": "sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ==", + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", + "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", + "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.4", + "@esbuild/android-arm": "0.21.4", + "@esbuild/android-arm64": "0.21.4", + "@esbuild/android-x64": "0.21.4", + "@esbuild/darwin-arm64": "0.21.4", + "@esbuild/darwin-x64": "0.21.4", + "@esbuild/freebsd-arm64": "0.21.4", + "@esbuild/freebsd-x64": "0.21.4", + "@esbuild/linux-arm": "0.21.4", + "@esbuild/linux-arm64": "0.21.4", + "@esbuild/linux-ia32": "0.21.4", + "@esbuild/linux-loong64": "0.21.4", + "@esbuild/linux-mips64el": "0.21.4", + "@esbuild/linux-ppc64": "0.21.4", + "@esbuild/linux-riscv64": "0.21.4", + "@esbuild/linux-s390x": "0.21.4", + "@esbuild/linux-x64": "0.21.4", + "@esbuild/netbsd-x64": "0.21.4", + "@esbuild/openbsd-x64": "0.21.4", + "@esbuild/sunos-x64": "0.21.4", + "@esbuild/win32-arm64": "0.21.4", + "@esbuild/win32-ia32": "0.21.4", + "@esbuild/win32-x64": "0.21.4" + } + }, + "node_modules/esbuild/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", + "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", "cpu": [ - "arm" + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/android-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", + "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", + "cpu": [ + "arm64" ], "dev": true, "optional": true, @@ -1247,12 +1688,92 @@ "node": ">=12" } }, - "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz", - "integrity": "sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA==", + "node_modules/esbuild/node_modules/@esbuild/android-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", + "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", "cpu": [ - "loong64" + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", + "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", + "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", + "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", + "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-arm": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", + "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", + "cpu": [ + "arm" ], "dev": true, "optional": true, @@ -1263,835 +1784,4522 @@ "node": ">=12" } }, - "node_modules/vite/node_modules/esbuild": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz", - "integrity": "sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ==", + "node_modules/esbuild/node_modules/@esbuild/linux-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", + "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", + "cpu": [ + "arm64" + ], "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.17.12", - "@esbuild/android-arm64": "0.17.12", - "@esbuild/android-x64": "0.17.12", - "@esbuild/darwin-arm64": "0.17.12", - "@esbuild/darwin-x64": "0.17.12", - "@esbuild/freebsd-arm64": "0.17.12", - "@esbuild/freebsd-x64": "0.17.12", - "@esbuild/linux-arm": "0.17.12", - "@esbuild/linux-arm64": "0.17.12", - "@esbuild/linux-ia32": "0.17.12", - "@esbuild/linux-loong64": "0.17.12", - "@esbuild/linux-mips64el": "0.17.12", - "@esbuild/linux-ppc64": "0.17.12", - "@esbuild/linux-riscv64": "0.17.12", - "@esbuild/linux-s390x": "0.17.12", - "@esbuild/linux-x64": "0.17.12", - "@esbuild/netbsd-x64": "0.17.12", - "@esbuild/openbsd-x64": "0.17.12", - "@esbuild/sunos-x64": "0.17.12", - "@esbuild/win32-arm64": "0.17.12", - "@esbuild/win32-ia32": "0.17.12", - "@esbuild/win32-x64": "0.17.12" } }, - "node_modules/vitest": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.8.tgz", - "integrity": "sha512-X75TApG2wZTJn299E/TIYevr4E9/nBo1sUtZzn0Ci5oK8qnpZAZyhwg0qCeMSakGIWtc6oRwcQFyFfW14aOFWg==", + "node_modules/esbuild/node_modules/@esbuild/linux-ia32": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", + "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@types/chai": "^4.3.4", - "@types/chai-subset": "^1.3.3", - "@types/node": "*", - "acorn": "^8.8.1", - "acorn-walk": "^8.2.0", - "chai": "^4.3.7", - "debug": "^4.3.4", - "local-pkg": "^0.4.2", - "source-map": "^0.6.1", - "strip-literal": "^1.0.0", - "tinybench": "^2.3.1", - "tinypool": "^0.3.0", - "tinyspy": "^1.0.2", - "vite": "^3.0.0 || ^4.0.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=v14.16.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - }, + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", + "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", + "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", + "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-s390x": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", + "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", + "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", + "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", + "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/sunos-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", + "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", + "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-ia32": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", + "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", + "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", + "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "node_modules/magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/magicast": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", + "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@babel/types": "^7.24.0", + "source-map-js": "^1.2.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mlly": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", + "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.0", + "ufo": "^1.5.3" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", + "dev": true, + "dependencies": { + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" + } + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-dts": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz", + "integrity": "sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.10" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.24.2" + }, + "peerDependencies": { + "rollup": "^3.29.4 || ^4", + "typescript": "^4.5 || ^5.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shiki": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", + "dev": true, + "dependencies": { + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sirv": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "dev": true, + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", + "dev": true, + "dependencies": { + "js-tokens": "^9.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "optional": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tinybench": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ts-morph": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", + "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", + "dev": true, + "dependencies": { + "@ts-morph/common": "~0.23.0", + "code-block-writer": "^13.0.1" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", + "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedoc": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", + "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", + "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "marked": "^4.3.0", + "minimatch": "^9.0.3", + "shiki": "^0.14.7" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 16" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" + } + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/vite": { + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", + "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", + "dev": true, + "dependencies": { + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, + "node_modules/vitest": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.3", + "vite": "^5.0.0", + "vite-node": "1.6.0", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, "peerDependencies": { "@edge-runtime/vm": "*", - "@vitest/browser": "*", - "@vitest/ui": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", "happy-dom": "*", "jsdom": "*" }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", + "dev": true + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@babel/code-frame": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", + "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "dev": true, + "optional": true, + "requires": { + "@babel/highlight": "^7.24.6", + "picocolors": "^1.0.0" + } + }, + "@babel/helper-string-parser": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", + "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", + "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "dev": true, + "optional": true, + "requires": { + "@babel/helper-validator-identifier": "^7.24.6", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "optional": true + } + } + }, + "@babel/parser": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.6.tgz", + "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "dev": true + }, + "@babel/types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.6.tgz", + "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.6", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@es-joy/jsdoccomment": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", + "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", + "dev": true, + "requires": { + "@types/eslint": "^8.56.5", + "@types/estree": "^1.0.5", + "@typescript-eslint/types": "^7.2.0", + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + } + }, + "@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", + "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", + "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "dev": true, + "optional": true + }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, + "@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true + }, + "@polka/url": { + "version": "1.0.0-next.25", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", + "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", + "dev": true + }, + "@rollup/plugin-alias": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz", + "integrity": "sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==", + "dev": true, + "requires": { + "slash": "^4.0.0" + } + }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "dev": true, + "optional": true + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "@ts-morph/common": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", + "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", + "dev": true, + "requires": { + "fast-glob": "^3.3.2", + "minimatch": "^9.0.3", + "mkdirp": "^3.0.1", + "path-browserify": "^1.0.1" + } + }, + "@types/cytoscape": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.2.tgz", + "integrity": "sha512-eadSCH9hbRV9Ej93S8wact/Oe0DuQV4qlWfST/I6k4lBu6RgqI6mVFzvppcIGzWpzZRu7iyFjFhS2qW0w7KFRA==", + "dev": true + }, + "@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "@typescript-eslint/types": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", + "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "dev": true + }, + "@typhonjs-build-test/esm-d-ts": { + "version": "0.3.0-next.7", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", + "integrity": "sha512-xZS7Zz0LJZhdCV6z5NpwrKIMdghQdzypxSZ5iYB0FY+UQers5YkGW7BRs19XW8os0+LnP2ktZzWR2W5SkyHNuQ==", + "dev": true, + "requires": { + "@es-joy/jsdoccomment": "^0.43.0", + "@rollup/plugin-alias": "^5.1.0", + "@types/cytoscape": "^3.21.2", + "@typhonjs-build-test/rollup-plugin-pkg-imports": "^0.5.0", + "@typhonjs-plugin/manager": "^0.1.2", + "@typhonjs-utils/file-util": "^0.1.0", + "@typhonjs-utils/logger-color": "^0.1.0", + "@typhonjs-utils/object": "^0.1.0", + "@typhonjs-utils/package-json": "^0.7.0", + "comment-parser": "^1.4.0", + "cytoscape": "^3.29.0", + "es-module-lexer": "^1.5.0", + "fs-extra": "^11.2.0", + "glob-to-regexp": "^0.4.0", + "import-meta-resolve": "^4.1.0", + "prettier": "^3.2.0", + "resolve.exports": "^2.0.2", + "rollup-plugin-dts": "^6.1.0", + "sade": "^1.8.1", + "ts-morph": "^22.0.0", + "type-fest": "^4.18.0", + "upath": "^2.0.1" + } + }, + "@typhonjs-build-test/rollup-plugin-pkg-imports": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/rollup-plugin-pkg-imports/-/rollup-plugin-pkg-imports-0.5.0.tgz", + "integrity": "sha512-YAcRIETyEw4zMuQsJNQrOFHo/lqml88lligtClSSAQXnGT6ez0jiluDhxjzkJAQ2NGdALh09CGNL/xZgtUecCQ==", + "dev": true, + "requires": { + "@typhonjs-utils/package-json": "^0.7.0", + "glob-to-regexp": "^0.4.1", + "import-meta-resolve": "^4.0.0", + "resolve.exports": "^2.0.2" + } + }, + "@typhonjs-plugin/manager": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@typhonjs-plugin/manager/-/manager-0.1.2.tgz", + "integrity": "sha512-bMtnjVlqeiPjmW/U+rBm5Mb+ZoZs7uKyZYN3Rtq0DXzndyMrIDBOiQyssSwGxpFVDC7V9yArvt0EoGWDxAIYLQ==", + "dev": true + }, + "@typhonjs-typedoc/ts-lib-docs": { + "version": "2023.7.12", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2023.7.12.tgz", + "integrity": "sha512-vaiDbYGjnx7+gMM7KWSgNpGFxqr2Gw5MYpi9hvLWt8/nZ98EaTo1M4WjT6XtgbCw0w0x7greMlYWLgk7Mak/TA==", + "dev": true, + "requires": {} + }, + "@typhonjs-typedoc/typedoc-pkg": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.0.5.tgz", + "integrity": "sha512-+0sLiuJJqEpptYizN/od1tzEmJIkheWIeJ+xV8ONzbNeXtWkUAHA5PzBEmXr2xxJQRpUhV5cYI0fQOAwOFcx5Q==", + "dev": true, + "requires": { + "@typhonjs-typedoc/ts-lib-docs": "2023.7.12", + "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0-next.14", + "@typhonjs-utils/file-util": "^0.1.0", + "@typhonjs-utils/logger-color": "^0.1.0", + "@typhonjs-utils/object": "^0.1.0", + "@typhonjs-utils/package-json": "^0.7.0", + "glob": "^10.3.10", + "is-glob": "^4.0.3", + "resolve.exports": "^2.0.2", + "sade": "^1.8.1", + "upath": "^2" + } + }, + "@typhonjs-typedoc/typedoc-theme-dmt": { + "version": "0.2.0-next.14", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0-next.14.tgz", + "integrity": "sha512-ucMzhwtF/MKGqHxkCIpfrWMgZxdhfWLcAvwiEkgWpbmCmQUKhh6V+yGyHUG9TqRkZJCGXvgqNoziVyEYQKt/xw==", + "dev": true, + "requires": { + "cheerio": "^1.0.0-rc.12" + } + }, + "@typhonjs-utils/file-util": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", + "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", + "dev": true, + "requires": { + "upath": "^2" + } + }, + "@typhonjs-utils/logger-color": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/logger-color/-/logger-color-0.1.0.tgz", + "integrity": "sha512-BWXSwxs5ZDVs4vi/YxJLLN3287+i4Z/KXqQuKUN5o5qWc4ioYU+ws9svZSL1XzqkLpF+j2oALhE8l0pmPydWxg==", + "dev": true + }, + "@typhonjs-utils/object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/object/-/object-0.1.0.tgz", + "integrity": "sha512-XCG2Qae6FZzzm81q0ya3D/xBRKlXF8lELi5T2E+nNYjqzi9T+2LTCUKR84dpo856wXAFn3CdTvDQKn5OVVnLlQ==", + "dev": true + }, + "@typhonjs-utils/package-json": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/package-json/-/package-json-0.7.0.tgz", + "integrity": "sha512-aFoXJuGJqUuPJ+00/voU/iIc1bPDx0nJBGHt0ntyc1XmQOZDuwq7mLpHGsdIXZlF1lMSX/B9AFtlLATSyVWrVQ==", + "dev": true + }, + "@vitest/coverage-v8": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", + "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.4", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0" + } + }, + "@vitest/expect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "dev": true, + "requires": { + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "chai": "^4.3.10" + } + }, + "@vitest/runner": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "dev": true, + "requires": { + "@vitest/utils": "1.6.0", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + } + }, + "@vitest/snapshot": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "dev": true, + "requires": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + } + }, + "@vitest/spy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "dev": true, + "requires": { + "tinyspy": "^2.2.0" + } + }, + "@vitest/ui": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", + "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", + "dev": true, + "requires": { + "@vitest/utils": "1.6.0", + "fast-glob": "^3.3.2", + "fflate": "^0.8.1", + "flatted": "^3.2.9", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "sirv": "^2.0.4" + } + }, + "@vitest/utils": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "dev": true, + "requires": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + } + }, + "acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true + }, + "acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true + }, + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "ansi-sequence-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", + "dev": true + }, + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true + }, + "chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^1.9.0" + } + } + } + }, + "check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "requires": { + "get-func-name": "^2.0.2" + } + }, + "cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dev": true, + "requires": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + } + }, + "cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + } + }, + "code-block-writer": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", + "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "optional": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "optional": true + }, + "comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + } + }, + "css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true + }, + "cytoscape": { + "version": "3.29.2", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.29.2.tgz", + "integrity": "sha512-2G1ycU28Nh7OHT9rkXRLpCDP30MKH1dXJORZuBhtEhEW7pKwgPi77ImqlCWinouyE1PNepIOGZBOrE84DG7LyQ==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true + }, + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + } + }, + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0" + } + }, + "domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "requires": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + } + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + }, + "es-module-lexer": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", + "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "dev": true + }, + "esbuild": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", + "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.4", + "@esbuild/android-arm": "0.21.4", + "@esbuild/android-arm64": "0.21.4", + "@esbuild/android-x64": "0.21.4", + "@esbuild/darwin-arm64": "0.21.4", + "@esbuild/darwin-x64": "0.21.4", + "@esbuild/freebsd-arm64": "0.21.4", + "@esbuild/freebsd-x64": "0.21.4", + "@esbuild/linux-arm": "0.21.4", + "@esbuild/linux-arm64": "0.21.4", + "@esbuild/linux-ia32": "0.21.4", + "@esbuild/linux-loong64": "0.21.4", + "@esbuild/linux-mips64el": "0.21.4", + "@esbuild/linux-ppc64": "0.21.4", + "@esbuild/linux-riscv64": "0.21.4", + "@esbuild/linux-s390x": "0.21.4", + "@esbuild/linux-x64": "0.21.4", + "@esbuild/netbsd-x64": "0.21.4", + "@esbuild/openbsd-x64": "0.21.4", + "@esbuild/sunos-x64": "0.21.4", + "@esbuild/win32-arm64": "0.21.4", + "@esbuild/win32-ia32": "0.21.4", + "@esbuild/win32-x64": "0.21.4" + }, + "dependencies": { + "@esbuild/aix-ppc64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", + "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", + "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", + "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", + "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", + "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", + "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", + "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", + "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", + "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", + "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", + "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", + "dev": true, "optional": true }, - "@vitest/browser": { + "@esbuild/linux-ppc64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", + "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", + "dev": true, "optional": true }, - "@vitest/ui": { + "@esbuild/linux-riscv64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", + "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", + "dev": true, "optional": true }, - "happy-dom": { + "@esbuild/linux-s390x": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", + "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", + "dev": true, "optional": true }, - "jsdom": { + "@esbuild/linux-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", + "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", + "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", + "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", + "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", + "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", + "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", + "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", + "dev": true, "optional": true } } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true - }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true - } - }, - "dependencies": { - "@esbuild/android-arm": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", - "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "optional": true }, - "@esbuild/android-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz", - "integrity": "sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA==", + "esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, - "optional": true + "requires": { + "estraverse": "^5.1.0" + } }, - "@esbuild/android-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.12.tgz", - "integrity": "sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w==", - "dev": true, - "optional": true + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true }, - "@esbuild/darwin-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz", - "integrity": "sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg==", + "estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, - "optional": true + "requires": { + "@types/estree": "^1.0.0" + } }, - "@esbuild/darwin-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz", - "integrity": "sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA==", + "execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "optional": true + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + } }, - "@esbuild/freebsd-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz", - "integrity": "sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ==", + "fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "optional": true + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } }, - "@esbuild/freebsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz", - "integrity": "sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw==", + "fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, - "optional": true + "requires": { + "reusify": "^1.0.4" + } }, - "@esbuild/linux-arm": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz", - "integrity": "sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA==", - "dev": true, - "optional": true + "fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true }, - "@esbuild/linux-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz", - "integrity": "sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg==", + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, - "optional": true + "requires": { + "to-regex-range": "^5.0.1" + } }, - "@esbuild/linux-ia32": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz", - "integrity": "sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw==", + "flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, - "optional": true + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + } }, - "@esbuild/linux-loong64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", - "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, - "optional": true + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } }, - "@esbuild/linux-mips64el": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz", - "integrity": "sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA==", + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "optional": true }, - "@esbuild/linux-ppc64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz", - "integrity": "sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A==", + "get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true + }, + "get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true + }, + "glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", "dev": true, - "optional": true + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + } }, - "@esbuild/linux-riscv64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz", - "integrity": "sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA==", + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "optional": true + "requires": { + "is-glob": "^4.0.1" + } }, - "@esbuild/linux-s390x": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz", - "integrity": "sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g==", + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "optional": true }, - "@esbuild/linux-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz", - "integrity": "sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA==", + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", "dev": true, - "optional": true + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } }, - "@esbuild/netbsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz", - "integrity": "sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg==", + "human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true + }, + "import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, - "optional": true + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } }, - "@esbuild/openbsd-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz", - "integrity": "sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA==", + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "optional": true + "requires": { + "is-extglob": "^2.1.1" + } }, - "@esbuild/sunos-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz", - "integrity": "sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg==", + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true + }, + "istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "optional": true + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } }, - "@esbuild/win32-arm64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz", - "integrity": "sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg==", + "istanbul-lib-source-maps": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", + "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", "dev": true, - "optional": true + "requires": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + } }, - "@esbuild/win32-ia32": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz", - "integrity": "sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng==", + "istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, - "optional": true + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } }, - "@esbuild/win32-x64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz", - "integrity": "sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw==", + "jackspeak": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "dev": true, - "optional": true + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } }, - "@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, + "jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true + }, + "jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, - "@types/chai-subset": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", - "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "requires": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + } + }, + "loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, "requires": { - "@types/chai": "*" + "get-func-name": "^2.0.1" } }, - "@types/node": { - "version": "18.15.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz", - "integrity": "sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==", + "lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "dev": true }, - "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "magicast": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", + "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "dev": true, + "requires": { + "@babel/parser": "^7.24.4", + "@babel/types": "^7.24.0", + "source-map-js": "^1.2.0" + } + }, + "make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, + "marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "dev": true }, - "ansi-sequence-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", - "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==", + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "requires": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + } + }, + "mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true }, - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "requires": { - "balanced-match": "^1.0.0" + "brace-expansion": "^2.0.1" } }, - "chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, + "mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true + }, + "mlly": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", + "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", "dev": true, "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.0", + "ufo": "^1.5.3" } }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", "dev": true }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true + }, + "npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "requires": { + "path-key": "^4.0.0" + }, + "dependencies": { + "path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true + } + } + }, + "nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, "requires": { - "ms": "2.1.2" + "boolbase": "^1.0.0" } }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { - "type-detect": "^4.0.0" + "wrappy": "1" } }, - "esbuild": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", - "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", - "dev": true, - "requires": { - "@esbuild/android-arm": "0.15.18", - "@esbuild/linux-loong64": "0.15.18", - "esbuild-android-64": "0.15.18", - "esbuild-android-arm64": "0.15.18", - "esbuild-darwin-64": "0.15.18", - "esbuild-darwin-arm64": "0.15.18", - "esbuild-freebsd-64": "0.15.18", - "esbuild-freebsd-arm64": "0.15.18", - "esbuild-linux-32": "0.15.18", - "esbuild-linux-64": "0.15.18", - "esbuild-linux-arm": "0.15.18", - "esbuild-linux-arm64": "0.15.18", - "esbuild-linux-mips64le": "0.15.18", - "esbuild-linux-ppc64le": "0.15.18", - "esbuild-linux-riscv64": "0.15.18", - "esbuild-linux-s390x": "0.15.18", - "esbuild-netbsd-64": "0.15.18", - "esbuild-openbsd-64": "0.15.18", - "esbuild-sunos-64": "0.15.18", - "esbuild-windows-32": "0.15.18", - "esbuild-windows-64": "0.15.18", - "esbuild-windows-arm64": "0.15.18" - } - }, - "esbuild-android-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz", - "integrity": "sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==", + "onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "optional": true + "requires": { + "mimic-fn": "^4.0.0" + } }, - "esbuild-android-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz", - "integrity": "sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==", + "p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", "dev": true, - "optional": true + "requires": { + "yocto-queue": "^1.0.0" + } }, - "esbuild-darwin-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz", - "integrity": "sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==", + "parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, - "optional": true + "requires": { + "entities": "^4.4.0" + } }, - "esbuild-darwin-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", - "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", "dev": true, - "optional": true + "requires": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + } }, - "esbuild-freebsd-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz", - "integrity": "sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==", - "dev": true, - "optional": true + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true }, - "esbuild-freebsd-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz", - "integrity": "sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==", - "dev": true, - "optional": true + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true }, - "esbuild-linux-32": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz", - "integrity": "sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==", - "dev": true, - "optional": true + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true }, - "esbuild-linux-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz", - "integrity": "sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==", + "path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "optional": true + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + } }, - "esbuild-linux-arm": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz", - "integrity": "sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==", - "dev": true, - "optional": true + "pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true }, - "esbuild-linux-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz", - "integrity": "sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==", - "dev": true, - "optional": true + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true }, - "esbuild-linux-mips64le": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz", - "integrity": "sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==", - "dev": true, - "optional": true + "picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true }, - "esbuild-linux-ppc64le": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz", - "integrity": "sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==", - "dev": true, - "optional": true + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, - "esbuild-linux-riscv64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz", - "integrity": "sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==", + "pkg-types": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", "dev": true, - "optional": true + "requires": { + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" + } }, - "esbuild-linux-s390x": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz", - "integrity": "sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==", + "postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, - "optional": true + "requires": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + } }, - "esbuild-netbsd-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz", - "integrity": "sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==", - "dev": true, - "optional": true + "prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true }, - "esbuild-openbsd-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz", - "integrity": "sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==", + "pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, - "optional": true + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + } }, - "esbuild-sunos-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz", - "integrity": "sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==", - "dev": true, - "optional": true + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true }, - "esbuild-windows-32": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz", - "integrity": "sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==", - "dev": true, - "optional": true + "react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true }, - "esbuild-windows-64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz", - "integrity": "sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==", - "dev": true, - "optional": true + "resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true }, - "esbuild-windows-arm64": { - "version": "0.15.18", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz", - "integrity": "sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==", - "dev": true, - "optional": true + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "rollup": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "requires": { + "@rollup/rollup-android-arm-eabi": "4.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", + "@types/estree": "1.0.5", + "fsevents": "~2.3.2" + } }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", - "dev": true + "rollup-plugin-dts": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz", + "integrity": "sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.2", + "magic-string": "^0.30.10" + } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "requires": { - "function-bind": "^1.1.1" + "queue-microtask": "^1.2.2" } }, - "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", "dev": true, "requires": { - "has": "^1.0.3" + "mri": "^1.1.0" } }, - "jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true }, - "local-pkg": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", - "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "shiki": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", "dev": true, "requires": { - "get-func-name": "^2.0.0" + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" } }, - "lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, - "marked": { - "version": "4.2.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", - "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true }, - "minimatch": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", - "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", + "sirv": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", "dev": true, "requires": { - "brace-expansion": "^2.0.1" + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true }, - "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, - "postcss": { - "version": "8.4.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", - "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "requires": { - "nanoid": "^3.3.4", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" } }, - "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, - "rollup": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.19.1.tgz", - "integrity": "sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==", + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "requires": { - "fsevents": "~2.3.2" + "ansi-regex": "^6.0.1" } }, - "shiki": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.1.tgz", - "integrity": "sha512-+Jz4nBkCBe0mEDqo1eKRcCdjRtrCjozmcbTUjbPTX7OOJfEbTZzlUWlZtGe3Gb5oV1/jnojhG//YZc3rs9zSEw==", + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true }, "strip-literal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz", - "integrity": "sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", "dev": true, "requires": { - "acorn": "^8.8.2" + "js-tokens": "^9.0.0" } }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } }, "tinybench": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.4.0.tgz", - "integrity": "sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", "dev": true }, "tinypool": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.1.tgz", - "integrity": "sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "dev": true }, "tinyspy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.1.1.tgz", - "integrity": "sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "dev": true }, + "ts-morph": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", + "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", + "dev": true, + "requires": { + "@ts-morph/common": "~0.23.0", + "code-block-writer": "^13.0.1" + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", + "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", + "dev": true + }, "typedoc": { - "version": "0.23.28", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.28.tgz", - "integrity": "sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", + "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", "dev": true, "requires": { "lunr": "^2.3.9", - "marked": "^4.2.12", - "minimatch": "^7.1.3", - "shiki": "^0.14.1" + "marked": "^4.3.0", + "minimatch": "^9.0.3", + "shiki": "^0.14.7" } }, "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true + }, + "ufo": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, + "universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true + }, + "upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", "dev": true }, "vite": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz", - "integrity": "sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", + "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", "dev": true, "requires": { - "esbuild": "^0.17.5", - "fsevents": "~2.3.2", - "postcss": "^8.4.21", - "resolve": "^1.22.1", - "rollup": "^3.18.0" + "esbuild": "^0.20.1", + "fsevents": "~2.3.3", + "postcss": "^8.4.38", + "rollup": "^4.13.0" }, "dependencies": { "@esbuild/android-arm": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", - "integrity": "sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz", - "integrity": "sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "dev": true, "optional": true }, "esbuild": { - "version": "0.17.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz", - "integrity": "sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "requires": { - "@esbuild/android-arm": "0.17.12", - "@esbuild/android-arm64": "0.17.12", - "@esbuild/android-x64": "0.17.12", - "@esbuild/darwin-arm64": "0.17.12", - "@esbuild/darwin-x64": "0.17.12", - "@esbuild/freebsd-arm64": "0.17.12", - "@esbuild/freebsd-x64": "0.17.12", - "@esbuild/linux-arm": "0.17.12", - "@esbuild/linux-arm64": "0.17.12", - "@esbuild/linux-ia32": "0.17.12", - "@esbuild/linux-loong64": "0.17.12", - "@esbuild/linux-mips64el": "0.17.12", - "@esbuild/linux-ppc64": "0.17.12", - "@esbuild/linux-riscv64": "0.17.12", - "@esbuild/linux-s390x": "0.17.12", - "@esbuild/linux-x64": "0.17.12", - "@esbuild/netbsd-x64": "0.17.12", - "@esbuild/openbsd-x64": "0.17.12", - "@esbuild/sunos-x64": "0.17.12", - "@esbuild/win32-arm64": "0.17.12", - "@esbuild/win32-ia32": "0.17.12", - "@esbuild/win32-x64": "0.17.12" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } } } }, + "vite-node": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "dev": true, + "requires": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + } + }, "vitest": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.25.8.tgz", - "integrity": "sha512-X75TApG2wZTJn299E/TIYevr4E9/nBo1sUtZzn0Ci5oK8qnpZAZyhwg0qCeMSakGIWtc6oRwcQFyFfW14aOFWg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", "dev": true, "requires": { - "@types/chai": "^4.3.4", - "@types/chai-subset": "^1.3.3", - "@types/node": "*", - "acorn": "^8.8.1", - "acorn-walk": "^8.2.0", - "chai": "^4.3.7", + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", "debug": "^4.3.4", - "local-pkg": "^0.4.2", - "source-map": "^0.6.1", - "strip-literal": "^1.0.0", - "tinybench": "^2.3.1", - "tinypool": "^0.3.0", - "tinyspy": "^1.0.2", - "vite": "^3.0.0 || ^4.0.0" + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.3", + "vite": "^5.0.0", + "vite-node": "1.6.0", + "why-is-node-running": "^2.2.2" } }, "vscode-oniguruma": { @@ -2105,6 +6313,125 @@ "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "requires": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + } + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true } } } diff --git a/package.json b/package.json index 1e7319fb..e70fc481 100644 --- a/package.json +++ b/package.json @@ -1,39 +1,74 @@ { - "version": "4.0.0-beta.2", + "version": "4.0.0-beta.3", "name": "gl-matrix", "description": "Javascript Matrix and Vector library for High Performance 3D web apps", "private": true, "sideEffects": false, "type": "module", - "main": "./dist/esm/index.js", - "module": "./dist/esm/index.js", + "license": "MIT", + "imports": { + "#gl-matrix": "./src/index.ts", + "#gl-matrix/classic": "./src/classic/index.ts", + "#gl-matrix/common": "./src/common/index.ts", + "#gl-matrix/f64": "./src/f64/index.ts", + "#gl-matrix/swizzle": "./src/swizzle/index.ts", + "#gl-matrix/swizzle/f64": "./src/swizzle/f64/index.ts", + "#gl-matrix/types": "./src/types/index.ts", + "#gl-matrix/util": "./src/util/index.ts" + }, "exports": { - ".": "./dist/esm/index.js", - "./common": "./dist/esm/common.js", - "./mat2": "./dist/esm/mat2.js", - "./mat2d": "./dist/esm/mat2d.js", - "./mat3": "./dist/esm/mat3.js", - "./mat4": "./dist/esm/mat4.js", - "./quat": "./dist/esm/quat.js", - "./quat2": "./dist/esm/quat2.js", - "./vec2": "./dist/esm/vec2.js", - "./vec3": "./dist/esm/vec3.js", - "./vec4": "./dist/esm/vec4.js", - "./f64": "./dist/esm/f64/index.js", - "./f64/common": "./dist/esm/f64/common.js", - "./f64/mat2": "./dist/esm/f64/mat2.js", - "./f64/mat2d": "./dist/esm/f64/mat2d.js", - "./f64/mat3": "./dist/esm/f64/mat3.js", - "./f64/mat4": "./dist/esm/f64/mat4.js", - "./f64/quat": "./dist/esm/f64/quat.js", - "./f64/quat2": "./dist/esm/f64/quat2.js", - "./f64/vec2": "./dist/esm/f64/vec2.js", - "./f64/vec3": "./dist/esm/f64/vec3.js", - "./f64/vec4": "./dist/esm/f64/vec4.js" + ".": { + "types": "./dist/index.d.mts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + }, + "./classic": { + "types": "./dist/classic/index.d.mts", + "import": "./dist/classic/index.js", + "require": "./dist/classic/index.cjs" + }, + "./common": { + "types": "./dist/common/index.d.mts", + "import": "./dist/common/index.js", + "require": "./dist/common/index.cjs" + }, + "./f64": { + "types": "./dist/f64/index.d.mts", + "import": "./dist/f64/index.js", + "require": "./dist/f64/index.cjs" + }, + "./swizzle": { + "types": "./dist/swizzle/index.d.mts", + "import": "./dist/swizzle/index.js", + "require": "./dist/swizzle/index.cjs" + }, + "./swizzle/f64": { + "types": "./dist/swizzle/f64/index.d.mts", + "import": "./dist/swizzle/f64/index.js", + "require": "./dist/swizzle/f64/index.cjs" + }, + "./types": { + "types": "./dist/types/index.d.mts", + "import": "./dist/types/index.js", + "require": "./dist/types/index.cjs" + }, + "./types/swizzle": { + "types": "./dist/types/swizzle/index.d.mts", + "import": "./dist/types/swizzle/index.js", + "require": "./dist/types/swizzle/index.cjs" + }, + "./types/swizzle/f64": { + "types": "./dist/types/swizzle/f64/index.d.mts", + "import": "./dist/types/swizzle/f64/index.js", + "require": "./dist/types/swizzle/f64/index.cjs" + }, + "./util": { + "types": "./dist/util/index.d.mts", + "import": "./dist/util/index.js", + "require": "./dist/util/index.cjs" + } }, - "types": "./dist/esm/index.d.ts", - "homepage": "http://glmatrix.net", - "license": "MIT", + "homepage": "https://glmatrix.net", "bugs": { "url": "https://github.com/toji/gl-matrix/issues" }, @@ -51,20 +86,47 @@ "email": "sinisterchipmunk@gmail.com" } ], + "files": [ + "/dist" + ], + "keywords": [ + "vector", + "matrix", + "library", + "webgl", + "webgpu" + ], "scripts": { - "build": "tsc", - "build-docs": "typedoc src/index.ts", - "gen64": "node scripts/gen-f64.mjs", - "build64": "npm run gen64 && tsc --project tsconfig64.json", - "bundle": "node scripts/bundle.mjs", - "build-all": "npm run build && npm run build64 && npm run build-docs && npm run bundle", - "watch": "tsc --watch", - "test": "npm run gen64 && vitest run" + "build": "npm run gen64 && tsc --project tsconfig-build.json && node scripts/bundle.js", + "build-all": "npm run build && npm run types && npm run docs", + "docs": "typedoc-pkg --api-link es", + "gen64": "node scripts/gen-f64.js", + "test": "vitest run", + "test-ui": "vitest --ui --coverage", + "types": "esm-d-ts gen -c" }, "devDependencies": { - "esbuild": "^0.15.15", - "typedoc": "^0.23.21", - "typescript": "^5.0.0", - "vitest": "^0.25.8" + "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", + "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", + "@typhonjs-utils/file-util": "^0.1.0", + "@vitest/coverage-v8": "^1.6.0", + "@vitest/ui": "^1.6.0", + "esbuild": "^0.21.0", + "typedoc": "0.25.12", + "typescript": "^5.4.0", + "vitest": "^1.6.0" + }, + "typedocOptions": { + "dmtLinksIcon": [ + { + "icon": "./assets/icon/gl-matrix-icon-mono-64.webp", + "title": "Homepage", + "url": "https://glmatrix.net/" + } + ], + "dmtLinksService": { + "GitHub": "https://github.com/toji/gl-matrix", + "NPM": "https://www.npmjs.com/package/gl-matrix" + } } } diff --git a/scripts/bundle.js b/scripts/bundle.js new file mode 100644 index 00000000..25eb2f5d --- /dev/null +++ b/scripts/bundle.js @@ -0,0 +1,157 @@ +import * as esbuild from 'esbuild'; +import * as fs from 'fs'; +import { getFileList } from '@typhonjs-utils/file-util'; + +const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + +// ESBuild data ------------------------------------------------------------------------------------------------------ + +const banner = { js: `// glMatrix - v${pkg.version}` }; + +// Add the `package.json` imports as external for ESBuild removing the leading `#`. +const external = Object.keys(pkg.imports ?? {}).map((key) => key.slice(1)); + +// Rewrite `imports` from `package.json` with actual main / sub-path export path. ------------------------------------ + +// Retrieve a list of all `*.js` files from `./dist` and subdirectories. +const list = await getFileList({ dir: './dist', includeFile: /\.js$/, walk: true }); + +// Replace all instances of `#gl-matrix` with `gl-matrix` and add leading banner. +for (const file of list) { + const filepath = `./dist/${file}`; + let srcFile = fs.readFileSync(filepath, 'utf8'); + srcFile = srcFile.replaceAll('#gl-matrix', 'gl-matrix'); + fs.writeFileSync(filepath, `${banner.js}\n${srcFile}`); +} + +// Common JS Bundles ------------------------------------------------------------------------------------------------- + +// `gl-matrix/classic` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/classic/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/classic/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/common` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/common/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/common/index.cjs', +}).catch(() => process.exit(1)); + +// Main `gl-matrix` export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/f64` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/f64/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/f64/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/swizzle` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/swizzle/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/swizzle/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/swizzle/f64` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/swizzle/f64/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/swizzle/f64/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/types` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/types/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/types/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/types/swizzle` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/types/swizzle/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/types/swizzle/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/types/swizzle/f64` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/types/swizzle/f64/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/types/swizzle/f64/index.cjs', +}).catch(() => process.exit(1)); + +// `gl-matrix/util` sub-path export. +esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/util/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/util/index.cjs', +}).catch(() => process.exit(1)); diff --git a/scripts/bundle.mjs b/scripts/bundle.mjs deleted file mode 100644 index 1d64f978..00000000 --- a/scripts/bundle.mjs +++ /dev/null @@ -1,70 +0,0 @@ -import * as esbuild from 'esbuild'; -import * as fs from 'fs'; - -const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); - -const copyFileSync = (source, dest) => { - const content = fs.readFileSync(source, 'utf-8'); - fs.writeFileSync(dest, content); -}; - -//const license = fs.readFileSync('LICENSE.md', 'utf8'); -const banner = { - js: `// glMatrix - v${pkg.version}` -} - -const banner64 = { - js: `// glMatrix (Float64) - v${pkg.version}` -} - -// Standard release (Float32) - -// ES Modules build -esbuild.build({ - logLevel: 'info', - entryPoints: ['src/index.ts'], - bundle: true, - minify: true, - sourcemap: true, - banner, - format: 'esm', - outfile: 'dist/esm/gl-matrix.js', -}).catch(() => process.exit(1)); - -// Common JS Build -esbuild.build({ - logLevel: 'info', - entryPoints: ['src/index.ts'], - bundle: true, - minify: true, - sourcemap: true, - banner, - format: 'cjs', - outfile: 'dist/cjs/gl-matrix.js', -}).catch(() => process.exit(1)); - -// Float64 release - -// ES Modules build -esbuild.build({ - logLevel: 'info', - entryPoints: ['f64/src/index.ts'], - bundle: true, - minify: true, - sourcemap: true, - banner: banner64, - format: 'esm', - outfile: 'dist/esm/f64/gl-matrix.js', -}).catch(() => process.exit(1)); - -// Common JS Build -esbuild.build({ - logLevel: 'info', - entryPoints: ['f64/src/index.ts'], - bundle: true, - minify: true, - sourcemap: true, - banner: banner64, - format: 'cjs', - outfile: 'dist/cjs/f64/gl-matrix.js', -}).catch(() => process.exit(1)); \ No newline at end of file diff --git a/scripts/gen-f64.js b/scripts/gen-f64.js new file mode 100644 index 00000000..2243e39d --- /dev/null +++ b/scripts/gen-f64.js @@ -0,0 +1,64 @@ +// This script file generates a copy of the library which uses Float64Array as +// the base class for each type for greater precision. + +import * as fs from 'fs'; +import * as path from 'path'; +import { fileURLToPath } from 'url'; + +const SRC_F32_PATH = './src/_lib/f32'; +const SRC_F64_PATH = './src/_lib/f64'; + +const TEST_F32_PATH = './tests/f32'; +const TEST_F64_PATH = './tests/f64'; + +/** + * @param {string} srcPath - Source path. + * @param {string} dstPath - Destination path. + * @param {[[RegExp, string]]} replacement - An array of replacement pairs. + */ +function copyFileWithSearchAndReplace(srcPath, dstPath, replacement) { + // Write out the typescript implementation to the src file. + let srcFile = fs.readFileSync(srcPath, 'utf8'); + + for (const replace of replacement) { + srcFile = srcFile.replace(replace[0], replace[1]); + } + + fs.writeFileSync(dstPath, srcFile); +} + +function copyDir(srcDir, outDir) { + const src_files = fs.readdirSync(srcDir); + fs.mkdirSync(outDir, { recursive: true }); + + for (const file of src_files) { + const srcPath = path.join(srcDir, file); + const outPath = path.join(outDir, file); + console.log(`Copying from ${srcPath} to ${outPath}`); + + copyFileWithSearchAndReplace(srcPath, outPath, [ + [/EnableSwizzles/g, 'EnableSwizzlesF64'], + [/Float32Array/g, 'Float64Array'], + [/['"]#gl-matrix['"]/g, '\'#gl-matrix/f64\''], + [/['"]#gl-matrix\/swizzle['"]/g, '\'#gl-matrix/swizzle/f64\''] + ]); + } +} + +// Export this function to be run in Vitest global setup. +export function executeGenF64() { + // Clean any existing files + fs.rmSync(SRC_F64_PATH, { recursive: true, force: true }); + fs.rmSync(TEST_F64_PATH, { recursive: true, force: true }); + + // Copy src + copyDir(SRC_F32_PATH, SRC_F64_PATH); + + // Copy tests + copyDir(TEST_F32_PATH, TEST_F64_PATH); +} + +// Execute immediately when run directly by NPM run as a script. +if (process.argv[1] === fileURLToPath(import.meta.url)) { + executeGenF64(); +} diff --git a/scripts/gen-f64.mjs b/scripts/gen-f64.mjs deleted file mode 100644 index 24270ca5..00000000 --- a/scripts/gen-f64.mjs +++ /dev/null @@ -1,48 +0,0 @@ -// This script file generates a copy of the library which uses Float64Array as -// the base class for each type for greater precision. - -import * as fs from 'fs'; -import * as path from 'path'; - -const SRC_PATH = './src'; -const TEST_PATH = './tests'; -const OUT_PATH = './f64'; - -let FILES_TO_COPY_WITHOUT_UPDATE = [ - 'common.ts', - 'index.ts', - 'swizzle.ts', -] - -function copyFileWithSearchAndReplace(srcPath, dstPath, searchValue, replaceValue) { - // Write out the typescript implementation to the src file - const srcFile = fs.readFileSync(srcPath, 'utf8'); - const updatedSrc = srcFile.replace(searchValue, replaceValue); - fs.writeFileSync(dstPath, updatedSrc); -} - -function copyDir(srcDir) { - const src_files = fs.readdirSync(srcDir); - fs.mkdirSync(path.join(OUT_PATH, srcDir), { recursive: true }); - - for (const file of src_files) { - const srcPath = path.join(srcDir, file); - const outPath = path.join(OUT_PATH, srcPath); - console.log(`Copying from ${srcPath} to ${outPath}`); - - if (FILES_TO_COPY_WITHOUT_UPDATE.includes(file)) { - fs.copyFileSync(srcPath, outPath); - } else { - copyFileWithSearchAndReplace(srcPath, outPath, /Float32Array/g, 'Float64Array'); - } - } -} - -// Clean any existing files -fs.rmSync(OUT_PATH, { recursive: true, force: true }); - -// Copy src -copyDir(SRC_PATH); - -// Copy tests -copyDir(TEST_PATH); diff --git a/scripts/gen-swizzle.js b/scripts/gen-swizzle.js new file mode 100644 index 00000000..9359e17d --- /dev/null +++ b/scripts/gen-swizzle.js @@ -0,0 +1,152 @@ +// This script file generates implementation and test code for every vector +// swizzle variants, since there's a lot of them and making small tweaks to +// every one by hand any time you want to change things is a pain. + +import * as fs from 'fs'; + +const VEC_COMPONENT_COUNTS = [2, 3, 4]; +const VEC_COMPONENTS = ['x', 'y', 'z', 'w']; +const COLOR_COMPONENTS = ['r', 'g', 'b', 'a']; +const SRC_PATH = './src/swizzle/index.ts'; +const SRC_PATH_F64 = './src/swizzle/f64/index.ts'; +const TEST_PATH = './tests/f32'; +const TYPES_PATH = './src/types/swizzle/index.ts'; +const TYPES_PATH_F64 = './src/types/swizzle/f64/index.ts'; + +const AUTOGEN_REGEX = /\[Swizzle Autogen](.+?)\[\/Swizzle Autogen]/s + +function getComponentVariants(size, components) { + if (size === 0) { + return {'': []}; + } + + const thisLevel = {}; + const prevLevel = getComponentVariants(size - 1, components); + for (let i = 0; i < components.length; ++i) { + const component = components[i]; + for (const [prevComponent, indices] of Object.entries(prevLevel)) { + thisLevel[`${component}${prevComponent}`] = [i, ...indices]; + } + } + + return thisLevel; +} + +function updateFileAutogen(path, content) { + // Write out the typescript implementation to the src file + console.log(`Writing to ${path}`); + const srcFile = fs.readFileSync(path, 'utf8'); + let autogenSrc = `[Swizzle Autogen]\n${content}\n // [/Swizzle Autogen]`; + const updatedSrc = srcFile.replace(AUTOGEN_REGEX, autogenSrc); + fs.writeFileSync(path, updatedSrc); +} + +const prevSeenSwizzles = new Set(); +const uniqueSwizzlesByComponentCount = {}; + +for (const vecSize of VEC_COMPONENT_COUNTS) { + const vecType = `Vec${vecSize}`; + + // Generate all swizzle variants for this vector type. + let swizzles = {}; + const components = VEC_COMPONENTS.slice(0, vecSize); + for (const count of VEC_COMPONENT_COUNTS) { + swizzles = { ...swizzles, ...getComponentVariants(count, components) }; + } + + const colorComponents = COLOR_COMPONENTS.slice(0, vecSize); + for (const count of VEC_COMPONENT_COUNTS) { + swizzles = { ...swizzles, ...getComponentVariants(count, colorComponents) }; + } + + uniqueSwizzlesByComponentCount[vecSize] = Object.keys(swizzles).filter((key) => !prevSeenSwizzles.has(key)); + uniqueSwizzlesByComponentCount[vecSize].forEach((key) => { prevSeenSwizzles.add(key); }); + + // Update swizzle tests. + + let testSrc = ''; + for (const [name, indices] of Object.entries(swizzles)) { + const outType = `Vec${indices.length}`; + const argNames = name.split('').join(', '); + const args = indices.map((index) => `v[${index}]`).join(', '); + testSrc += ` + describe('${vecType}().${name}', () => { + it('should return ${outType}(${argNames})', () => expect(v.${name}).toBeVec(${args})); + it('should be return a copy', () => { + let sw = v.${name}; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + `; + } + + updateFileAutogen(`${TEST_PATH}/Vec${vecSize}-swizzle.spec.ts`, testSrc); +} + +// Update `src/swizzle/index.ts` and `src/swizzle/f64/index.ts`. ----------------------------------------------------- + +const swizzleArrays = ` + const VEC2_SWIZZLES = ['${uniqueSwizzlesByComponentCount[2].join("','")}']; + const VEC3_SWIZZLES = ['${uniqueSwizzlesByComponentCount[3].join("','")}']; + const VEC4_SWIZZLES = ['${uniqueSwizzlesByComponentCount[4].join("','")}']; +`; + +updateFileAutogen(SRC_PATH, swizzleArrays); +updateFileAutogen(SRC_PATH_F64, swizzleArrays); + +// Update `src/types/swizzle/index.ts` and `src/types/swizzle/f64/index.ts`. ----------------------------------------- + +const swizzleTypeAlias = { + 2: 'Vec2Alias', + 3: 'Vec3Alias', + 4: 'Vec4Alias' +} + +let swizzleTypes = ` + /** + * Vec2 swizzle extension accessors. + */ + interface Vec2 { +`; + +uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ + get ${key}(): ${swizzleTypeAlias[key.length]};\n`) + +swizzleTypes += ` }\n`; + +swizzleTypes += ` + /** + * Vec3 swizzle extension accessors. + */ + interface Vec3 { +`; + +uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ + get ${key}(): ${swizzleTypeAlias[key.length]};\n`) + +uniqueSwizzlesByComponentCount[3].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ + get ${key}(): ${swizzleTypeAlias[key.length]};\n`) + +swizzleTypes += ` }\n`; + +swizzleTypes += ` + /** + * Vec4 swizzle extension accessors. + */ + interface Vec4 { +`; + +uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ + get ${key}(): ${swizzleTypeAlias[key.length]};\n`) + +uniqueSwizzlesByComponentCount[3].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ + get ${key}(): ${swizzleTypeAlias[key.length]};\n`) + +uniqueSwizzlesByComponentCount[4].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ + get ${key}(): ${swizzleTypeAlias[key.length]};\n`) + +swizzleTypes += ` }\n`; + +updateFileAutogen(TYPES_PATH, swizzleTypes); +updateFileAutogen(TYPES_PATH_F64, swizzleTypes); diff --git a/scripts/gen-swizzle.mjs b/scripts/gen-swizzle.mjs deleted file mode 100644 index 139f8212..00000000 --- a/scripts/gen-swizzle.mjs +++ /dev/null @@ -1,95 +0,0 @@ -// This script file generates implementation and test code for every vector -// swizzle variants, since there's a lot of them and making small tweaks to -// evenry one by hand any time you want to change things is a pain. - -import * as fs from 'fs'; - -const VEC_COMPONENT_COUNTS = [2, 3, 4]; -const VEC_COMPONENTS = ['x', 'y', 'z', 'w']; -const COLOR_COMPONENTS = ['r', 'g', 'b', 'a']; -const SRC_PATH = './src'; -const TEST_PATH = './tests' - -const AUTOGEN_REGEX = /\[Swizzle Autogen\](.+?)\[\/Swizzle Autogen\]/s - -function getComponentVariants(size, components) { - if (size == 0) { - return {'': []}; - } - - const thisLevel = {}; - const prevLevel = getComponentVariants(size - 1, components); - for (let i = 0; i < components.length; ++i) { - const component = components[i]; - for (const [prevComponent, indices] of Object.entries(prevLevel)) { - thisLevel[`${component}${prevComponent}`] = [i, ...indices]; - } - } - - return thisLevel; -} - -function updateFileAutogen(path, content) { - // Write out the typescript implementation to the src file - console.log(`Writing to ${path}`); - const srcFile = fs.readFileSync(path, 'utf8'); - let autogenSrc = `[Swizzle Autogen]\n${content}\n // [/Swizzle Autogen]`; - const updatedSrc = srcFile.replace(AUTOGEN_REGEX, autogenSrc); - fs.writeFileSync(path, updatedSrc); -} - -function getSwizzleImpl(name, indices) { - const outType = `Vec${indices.length}`; - const args = indices.map((index) => `this[${index}]`).join(', '); - return `get ${name}(): ${outType} { return new ${outType}(${args}); }`; -} - -const prevSeenSwizzles = new Set(); -const uniqueSwizzlesByComponentCount = {}; - -for (const vecSize of VEC_COMPONENT_COUNTS) { - const vecType = `Vec${vecSize}`; - - // Generate all swizzle variants for this vector type. - let swizzles = {}; - const components = VEC_COMPONENTS.slice(0, vecSize); - for (const count of VEC_COMPONENT_COUNTS) { - swizzles = { ...swizzles, ...getComponentVariants(count, components) }; - } - - const colorComponents = COLOR_COMPONENTS.slice(0, vecSize); - for (const count of VEC_COMPONENT_COUNTS) { - swizzles = { ...swizzles, ...getComponentVariants(count, colorComponents) }; - } - - uniqueSwizzlesByComponentCount[vecSize] = Object.keys(swizzles).filter((key) => !prevSeenSwizzles.has(key)); - uniqueSwizzlesByComponentCount[vecSize].forEach((key) => { prevSeenSwizzles.add(key); }); - - let testSrc = ''; - for (const [name, indices] of Object.entries(swizzles)) { - const outType = `Vec${indices.length}`; - const argNames = name.split('').join(', '); - const args = indices.map((index) => `v[${index}]`).join(', '); - testSrc += ` - describe("${vecType}().${name}", () => { - it("should return ${outType}(${argNames})", () => { - expect(v.${name}).toBeVec(${args}); - }); - it("should be return a copy", () => { - let sw = v.${name}; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - `; - } - - updateFileAutogen(`${TEST_PATH}/vec${vecSize}-swizzle.spec.ts`, testSrc); -} - -let swizzleArrays = ` - const VEC2_SWIZZLES = ['${uniqueSwizzlesByComponentCount[2].join("','")}']; - const VEC3_SWIZZLES = ['${uniqueSwizzlesByComponentCount[3].join("','")}']; - const VEC4_SWIZZLES = ['${uniqueSwizzlesByComponentCount[4].join("','")}']; -`; -updateFileAutogen(`${SRC_PATH}/swizzle.ts`, swizzleArrays); diff --git a/src/mat2.ts b/src/_lib/f32/Mat2.ts similarity index 93% rename from src/mat2.ts rename to src/_lib/f32/Mat2.ts index efeb9034..f096f13d 100644 --- a/src/mat2.ts +++ b/src/_lib/f32/Mat2.ts @@ -1,28 +1,15 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Vec2Like } from './vec2.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A 2x2 Matrix given as a {@link Mat2}, a 4-element floating point TypedArray, - * or an array of 4 numbers. - */ -export type Mat2Like = [ - number, number, - number, number -] | FloatArray; - -const IDENTITY_2X2 = new Float32Array([ - 1, 0, - 0, 1 -]); +import type { Mat2Like, Vec2Like } from '#gl-matrix/types'; /** * A 2x2 Matrix */ export class Mat2 extends Float32Array { - /** - * The number of bytes in a {@link Mat2}. - */ - static readonly BYTE_LENGTH = 4 * Float32Array.BYTES_PER_ELEMENT; + static #IDENTITY_2X2 = new Float32Array([ + 1, 0, + 0, 1 + ]); /** * Create a {@link Mat2}. @@ -44,7 +31,7 @@ export class Mat2 extends Float32Array { } break; default: - super(IDENTITY_2X2); break; + super(Mat2.#IDENTITY_2X2); break; } } @@ -82,7 +69,7 @@ export class Mat2 extends Float32Array { * @returns `this` */ identity(): Mat2 { - this.set(IDENTITY_2X2); + this.set(Mat2.#IDENTITY_2X2); return this; } @@ -146,9 +133,20 @@ export class Mat2 extends Float32Array { return Mat2.rotate(this, this, rad) as Mat2; } - //================ + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH(): number { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + + //=================== // Static methods - //================ + //=================== /** * Creates a new, identity {@link Mat2} @@ -573,10 +571,10 @@ export class Mat2 extends Float32Array { const b3 = b[3]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && - Math.abs(a3 - b3) <= EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) ); } @@ -590,7 +588,6 @@ export class Mat2 extends Float32Array { static str(a: Readonly): string { return `Mat2(${a.join(', ')})`; } - } // Instance method alias assignments @@ -599,8 +596,3 @@ Mat2.prototype.mul = Mat2.prototype.multiply; // Static method alias assignments Mat2.mul = Mat2.multiply; Mat2.sub = Mat2.subtract; - -/** - * {@link Mat2} alias for backwards compatibility - */ -export const mat2 = Mat2; \ No newline at end of file diff --git a/src/mat2d.ts b/src/_lib/f32/Mat2d.ts similarity index 92% rename from src/mat2d.ts rename to src/_lib/f32/Mat2d.ts index be3a872b..4ccd26d6 100644 --- a/src/mat2d.ts +++ b/src/_lib/f32/Mat2d.ts @@ -1,30 +1,16 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Vec2Like } from './vec2.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A 2x3 Matrix given as a {@link Mat2d}, a 6-element floating point TypedArray, - * or an array of 6 numbers. - */ -export type Mat2dLike = [ - number, number, - number, number, - number, number -] | FloatArray; - -const IDENTITY_2X3 = new Float32Array([ - 1, 0, - 0, 1, - 0, 0, -]); +import type { Mat2dLike, Vec2Like } from '#gl-matrix/types'; /** * A 2x3 Matrix */ export class Mat2d extends Float32Array { - /** - * The number of bytes in a {@link Mat2d}. - */ - static readonly BYTE_LENGTH = 6 * Float32Array.BYTES_PER_ELEMENT; + static #IDENTITY_2X3 = new Float32Array([ + 1, 0, + 0, 1, + 0, 0, + ]); /** * Create a {@link Mat2}. @@ -47,7 +33,7 @@ export class Mat2d extends Float32Array { } break; default: - super(IDENTITY_2X3); break; + super(Mat2d.#IDENTITY_2X3); break; } } @@ -85,7 +71,7 @@ export class Mat2d extends Float32Array { * @returns `this` */ identity(): Mat2d { - this.set(IDENTITY_2X3); + this.set(Mat2d.#IDENTITY_2X3); return this; } @@ -140,9 +126,20 @@ export class Mat2d extends Float32Array { return Mat2d.scale(this, this, v) as Mat2d; } - //================ + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH(): number { + return 6 * Float32Array.BYTES_PER_ELEMENT; + } + + //=================== // Static methods - //================ + //=================== /** * Creates a new, identity {@link Mat2d} @@ -596,12 +593,12 @@ export class Mat2d extends Float32Array { const b5 = b[5]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && - Math.abs(a3 - b3) <= EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && - Math.abs(a4 - b4) <= EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && - Math.abs(a5 - b5) <= EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) ); } @@ -615,14 +612,8 @@ export class Mat2d extends Float32Array { static str(a: Readonly): string { return `Mat2d(${a.join(', ')})`; } - } // Static method alias assignments Mat2d.mul = Mat2d.multiply; Mat2d.sub = Mat2d.subtract; - -/** - * {@link Mat2d} alias for backwards compatibility - */ -export const mat2d = Mat2d; \ No newline at end of file diff --git a/src/mat3.ts b/src/_lib/f32/Mat3.ts similarity index 93% rename from src/mat3.ts rename to src/_lib/f32/Mat3.ts index 798f9a08..db7def3e 100644 --- a/src/mat3.ts +++ b/src/_lib/f32/Mat3.ts @@ -1,33 +1,16 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Mat2dLike } from './mat2d.js'; -import { Mat4Like } from './mat4.js'; -import { Vec2Like } from './vec2.js'; -import { QuatLike } from './quat.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A 3x3 Matrix given as a {@link Mat3}, a 9-element floating point TypedArray, - * or an array of 9 numbers. - */ -export type Mat3Like = [ - number, number, number, - number, number, number, - number, number, number -] | FloatArray; - -const IDENTITY_3X3 = new Float32Array([ - 1, 0, 0, - 0, 1, 0, - 0, 0, 1, -]); +import type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types'; /** * A 3x3 Matrix */ export class Mat3 extends Float32Array { - /** - * The number of bytes in a {@link Mat3}. - */ - static readonly BYTE_LENGTH = 9 * Float32Array.BYTES_PER_ELEMENT; + static #IDENTITY_3X3 = new Float32Array([ + 1, 0, 0, + 0, 1, 0, + 0, 0, 1, + ]); /** * Create a {@link Mat3}. @@ -50,7 +33,7 @@ export class Mat3 extends Float32Array { } break; default: - super(IDENTITY_3X3); break; + super(Mat3.#IDENTITY_3X3); break; } } @@ -88,7 +71,7 @@ export class Mat3 extends Float32Array { * @returns `this` */ identity(): Mat3 { - this.set(IDENTITY_3X3); + this.set(Mat3.#IDENTITY_3X3); return this; } @@ -163,9 +146,20 @@ export class Mat3 extends Float32Array { return Mat3.scale(this, this, v) as Mat3; } - //================ + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH(): number { + return 9 * Float32Array.BYTES_PER_ELEMENT; + } + + //=================== // Static methods - //================ + //=================== /** * Creates a new, identity {@link Mat3} @@ -1004,15 +998,15 @@ export class Mat3 extends Float32Array { const b8 = b[8]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && - Math.abs(a3 - b3) <= EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && - Math.abs(a4 - b4) <= EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && - Math.abs(a5 - b5) <= EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && - Math.abs(a6 - b6) <= EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && - Math.abs(a7 - b7) <= EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && - Math.abs(a8 - b8) <= EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && + Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) ); } @@ -1034,8 +1028,3 @@ Mat3.prototype.mul = Mat3.prototype.multiply; // Static method alias assignments Mat3.mul = Mat3.multiply; Mat3.sub = Mat3.subtract; - -/** - * {@link Mat3} alias for backwards compatibility - */ -export const mat3 = Mat3; \ No newline at end of file diff --git a/src/mat4.ts b/src/_lib/f32/Mat4.ts similarity index 95% rename from src/mat4.ts rename to src/_lib/f32/Mat4.ts index c813d622..a74dd401 100644 --- a/src/mat4.ts +++ b/src/_lib/f32/Mat4.ts @@ -1,34 +1,23 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Vec3Like } from './vec3.js'; -import { QuatLike } from './quat.js'; -import { Quat2Like } from './quat2.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A 4x4 Matrix given as a {@link Mat4}, a 16-element floating point TypedArray, - * or an array of 16 numbers. - */ -export type Mat4Like = [ - number, number, number, number, - number, number, number, number, - number, number, number, number, - number, number, number, number -] | FloatArray; - -const IDENTITY_4X4 = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1, -]); +import type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; /** * A 4x4 Matrix */ export class Mat4 extends Float32Array { + static #IDENTITY_4X4 = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, + ]); + /** - * The number of bytes in a {@link Mat4}. + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. */ - static readonly BYTE_LENGTH = 16 * Float32Array.BYTES_PER_ELEMENT; + static #TMP_VEC3 = new Float32Array(3); /** * Create a {@link Mat4}. @@ -52,7 +41,7 @@ export class Mat4 extends Float32Array { } break; default: - super(IDENTITY_4X4); break; + super(Mat4.#IDENTITY_4X4); break; } } @@ -90,7 +79,7 @@ export class Mat4 extends Float32Array { * @returns `this` */ identity(): Mat4 { - this.set(IDENTITY_4X4); + this.set(Mat4.#IDENTITY_4X4); return this; } @@ -269,9 +258,20 @@ export class Mat4 extends Float32Array { return Mat4.orthoZO(this, left, right, bottom, top, near, far) as Mat4; } - //================ + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH(): number { + return 16 * Float32Array.BYTES_PER_ELEMENT; + } + + //=================== // Static methods - //================ + //=================== /** * Creates a new, identity {@link Mat4} @@ -782,7 +782,7 @@ export class Mat4 extends Float32Array { let z = axis[2]; let len = Math.sqrt(x * x + y * y + z * z); - if (len < EPSILON) { + if (len < GLM_EPSILON) { return null; } @@ -1061,7 +1061,7 @@ export class Mat4 extends Float32Array { let z = axis[2]; let len = Math.sqrt(x * x + y * y + z * z); - if (len < EPSILON) { + if (len < GLM_EPSILON) { return null; } @@ -1279,15 +1279,15 @@ export class Mat4 extends Float32Array { let magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense if (magnitude > 0) { - tmpVec3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude; - tmpVec3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude; - tmpVec3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude; + Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude; + Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude; + Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude; } else { - tmpVec3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; - tmpVec3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; - tmpVec3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; } - Mat4.fromRotationTranslation(out, a as QuatLike, tmpVec3); + Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3); return out; } @@ -1472,11 +1472,11 @@ export class Mat4 extends Float32Array { * @return `out` */ static getRotation(out: QuatLike, mat: Readonly): QuatLike { - Mat4.getScaling(tmpVec3, mat); + Mat4.getScaling(Mat4.#TMP_VEC3, mat); - const is1 = 1 / tmpVec3[0]; - const is2 = 1 / tmpVec3[1]; - const is3 = 1 / tmpVec3[2]; + const is1 = 1 / Mat4.#TMP_VEC3[0]; + const is2 = 1 / Mat4.#TMP_VEC3[1]; + const is3 = 1 / Mat4.#TMP_VEC3[2]; const sm11 = mat[0] * is1; const sm12 = mat[1] * is2; @@ -2118,9 +2118,9 @@ export class Mat4 extends Float32Array { const centerz = center[2]; if ( - Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON + Math.abs(eyex - centerx) < GLM_EPSILON && + Math.abs(eyey - centery) < GLM_EPSILON && + Math.abs(eyez - centerz) < GLM_EPSILON ) { return Mat4.identity(out); } @@ -2469,22 +2469,22 @@ export class Mat4 extends Float32Array { const b15 = b[15]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && - Math.abs(a3 - b3) <= EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && - Math.abs(a4 - b4) <= EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && - Math.abs(a5 - b5) <= EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && - Math.abs(a6 - b6) <= EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && - Math.abs(a7 - b7) <= EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && - Math.abs(a8 - b8) <= EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && - Math.abs(a9 - b9) <= EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && - Math.abs(a10 - b10) <= EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && - Math.abs(a11 - b11) <= EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && - Math.abs(a12 - b12) <= EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && - Math.abs(a13 - b13) <= EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && - Math.abs(a14 - b14) <= EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && - Math.abs(a15 - b15) <= EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && + Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && + Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && + Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && + Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && + Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && + Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && + Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && + Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)) ); } @@ -2500,10 +2500,6 @@ export class Mat4 extends Float32Array { } } -// Temporary variables to prevent repeated allocations in the algorithms above. -// These are declared as TypedArrays to aid in tree-shaking. -const tmpVec3 = new Float32Array(3); - // Instance method alias assignments Mat4.prototype.mul = Mat4.prototype.multiply; @@ -2513,8 +2509,3 @@ Mat4.mul = Mat4.multiply; Mat4.frustum = Mat4.frustumNO; Mat4.perspective = Mat4.perspectiveNO; Mat4.ortho = Mat4.orthoNO; - -/** - * Mat4 alias for backwards compatibility - */ -export const mat4 = Mat4; \ No newline at end of file diff --git a/src/quat.ts b/src/_lib/f32/Quat.ts similarity index 92% rename from src/quat.ts rename to src/_lib/f32/Quat.ts index 9efa0030..33b355b3 100644 --- a/src/quat.ts +++ b/src/_lib/f32/Quat.ts @@ -1,22 +1,25 @@ -import { EPSILON, ANGLE_ORDER } from './common.js'; -import { Mat3Like } from './mat3.js'; -import { Vec3, Vec3Like } from './vec3.js'; -import { Vec4, Vec4Like } from './vec4.js'; +import { Vec3 } from './Vec3.js'; +import { Vec4 } from './Vec4.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A Quaternion given as a {@link Quat}, a 4-element floating point TypedArray, - * or an array of 4 numbers. - */ -export type QuatLike = Vec4Like; +import type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types'; /** * Quaternion */ export class Quat extends Float32Array { - /** - * The number of bytes in a {@link Quat}. - */ - static readonly BYTE_LENGTH = 4 * Float32Array.BYTES_PER_ELEMENT; + static #DEFAULT_ANGLE_ORDER = 'zyx'; + + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + + static #TMP_QUAT1 = new Float32Array(4); + static #TMP_QUAT2 = new Float32Array(4); + static #TMP_MAT3 = new Float32Array(9); + + static #TMP_VEC3 = new Float32Array(3); + static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]); + static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]); /** * Create a {@link Quat}. @@ -222,6 +225,17 @@ export class Quat extends Float32Array { return Quat.dot(this, b); } + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH(): number { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== // Static methods //=================== @@ -289,7 +303,7 @@ export class Quat extends Float32Array { static getAxisAngle(out_axis: Vec3Like, q: Readonly): number { const rad = Math.acos(q[3]) * 2.0; const s = Math.sin(rad / 2.0); - if (s > EPSILON) { + if (s > GLM_EPSILON) { out_axis[0] = q[0] / s; out_axis[1] = q[1] / s; out_axis[2] = q[2] / s; @@ -545,7 +559,7 @@ export class Quat extends Float32Array { bw = -bw; } // calculate coefficients - if (1.0 - cosom > EPSILON) { + if (1.0 - cosom > GLM_EPSILON) { // standard case (slerp) const omega = Math.acos(cosom); const sinom = Math.sin(omega); @@ -687,7 +701,7 @@ export class Quat extends Float32Array { * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. * @returns `out` */ - static fromEuler(out: QuatLike, x: number, y: number, z: number, order = ANGLE_ORDER): QuatLike { + static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike { let halfToRad = (0.5 * Math.PI) / 180.0; x *= halfToRad; y *= halfToRad; @@ -963,10 +977,10 @@ export class Quat extends Float32Array { static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike { let dot = Vec3.dot(a, b); if (dot < -0.999999) { - Vec3.cross(tmpVec3, xUnitVec3, a); - if (Vec3.mag(tmpVec3) < 0.000001) Vec3.cross(tmpVec3, yUnitVec3, a); - Vec3.normalize(tmpVec3, tmpVec3); - Quat.setAxisAngle(out, tmpVec3, Math.PI); + Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a); + if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); + Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3); + Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI); return out; } else if (dot > 0.999999) { out[0] = 0; @@ -975,10 +989,10 @@ export class Quat extends Float32Array { out[3] = 1; return out; } else { - Vec3.cross(tmpVec3, a, b); - out[0] = tmpVec3[0]; - out[1] = tmpVec3[1]; - out[2] = tmpVec3[2]; + Vec3.cross(Quat.#TMP_VEC3, a, b); + out[0] = Quat.#TMP_VEC3[0]; + out[1] = Quat.#TMP_VEC3[1]; + out[2] = Quat.#TMP_VEC3[2]; out[3] = 1 + dot; return Quat.normalize(out, out); } @@ -997,9 +1011,9 @@ export class Quat extends Float32Array { * @returns `out` */ static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike { - Quat.slerp(tmpQuat1, a, d, t); - Quat.slerp(tmpQuat2, b, c, t); - Quat.slerp(out, tmpQuat1, tmpQuat2, 2 * t * (1 - t)); + Quat.slerp(Quat.#TMP_QUAT1, a, d, t); + Quat.slerp(Quat.#TMP_QUAT2, b, c, t); + Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t)); return out; } @@ -1012,37 +1026,27 @@ export class Quat extends Float32Array { * * @param out - The receiving quaternion * @param view - the vector representing the viewing direction - * @param right - the vector representing the local "right" direction - * @param up - the vector representing the local "up" direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction * @returns `out` */ static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike { - tmpMat3[0] = right[0]; - tmpMat3[3] = right[1]; - tmpMat3[6] = right[2]; + Quat.#TMP_MAT3[0] = right[0]; + Quat.#TMP_MAT3[3] = right[1]; + Quat.#TMP_MAT3[6] = right[2]; - tmpMat3[1] = up[0]; - tmpMat3[4] = up[1]; - tmpMat3[7] = up[2]; + Quat.#TMP_MAT3[1] = up[0]; + Quat.#TMP_MAT3[4] = up[1]; + Quat.#TMP_MAT3[7] = up[2]; - tmpMat3[2] = -view[0]; - tmpMat3[5] = -view[1]; - tmpMat3[8] = -view[2]; + Quat.#TMP_MAT3[2] = -view[0]; + Quat.#TMP_MAT3[5] = -view[1]; + Quat.#TMP_MAT3[8] = -view[2]; - return Quat.normalize(out, Quat.fromMat3(out, tmpMat3)); + return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3)); } } -// Temporary variables to prevent repeated allocations in the algorithms above. -// These are declared as TypedArrays to aid in tree-shaking. -const tmpQuat1 = new Float32Array(4); -const tmpQuat2 = new Float32Array(4); -const tmpMat3 = new Float32Array(9); - -const tmpVec3 = new Float32Array(3); -const xUnitVec3 = new Float32Array([1, 0, 0]); -const yUnitVec3 = new Float32Array([0, 1, 0]); - // Methods which re-use the Vec4 implementation Quat.set = Vec4.set; Quat.add = Vec4.add; @@ -1062,8 +1066,3 @@ Quat.mul = Quat.multiply; Quat.mag = Quat.magnitude; Quat.length = Quat.magnitude; Quat.len = Quat.magnitude; - -/** - * Quat alias for backwards compatibility - */ -export const quat = Quat; \ No newline at end of file diff --git a/src/quat2.ts b/src/_lib/f32/Quat2.ts similarity index 94% rename from src/quat2.ts rename to src/_lib/f32/Quat2.ts index 670ec4a2..0c1c14d4 100644 --- a/src/quat2.ts +++ b/src/_lib/f32/Quat2.ts @@ -1,25 +1,18 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Mat4, Mat4Like } from './mat4.js'; -import { Quat, QuatLike } from './quat.js'; -import { Vec3Like } from './vec3.js'; +import { Mat4 } from './Mat4.js'; +import { Quat } from './Quat.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A Dual Quaternion given as a {@link Quat2}, an 8-element floating point - * TypedArray, or an array of 8 numbers. - */ -export type Quat2Like = [ - number, number, number, number, - number, number, number, number -] | FloatArray; +import type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; /** * Dual Quaternion */ export class Quat2 extends Float32Array { - /** - * The number of bytes in a {@link Quat}. - */ - static readonly BYTE_LENGTH = 8 * Float32Array.BYTES_PER_ELEMENT; + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + + static #TMP_QUAT = new Float32Array(4); + static #TMP_VEC3 = new Float32Array(3); /** * Create a {@link Quat2}. @@ -73,6 +66,16 @@ export class Quat2 extends Float32Array { return this; } + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH(): number { + return 8 * Float32Array.BYTES_PER_ELEMENT; + } //=================== // Static methods @@ -221,9 +224,9 @@ export class Quat2 extends Float32Array { * @returns `out` */ static fromMat4(out: Quat2Like, a: Readonly): Quat2Like { - Mat4.getRotation(tmpQuat, a); - Mat4.getTranslation(tmpVec3, a); - return Quat2.fromRotationTranslation(out, tmpQuat, tmpVec3); + Mat4.getRotation(Quat2.#TMP_QUAT, a); + Mat4.getTranslation(Quat2.#TMP_VEC3, a); + return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3); } /** @@ -594,7 +597,7 @@ export class Quat2 extends Float32Array { */ static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like { //Special case for rad = 0 - if (Math.abs(rad) < EPSILON) { + if (Math.abs(rad) < GLM_EPSILON) { return Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); @@ -964,23 +967,18 @@ export class Quat2 extends Float32Array { const b6 = b[6]; const b7 = b[7]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && - Math.abs(a3 - b3) <= EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && - Math.abs(a4 - b4) <= EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && - Math.abs(a5 - b5) <= EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && - Math.abs(a6 - b6) <= EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && - Math.abs(a7 - b7) <= EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) ); } } -// Temporary variables to prevent repeated allocations in the algorithms above. -// These are declared as TypedArrays to aid in tree-shaking. -const tmpQuat = new Float32Array(4); -const tmpVec3 = new Float32Array(3); - // Methods which re-use the Quat implementation // @ts-ignore Quat2.dot = Quat.dot; @@ -997,8 +995,3 @@ Quat2.len = Quat.magnitude; // Static method alias assignments Quat2.mul = Quat2.multiply; - -/** - * Quat2 alias for backwards compatibility - */ -export const quat2 = Quat2; \ No newline at end of file diff --git a/src/vec2.ts b/src/_lib/f32/Vec2.ts similarity index 93% rename from src/vec2.ts rename to src/_lib/f32/Vec2.ts index ea372bd9..0050a25d 100644 --- a/src/vec2.ts +++ b/src/_lib/f32/Vec2.ts @@ -1,957 +1,950 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Mat2Like } from './mat2.js'; -import { Mat2dLike } from './mat2d.js'; -import { Mat3Like } from './mat3.js'; -import { Mat4Like } from './mat4.js'; - -/** - * A 2 dimensional vector given as a {@link Vec2}, a 2-element floating point - * TypedArray, or an array of 2 numbers. - */ -export type Vec2Like = [number, number] | FloatArray; - -/** - * 2 Dimensional Vector - */ -export class Vec2 extends Float32Array { - /** - * The number of bytes in a {@link Vec2}. - */ - static readonly BYTE_LENGTH = 2 * Float32Array.BYTES_PER_ELEMENT; - - /** - * Create a {@link Vec2}. - */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { - case 2:{ - const v = values[0]; - if (typeof v === 'number') { - super([v, values[1]]); - } else { - super(v as ArrayBufferLike, values[1], 2); - } - break; - } - case 1: { - const v = values[0]; - if (typeof v === 'number') { - super([v, v]); - } else { - super(v as ArrayBufferLike, 0, 2); - } - break; - } - default: - super(2); break; - } - } - - //============ - // Attributes - //============ - - // Getters and setters to make component access read better. - // These are likely to be a little bit slower than direct array access. - - /** - * The x component of the vector. Equivalent to `this[0];` - * @category Vector components - */ - get x(): number { return this[0]; } - set x(value: number) { this[0] = value; } - - /** - * The y component of the vector. Equivalent to `this[1];` - * @category Vector components - */ - get y(): number { return this[1]; } - set y(value: number) { this[1] = value; } - - // Alternate set of getters and setters in case this is being used to define - // a color. - - /** - * The r component of the vector. Equivalent to `this[0];` - * @category Color components - */ - get r(): number { return this[0]; } - set r(value: number) { this[0] = value; } - - /** - * The g component of the vector. Equivalent to `this[1];` - * @category Color components - */ - get g(): number { return this[1]; } - set g(value: number) { this[1] = value; } - - /** - * The magnitude (length) of this. - * Equivalent to `Vec2.magnitude(this);` - * - * Magnitude is used because the `length` attribute is already defined by - * TypedArrays to mean the number of elements in the array. - */ - get magnitude(): number { - return Math.hypot(this[0], this[1]); - } - /** - * Alias for {@link Vec2.magnitude} - */ - get mag(): number { return this.magnitude; } - - /** - * The squared magnitude (length) of `this`. - * Equivalent to `Vec2.squaredMagnitude(this);` - */ - get squaredMagnitude(): number { - const x = this[0]; - const y = this[1]; - return x * x + y * y; - } - /** - * Alias for {@link Vec2.squaredMagnitude} - */ - get sqrMag(): number { return this.squaredMagnitude; } - - /** - * A string representation of `this` - * Equivalent to `Vec2.str(this);` - */ - get str(): string { - return Vec2.str(this); - } - - //=================== - // Instances methods - //=================== - - /** - * Copy the values from another {@link Vec2} into `this`. - * - * @param a the source vector - * @returns `this` - */ - copy(a: Readonly): Vec2 { - this.set(a); - return this; - } - - // Instead of zero(), use a.fill(0) for instances; - - /** - * Adds a {@link Vec2} to `this`. - * Equivalent to `Vec2.add(this, this, b);` - * - * @param b - The vector to add to `this` - * @returns `this` - */ - add(b: Readonly): Vec2 { - this[0] += b[0]; - this[1] += b[1]; - return this; - } - - /** - * Subtracts a {@link Vec2} from `this`. - * Equivalent to `Vec2.subtract(this, this, b);` - * - * @param b - The vector to subtract from `this` - * @returns `this` - */ - subtract(b: Readonly): Vec2 { - this[0] -= b[0]; - this[1] -= b[1]; - return this; - } - - /** - * Alias for {@link Vec2.subtract} - */ - sub(b: Readonly): Vec2 { return this; } - - /** - * Multiplies `this` by a {@link Vec2}. - * Equivalent to `Vec2.multiply(this, this, b);` - * - * @param b - The vector to multiply `this` by - * @returns `this` - */ - multiply(b: Readonly): Vec2 { - this[0] *= b[0]; - this[1] *= b[1]; - return this; - } - /** - * Alias for {@link Vec2.multiply} - */ - mul(b: Readonly): Vec2 { return this; } - - /** - * Divides `this` by a {@link Vec2}. - * Equivalent to `Vec2.divide(this, this, b);` - * - * @param b - The vector to divide `this` by - * @returns {Vec2} `this` - */ - divide(b: Readonly): Vec2 { - this[0] /= b[0]; - this[1] /= b[1]; - return this; - } - /** - * Alias for {@link Vec2.divide} - */ - div(b: Readonly): Vec2 { return this; } - - /** - * Scales `this` by a scalar number. - * Equivalent to `Vec2.scale(this, this, b);` - * - * @param b - Amount to scale `this` by - * @returns `this` - */ - scale(b: number): Vec2 { - this[0] *= b; - this[1] *= b; - return this; - } - - /** - * Calculates `this` scaled by a scalar value then adds the result to `this`. - * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` - * - * @param b - The vector to add to `this` - * @param scale - The amount to scale `b` by before adding - * @returns `this` - */ - scaleAndAdd(b: Readonly, scale: number): Vec2 { - this[0] += b[0] * scale; - this[1] += b[1] * scale; - return this; - } - - /** - * Calculates the euclidian distance between another {@link Vec2} and `this`. - * Equivalent to `Vec2.distance(this, b);` - * - * @param b - The vector to calculate the distance to - * @returns Distance between `this` and `b` - */ - distance(b: Readonly): number { - return Vec2.distance(this, b); - } - /** - * Alias for {@link Vec2.distance} - */ - dist(b: Readonly): number { return 0; } - - /** - * Calculates the squared euclidian distance between another {@link Vec2} and `this`. - * Equivalent to `Vec2.squaredDistance(this, b);` - * - * @param b The vector to calculate the squared distance to - * @returns Squared distance between `this` and `b` - */ - squaredDistance(b: Readonly): number { - return Vec2.squaredDistance(this, b); - } - /** - * Alias for {@link Vec2.squaredDistance} - */ - sqrDist(b: Readonly): number { return 0; } - - /** - * Negates the components of `this`. - * Equivalent to `Vec2.negate(this, this);` - * - * @returns `this` - */ - negate(): Vec2 { - this[0] *= -1; - this[1] *= -1; - return this; - } - - /** - * Inverts the components of `this`. - * Equivalent to `Vec2.inverse(this, this);` - * - * @returns `this` - */ - invert(): Vec2 { - this[0] = 1.0 / this[0]; - this[1] = 1.0 / this[1]; - return this; - } - - /** - * Sets each component of `this` to it's absolute value. - * Equivalent to `Vec2.abs(this, this);` - * - * @returns `this` - */ - abs(): Vec2 { - this[0] = Math.abs(this[0]); - this[1] = Math.abs(this[1]); - return this; - } - - /** - * Calculates the dot product of this and another {@link Vec2}. - * Equivalent to `Vec2.dot(this, b);` - * - * @param b - The second operand - * @returns Dot product of `this` and `b` - */ - dot(b: Readonly): number { - return this[0] * b[0] + this[1] * b[1]; - } - - /** - * Normalize `this`. - * Equivalent to `Vec2.normalize(this, this);` - * - * @returns `this` - */ - normalize(): Vec2 { - return Vec2.normalize(this, this) as Vec2; - } - - //================ - // Static methods - //================ - - /** - * Creates a new, empty {@link Vec2} - * @category Static - * - * @returns A new 2D vector - */ - static create(): Vec2 { - return new Vec2(); - } - - /** - * Creates a new {@link Vec2} initialized with values from an existing vector - * @category Static - * - * @param a - Vector to clone - * @returns A new 2D vector - */ - static clone(a: Readonly): Vec2 { - return new Vec2(a); - } - - /** - * Creates a new {@link Vec2} initialized with the given values - * @category Static - * - * @param x - X component - * @param y - Y component - * @returns A new 2D vector - */ - static fromValues(x: number, y: number): Vec2 { - return new Vec2(x, y); - } - - /** - * Copy the values from one {@link Vec2} to another - * @category Static - * - * @param out - the receiving vector - * @param a - The source vector - * @returns `out` - */ - static copy(out: Vec2Like, a: Readonly): Vec2Like { - out[0] = a[0]; - out[1] = a[1]; - return out; - } - - /** - * Set the components of a {@link Vec2} to the given values - * @category Static - * - * @param out - The receiving vector - * @param x - X component - * @param y - Y component - * @returns `out` - */ - static set(out: Vec2Like, x: number, y: number): Vec2Like { - out[0] = x; - out[1] = y; - return out; - } - - /** - * Adds two {@link Vec2}s - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; - } - - /** - * Subtracts vector b from vector a - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; - } - - /** - * Alias for {@link Vec2.subtract} - * @category Static - */ - static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } - - /** - * Multiplies two {@link Vec2}s - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - out[0] = a[0] * b[0]; - out[1] = a[1] * b[1]; - return out; - } - - /** - * Alias for {@link Vec2.multiply} - * @category Static - */ - static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } - - /** - * Divides two {@link Vec2}s - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - out[0] = a[0] / b[0]; - out[1] = a[1] / b[1]; - return out; - } - - /** - * Alias for {@link Vec2.divide} - * @category Static - */ - static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } - - /** - * Math.ceil the components of a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to ceil - * @returns `out` - */ - static ceil(out: Vec2Like, a: Readonly): Vec2Like { - out[0] = Math.ceil(a[0]); - out[1] = Math.ceil(a[1]); - return out; - } - - /** - * Math.floor the components of a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to floor - * @returns `out` - */ - static floor(out: Vec2Like, a: Readonly): Vec2Like { - out[0] = Math.floor(a[0]); - out[1] = Math.floor(a[1]); - return out; - } - - /** - * Returns the minimum of two {@link Vec2}s - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - out[0] = Math.min(a[0], b[0]); - out[1] = Math.min(a[1], b[1]); - return out; - } - - /** - * Returns the maximum of two {@link Vec2}s - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - out[0] = Math.max(a[0], b[0]); - out[1] = Math.max(a[1], b[1]); - return out; - } - - /** - * Math.round the components of a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to round - * @returns `out` - */ - static round(out: Vec2Like, a: Readonly): Vec2Like { - out[0] = Math.round(a[0]); - out[1] = Math.round(a[1]); - return out; - } - - /** - * Scales a {@link Vec2} by a scalar number - * @category Static - * - * @param out - The receiving vector - * @param a - The vector to scale - * @param b - Amount to scale the vector by - * @returns `out` - */ - static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; - } - - /** - * Adds two Vec2's after scaling the second operand by a scalar value - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @param scale - The amount to scale b by before adding - * @returns `out` - */ - static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; - } - - /** - * Calculates the euclidian distance between two {@link Vec2}s - * @category Static - * - * @param a - The first operand - * @param b - The second operand - * @returns distance between `a` and `b` - */ - static distance(a: Readonly, b: Readonly): number { - return Math.hypot(b[0] - a[0], b[1] - a[1]); - } - - /** - * Alias for {@link Vec2.distance} - * @category Static - */ - static dist(a: Readonly, b: Readonly): number { return 0; } - - /** - * Calculates the squared euclidian distance between two {@link Vec2}s - * @category Static - * - * @param a - The first operand - * @param b - The second operand - * @returns Squared distance between `a` and `b` - */ - static squaredDistance(a: Readonly, b: Readonly): number { - const x = b[0] - a[0]; - const y = b[1] - a[1]; - return x * x + y * y; - } - - /** - * Alias for {@link Vec2.distance} - * @category Static - */ - static sqrDist(a: Readonly, b: Readonly): number { return 0; } - - /** - * Calculates the magnitude (length) of a {@link Vec2} - * @category Static - * - * @param a - Vector to calculate magnitude of - * @returns Magnitude of a - */ - static magnitude(a: Readonly): number { - let x = a[0]; - let y = a[1]; - return Math.sqrt(x * x + y * y); - } - /** - * Alias for {@link Vec2.magnitude} - * @category Static - */ - static mag(a: Readonly): number { return 0; } - /** - * Alias for {@link Vec2.magnitude} - * @category Static - * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs - * - * @param a - vector to calculate length of - * @returns length of a - */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } - /** - * Alias for {@link Vec2.magnitude} - * @category Static - * @deprecated Use {@link Vec2.mag} - */ - static len(a: Readonly): number { return 0; } - - /** - * Calculates the squared length of a {@link Vec2} - * @category Static - * - * @param a - Vector to calculate squared length of - * @returns Squared length of a - */ - static squaredLength(a: Readonly): number { - const x = a[0]; - const y = a[1]; - return x * x + y * y; - } - /** - * Alias for {@link Vec2.squaredLength} - */ - static sqrLen(a: Readonly, b: Readonly): number { return 0; } - - /** - * Negates the components of a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to negate - * @returns `out` - */ - static negate(out: Vec2Like, a: Readonly) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; - } - - /** - * Returns the inverse of the components of a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to invert - * @returns `out` - */ - static inverse(out: Vec2Like, a: Readonly): Vec2Like { - out[0] = 1.0 / a[0]; - out[1] = 1.0 / a[1]; - return out; - } - - /** - * Returns the absolute value of the components of a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to compute the absolute values of - * @returns `out` - */ - static abs(out: Vec2Like, a: Readonly): Vec2Like { - out[0] = Math.abs(a[0]); - out[1] = Math.abs(a[1]); - return out; - } - - /** - * Normalize a {@link Vec2} - * @category Static - * - * @param out - The receiving vector - * @param a - Vector to normalize - * @returns `out` - */ - static normalize(out: Vec2Like, a: Readonly): Vec2Like { - const x = a[0]; - const y = a[1]; - let len = x * x + y * y; - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - } - out[0] = a[0] * len; - out[1] = a[1] * len; - return out; - } - - /** - * Calculates the dot product of two {@link Vec2}s - * @category Static - * - * @param a - The first operand - * @param b - The second operand - * @returns Dot product of `a` and `b` - */ - static dot(a: Readonly, b: Readonly): number { - return a[0] * b[0] + a[1] * b[1]; - } - - /** - * Computes the cross product of two {@link Vec2}s - * Note that the cross product must by definition produce a 3D vector. - * For this reason there is also not instance equivalent for this function. - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @returns `out` - */ - static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { - const z = a[0] * b[1] - a[1] * b[0]; - out[0] = out[1] = 0; - out[2] = z; - return out; - } - - /** - * Performs a linear interpolation between two {@link Vec2}s - * @category Static - * - * @param out - The receiving vector - * @param a - The first operand - * @param b - The second operand - * @param t - Interpolation amount, in the range [0-1], between the two inputs - * @returns `out` - */ - static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like { - const ax = a[0]; - const ay = a[1]; - out[0] = ax + t * (b[0] - ax); - out[1] = ay + t * (b[1] - ay); - return out; - } - - /** - * Transforms the {@link Vec2} with a {@link Mat2} - * - * @param out - The receiving vector - * @param a - The vector to transform - * @param m - Matrix to transform with - * @returns `out` - */ - static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { - const x = a[0]; - const y = a[1]; - out[0] = m[0] * x + m[2] * y; - out[1] = m[1] * x + m[3] * y; - return out; - } - - /** - * Transforms the {@link Vec2} with a {@link Mat2d} - * - * @param out - The receiving vector - * @param a - The vector to transform - * @param m - Matrix to transform with - * @returns `out` - */ - static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { - const x = a[0]; - const y = a[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; - } - - /** - * Transforms the {@link Vec2} with a {@link Mat3} - * 3rd vector component is implicitly '1' - * - * @param out - The receiving vector - * @param a - The vector to transform - * @param m - Matrix to transform with - * @returns `out` - */ - static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { - const x = a[0]; - const y = a[1]; - out[0] = m[0] * x + m[3] * y + m[6]; - out[1] = m[1] * x + m[4] * y + m[7]; - return out; - } - - /** - * Transforms the {@link Vec2} with a {@link Mat4} - * 3rd vector component is implicitly '0' - * 4th vector component is implicitly '1' - * - * @param out - The receiving vector - * @param a - The vector to transform - * @param m - Matrix to transform with - * @returns `out` - */ - static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { - const x = a[0]; - const y = a[1]; - out[0] = m[0] * x + m[4] * y + m[12]; - out[1] = m[1] * x + m[5] * y + m[13]; - return out; - } - - /** - * Rotate a 2D vector - * @category Static - * - * @param out - The receiving {@link Vec2} - * @param a - The {@link Vec2} point to rotate - * @param b - The origin of the rotation - * @param rad - The angle of rotation in radians - * @returns `out` - */ - static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like { - //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 - out[0] = p0 * cosC - p1 * sinC + b[0]; - out[1] = p0 * sinC + p1 * cosC + b[1]; - - return out; - } - - /** - * Get the angle between two 2D vectors - * @category Static - * - * @param a - The first operand - * @param b - The second operand - * @returns The angle in radians - */ - static angle(a: Readonly, b: Readonly): number { - const x1 = a[0]; - const y1 = a[1]; - const x2 = b[0]; - const y2 = b[1]; - // mag is the product of the magnitudes of a and b - const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); - // mag &&.. short circuits if mag == 0 - const cosine = mag && (x1 * x2 + y1 * y2) / mag; - // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 - return Math.acos(Math.min(Math.max(cosine, -1), 1)); - } - - /** - * Set the components of a {@link Vec2} to zero - * @category Static - * - * @param out - The receiving vector - * @returns `out` - */ - static zero(out: Vec2Like): Vec2Like { - out[0] = 0.0; - out[1] = 0.0; - return out; - } - - /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) - * @category Static - * - * @param a - The first vector. - * @param b - The second vector. - * @returns `true` if the vectors components are ===, `false` otherwise. - */ - static exactEquals(a: Readonly, b: Readonly): boolean { - return a[0] === b[0] && a[1] === b[1]; - } - - /** - * Returns whether or not the vectors have approximately the same elements in the same position. - * @category Static - * - * @param a - The first vector. - * @param b - The second vector. - * @returns `true` if the vectors are approximately equal, `false` otherwise. - */ - static equals(a: Readonly, b: Readonly): boolean { - const a0 = a[0]; - const a1 = a[1]; - const b0 = b[0]; - const b1 = b[1]; - return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) - ); - } - - /** - * Returns a string representation of a vector - * @category Static - * - * @param a - Vector to represent as a string - * @returns String representation of the vector - */ - static str(a: Readonly): string { - return `Vec2(${a.join(', ')})`; - } -} - -// Instance method alias assignments -Vec2.prototype.sub = Vec2.prototype.subtract; -Vec2.prototype.mul = Vec2.prototype.multiply; -Vec2.prototype.div = Vec2.prototype.divide; -Vec2.prototype.dist = Vec2.prototype.distance; -Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; - -// Static method alias assignments -Vec2.sub = Vec2.subtract; -Vec2.mul = Vec2.multiply; -Vec2.div = Vec2.divide; -Vec2.dist = Vec2.distance; -Vec2.sqrDist = Vec2.squaredDistance; -Vec2.sqrLen = Vec2.squaredLength; -Vec2.mag = Vec2.magnitude; -Vec2.length = Vec2.magnitude; -Vec2.len = Vec2.magnitude; - -/** - * Vec2 alias for backwards compatibility - */ -export const vec2 = Vec2; +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types'; + +/** + * 2 Dimensional Vector + */ +export class Vec2 extends Float32Array { + /** + * Create a {@link Vec2}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch(values.length) { + case 2:{ + const v = values[0]; + if (typeof v === 'number') { + super([v, values[1]]); + } else { + super(v as ArrayBufferLike, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === 'number') { + super([v, v]); + } else { + super(v as ArrayBufferLike, 0, 2); + } + break; + } + default: + super(2); break; + } + } + + //============ + // Attributes + //============ + + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector components + */ + get x(): number { return this[0]; } + set x(value: number) { this[0] = value; } + + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector components + */ + get y(): number { return this[1]; } + set y(value: number) { this[1] = value; } + + // Alternate set of getters and setters in case this is being used to define + // a color. + + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color components + */ + get r(): number { return this[0]; } + set r(value: number) { this[0] = value; } + + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color components + */ + get g(): number { return this[1]; } + set g(value: number) { this[1] = value; } + + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + */ + get magnitude(): number { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + */ + get mag(): number { return this.magnitude; } + + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + */ + get squaredMagnitude(): number { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + */ + get sqrMag(): number { return this.squaredMagnitude; } + + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + */ + get str(): string { + return Vec2.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Vec2} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Vec2 { + this.set(a); + return this; + } + + // Instead of zero(), use a.fill(0) for instances; + + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): Vec2 { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): Vec2 { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + + /** + * Alias for {@link Vec2.subtract} + */ + sub(b: Readonly): Vec2 { return this; } + + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): Vec2 { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + */ + mul(b: Readonly): Vec2 { return this; } + + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * + * @param b - The vector to divide `this` by + * @returns {Vec2} `this` + */ + divide(b: Readonly): Vec2 { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + */ + div(b: Readonly): Vec2 { return this; } + + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): Vec2 { + this[0] *= b; + this[1] *= b; + return this; + } + + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): Vec2 { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + + /** + * Calculates the euclidian distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number { + return Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + */ + dist(b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number { + return Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + */ + sqrDist(b: Readonly): number { return 0; } + + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * + * @returns `this` + */ + negate(): Vec2 { + this[0] *= -1; + this[1] *= -1; + return this; + } + + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * + * @returns `this` + */ + invert(): Vec2 { + this[0] = 1.0 / this[0]; + this[1] = 1.0 / this[1]; + return this; + } + + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * + * @returns `this` + */ + abs(): Vec2 { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number { + return this[0] * b[0] + this[1] * b[1]; + } + + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * + * @returns `this` + */ + normalize(): Vec2 { + return Vec2.normalize(this, this) as Vec2; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH(): number { + return 2 * Float32Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create(): Vec2 { + return new Vec2(); + } + + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a: Readonly): Vec2 { + return new Vec2(a); + } + + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x: number, y: number): Vec2 { + return new Vec2(x, y); + } + + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out: Vec2Like, x: number, y: number): Vec2Like { + out[0] = x; + out[1] = y; + return out; + } + + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + + /** + * Calculates the euclidian distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a: Readonly, b: Readonly): number { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a: Readonly, b: Readonly): number { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number { + let x = a[0]; + let y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a: Readonly): number { return 0; } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a: Readonly): number { return 0; } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a: Readonly): number { return 0; } + + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a: Readonly): number { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + */ + static sqrLen(a: Readonly, b: Readonly): number { return 0; } + + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out: Vec2Like, a: Readonly) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; + } + + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out: Vec2Like, a: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a: Readonly, b: Readonly): number { + return a[0] * b[0] + a[1] * b[1]; + } + + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like { + //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 + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + + return out; + } + + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + // mag is the product of the magnitudes of a and b + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + // mag &&.. short circuits if mag == 0 + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out: Vec2Like): Vec2Like { + out[0] = 0.0; + out[1] = 0.0; + return out; + } + + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + return a[0] === b[0] && a[1] === b[1]; + } + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) + ); + } + + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a: Readonly): string { + return `Vec2(${a.join(', ')})`; + } +} + +// Instance method alias assignments +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; + +// Static method alias assignments +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; diff --git a/src/vec3.ts b/src/_lib/f32/Vec3.ts similarity index 97% rename from src/vec3.ts rename to src/_lib/f32/Vec3.ts index 2a0b68f3..d6a54676 100644 --- a/src/vec3.ts +++ b/src/_lib/f32/Vec3.ts @@ -1,26 +1,14 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Mat4Like } from './mat4.js'; -import { Mat3Like } from './mat3.js'; -import { QuatLike } from './quat.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A 3 dimensional vector given as a {@link Vec3}, a 3-element floating point - * TypedArray, or an array of 3 numbers. - */ -export type Vec3Like = [number, number, number] | FloatArray; +import type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types'; /** * 3 Dimensional Vector */ export class Vec3 extends Float32Array { /** - * The number of bytes in a {@link Vec3}. - */ - static readonly BYTE_LENGTH = 3 * Float32Array.BYTES_PER_ELEMENT; - - /** - * Create a {@link Vec3}. - */ + * Create a {@link Vec3}. + */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { case 3: @@ -339,9 +327,20 @@ export class Vec3 extends Float32Array { return Vec3.normalize(this, this) as Vec3; } - //================ + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH(): number { + return 3 * Float32Array.BYTES_PER_ELEMENT; + } + + //=================== // Static methods - //================ + //=================== /** * Creates a new, empty vec3 @@ -1136,9 +1135,9 @@ export class Vec3 extends Float32Array { const b1 = b[1]; const b2 = b[2]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) ); } } @@ -1160,8 +1159,3 @@ Vec3.sqrLen = Vec3.squaredLength; Vec3.mag = Vec3.magnitude; Vec3.length = Vec3.magnitude; Vec3.len = Vec3.magnitude; - -/** - * Vec3 alias for backwards compatibility - */ -export const vec3 = Vec3; \ No newline at end of file diff --git a/src/vec4.ts b/src/_lib/f32/Vec4.ts similarity index 96% rename from src/vec4.ts rename to src/_lib/f32/Vec4.ts index 753c3347..59a2c1d1 100644 --- a/src/vec4.ts +++ b/src/_lib/f32/Vec4.ts @@ -1,22 +1,11 @@ -import { EPSILON, FloatArray } from './common.js'; -import { Mat4Like } from './mat4.js'; -import { QuatLike } from './quat.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; -/** - * A 4 dimensional vector given as a {@link Vec4}, a 4-element floating point - * TypedArray, or an array of 4 numbers. - */ -export type Vec4Like = [number, number, number, number] | FloatArray; +import type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types'; /** * 4 Dimensional Vector */ export class Vec4 extends Float32Array { - /** - * The number of bytes in a {@link Vec4}. - */ - static readonly BYTE_LENGTH = 4 * Float32Array.BYTES_PER_ELEMENT; - /** * Create a {@link Vec4}. */ @@ -348,6 +337,17 @@ export class Vec4 extends Float32Array { return Vec4.normalize(this, this) as Vec4; } + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH(): number { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== // Static methods //=================== @@ -1003,10 +1003,10 @@ export class Vec4 extends Float32Array { const b2 = b[2]; const b3 = b[3]; return ( - Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && - Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && - Math.abs(a2 - b2) <= EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && - Math.abs(a3 - b3) <= EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) ); } } @@ -1028,8 +1028,3 @@ Vec4.sqrLen = Vec4.squaredLength; Vec4.mag = Vec4.magnitude; Vec4.length = Vec4.magnitude; Vec4.len = Vec4.magnitude; - -/** - * Vec4 alias for backwards compatibility - */ -export const vec4 = Vec4; \ No newline at end of file diff --git a/src/_lib/f32/index.ts b/src/_lib/f32/index.ts new file mode 100644 index 00000000..d7e65584 --- /dev/null +++ b/src/_lib/f32/index.ts @@ -0,0 +1,9 @@ +export { Mat2 } from './Mat2.js'; +export { Mat2d } from './Mat2d.js'; +export { Mat3 } from './Mat3.js'; +export { Mat4 } from './Mat4.js'; +export { Quat } from './Quat.js'; +export { Quat2 } from './Quat2.js'; +export { Vec2 } from './Vec2.js'; +export { Vec3 } from './Vec3.js'; +export { Vec4 } from './Vec4.js'; diff --git a/src/_lib/f64/Mat2.ts b/src/_lib/f64/Mat2.ts new file mode 100644 index 00000000..f572031e --- /dev/null +++ b/src/_lib/f64/Mat2.ts @@ -0,0 +1,598 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat2Like, Vec2Like } from '#gl-matrix/types'; + +/** + * A 2x2 Matrix + */ +export class Mat2 extends Float64Array { + static #IDENTITY_2X2 = new Float64Array([ + 1, 0, + 0, 1 + ]); + + /** + * Create a {@link Mat2}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { + switch(values.length) { + case 4: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 4); break; + case 1: + const v = values[0]; + if (typeof v === 'number') { + super([ + v, v, + v, v]); + } else { + super(v as ArrayBufferLike, 0, 4); + } + break; + default: + super(Mat2.#IDENTITY_2X2); break; + } + } + + //============ + // Attributes + //============ + + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + */ + get str(): string { + return Mat2.str(this); + } + + //=================== + // Instance methods + //=================== + + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Mat2 { + this.set(a); + return this; + } + + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + */ + identity(): Mat2 { + this.set(Mat2.#IDENTITY_2X2); + return this; + } + + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): Mat2 { + return Mat2.multiply(this, this, b) as Mat2; + } + + /** + * Alias for {@link Mat2.multiply} + */ + mul(b: Readonly): Mat2 { return this; } + + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + */ + transpose(): Mat2 { + return Mat2.transpose(this, this) as Mat2; + } + + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + */ + invert(): Mat2 { + return Mat2.invert(this, this) as Mat2; + } + + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): Mat2 { + return Mat2.scale(this, this, v) as Mat2; + } + + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + rotate(rad: number): Mat2 { + return Mat2.rotate(this, this, rad) as Mat2; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH(): number { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create(): Mat2 { + return new Mat2(); + } + + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a: Readonly): Mat2 { + return new Mat2(a); + } + + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2Like, a: Readonly): Mat2Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values: number[]): Mat2 { + return new Mat2(...values); + } + + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2Like, ...values: number[]): Mat2Like { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2Like): Mat2Like { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat2Like, a: Readonly): Mat2Like { + // If we are transposing ourselves we can skip a few steps but have to cache + // some values + if (out === a) { + let a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + + return out; + } + + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + + // Calculate the determinant + let det = a0 * a3 - a2 * a1; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + + return out; + } + + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like { + // Caching this value is necessary if out == a + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number { + return a[0] * a[3] - a[2] * a[1]; + } + + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; } + + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; } + + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2Like, rad: number): Mat2Like { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2Like, v: Readonly): Mat2Like { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + + static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + + /** + * Returns whether or not two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + return ( + a[0] === b[0] && + a[1] === b[1] && + a[2] === b[2] && + a[3] === b[3] + ); + } + + /** + * Returns whether or not two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) + ); + } + + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string { + return `Mat2(${a.join(', ')})`; + } +} + +// Instance method alias assignments +Mat2.prototype.mul = Mat2.prototype.multiply; + +// Static method alias assignments +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; diff --git a/src/_lib/f64/Mat2d.ts b/src/_lib/f64/Mat2d.ts new file mode 100644 index 00000000..890838c8 --- /dev/null +++ b/src/_lib/f64/Mat2d.ts @@ -0,0 +1,619 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat2dLike, Vec2Like } from '#gl-matrix/types'; + +/** + * A 2x3 Matrix + */ +export class Mat2d extends Float64Array { + static #IDENTITY_2X3 = new Float64Array([ + 1, 0, + 0, 1, + 0, 0, + ]); + + /** + * Create a {@link Mat2}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { + switch(values.length) { + case 6: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 6); break; + case 1: + const v = values[0]; + if (typeof v === 'number') { + super([ + v, v, + v, v, + v, v]); + } else { + super(v as ArrayBufferLike, 0, 6); + } + break; + default: + super(Mat2d.#IDENTITY_2X3); break; + } + } + + //============ + // Attributes + //============ + + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + */ + get str(): string { + return Mat2d.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Mat2d} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Mat2d { + this.set(a); + return this; + } + + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * + * @returns `this` + */ + identity(): Mat2d { + this.set(Mat2d.#IDENTITY_2X3); + return this; + } + + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): Mat2d { + return Mat2d.multiply(this, this, b) as Mat2d; + } + + /** + * Alias for {@link Mat2d.multiply} + */ + mul(b: Readonly): Mat2d { return this; } + + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): Mat2d { + return Mat2d.translate(this, this, v) as Mat2d; + } + + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + rotate(rad: number): Mat2d { + return Mat2d.rotate(this, this, rad) as Mat2d; + } + + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): Mat2d { + return Mat2d.scale(this, this, v) as Mat2d; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH(): number { + return 6 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create(): Mat2d { + return new Mat2d(); + } + + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a: Readonly): Mat2d { + return new Mat2d(a); + } + + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2dLike, a: Readonly): Mat2dLike { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values: number[]): Mat2d { + return new Mat2d(...values); + } + + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2dLike, ...values: number[]): Mat2dLike { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2dLike): Mat2dLike { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number { + return a[0] * a[3] - a[1] * a[2]; + } + + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; } + + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; } + + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + + // TODO: Got to fromRotation + + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2dLike, rad: number): Mat2dLike { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + 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] + ); + } + + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) + ); + } + + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string { + return `Mat2d(${a.join(', ')})`; + } +} + +// Static method alias assignments +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; diff --git a/src/_lib/f64/Mat3.ts b/src/_lib/f64/Mat3.ts new file mode 100644 index 00000000..e62dd4ac --- /dev/null +++ b/src/_lib/f64/Mat3.ts @@ -0,0 +1,1030 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types'; + +/** + * A 3x3 Matrix + */ +export class Mat3 extends Float64Array { + static #IDENTITY_3X3 = new Float64Array([ + 1, 0, 0, + 0, 1, 0, + 0, 0, 1, + ]); + + /** + * Create a {@link Mat3}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { + switch(values.length) { + case 9: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 9); break; + case 1: + const v = values[0]; + if (typeof v === 'number') { + super([ + v, v, v, + v, v, v, + v, v, v]); + } else { + super(v as ArrayBufferLike, 0, 9); + } + break; + default: + super(Mat3.#IDENTITY_3X3); break; + } + } + + //============ + // Attributes + //============ + + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + */ + get str(): string { + return Mat3.str(this); + } + + //=================== + // Instance methods + //=================== + + /** + * Copy the values from another {@link Mat3} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Mat3 { + this.set(a); + return this; + } + + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * + * @returns `this` + */ + identity(): Mat3 { + this.set(Mat3.#IDENTITY_3X3); + return this; + } + + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): Mat3 { + return Mat3.multiply(this, this, b) as Mat3; + } + + /** + * Alias for {@link Mat3.multiply} + */ + mul(b: Readonly): Mat3 { return this; } + + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * + * @returns `this` + */ + transpose(): Mat3 { + return Mat3.transpose(this, this) as Mat3; + } + + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + */ + invert(): Mat3 { + return Mat3.invert(this, this) as Mat3; + } + + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): Mat3 { + return Mat3.translate(this, this, v) as Mat3; + } + + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + rotate(rad: number): Mat3 { + return Mat3.rotate(this, this, rad) as Mat3; + } + + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): Mat3 { + return Mat3.scale(this, this, v) as Mat3; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH(): number { + return 9 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create(): Mat3 { + return new Mat3(); + } + + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a: Readonly): Mat3 { + return new Mat3(a); + } + + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat3Like, a: Readonly): Mat3Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values: number[]): Mat3 { + return new Mat3(...values); + } + + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat3Like, ...values: number[]): Mat3Like { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat3Like): Mat3Like { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat3Like, a: Readonly): Mat3Like { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + const a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + + return out; + } + + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null { + const a00 = a[0], + a01 = a[1], + a02 = a[2]; + const a10 = a[3], + a11 = a[4], + a12 = a[5]; + const a20 = a[6], + a21 = a[7], + a22 = a[8]; + + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + let det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + + return ( + a00 * (a22 * a11 - a12 * a21) + + a01 * (-a22 * a10 + a12 * a20) + + a02 * (a21 * a10 - a11 * a20) + ); + } + + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; } + + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; } + + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + + out[0] = a00; + out[1] = a01; + out[2] = a02; + + out[3] = a10; + out[4] = a11; + out[5] = a12; + + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like { + const x = v[0]; + const y = v[1]; + + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat3Like, rad: number): Mat3Like { + const s = Math.sin(rad); + const c = Math.cos(rad); + + out[0] = c; + out[1] = s; + out[2] = 0; + + out[3] = -s; + out[4] = c; + out[5] = 0; + + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat3Like, v: Readonly): Mat3Like { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + + /** + * Calculates a {@link Mat3} from the given quaternion + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat3Like, q: Readonly): Mat3Like { + 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; + + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + + return out; + } + + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out: Mat3Like, a: Readonly): Mat3Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + let det = + b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return out; + } + + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + + return out; + } + + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out: Mat3Like, width: number, height: number): Mat3Like { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number { + return Math.sqrt( + a[0] * a[0] + + a[1] * a[1] + + a[2] * a[2] + + a[3] * a[3] + + a[4] * a[4] + + a[5] * a[5] + + a[6] * a[6] + + a[7] * a[7] + + a[8] * a[8] + ); + } + + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + 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] + ); + } + + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && + Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) + ); + } + + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string { + return `Mat3(${a.join(', ')})`; + } +} + +// Instance method alias assignments +Mat3.prototype.mul = Mat3.prototype.multiply; + +// Static method alias assignments +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; diff --git a/src/_lib/f64/Mat4.ts b/src/_lib/f64/Mat4.ts new file mode 100644 index 00000000..780313fe --- /dev/null +++ b/src/_lib/f64/Mat4.ts @@ -0,0 +1,2511 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; + +/** + * A 4x4 Matrix + */ +export class Mat4 extends Float64Array { + static #IDENTITY_4X4 = new Float64Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, + ]); + + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + static #TMP_VEC3 = new Float64Array(3); + + /** + * Create a {@link Mat4}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { + switch(values.length) { + case 16: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 16); break; + case 1: + const v = values[0]; + if (typeof v === 'number') { + super([ + v, v, v, v, + v, v, v, v, + v, v, v, v, + v, v, v, v]); + } else { + super(v as ArrayBufferLike, 0, 16); + } + break; + default: + super(Mat4.#IDENTITY_4X4); break; + } + } + + //============ + // Attributes + //============ + + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + */ + get str(): string { + return Mat4.str(this); + } + + //=================== + // Instance methods + //=================== + + /** + * Copy the values from another {@link Mat4} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Mat4 { + this.set(a); + return this; + } + + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * + * @returns `this` + */ + identity(): Mat4 { + this.set(Mat4.#IDENTITY_4X4); + return this; + } + + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): Mat4 { + return Mat4.multiply(this, this, b) as Mat4; + } + + /** + * Alias for {@link Mat4.multiply} + */ + mul(b: Readonly): Mat4 { return this; } + + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * + * @returns `this` + */ + transpose(): Mat4 { + return Mat4.transpose(this, this) as Mat4; + } + + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + */ + invert(): Mat4 { + return Mat4.invert(this, this) as Mat4; + } + + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v: Readonly): Mat4 { + return Mat4.translate(this, this, v) as Mat4; + } + + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` + */ + rotate(rad: number, axis: Readonly): Mat4 { + return Mat4.rotate(this, this, rad, axis) as Mat4; + } + + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): Mat4 { + return Mat4.scale(this, this, v) as Mat4; + } + + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad: number): Mat4 { + return Mat4.rotateX(this, this, rad) as Mat4; + } + + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad: number): Mat4 { + return Mat4.rotateY(this, this, rad) as Mat4; + } + + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad: number): Mat4 { + return Mat4.rotateZ(this, this, rad) as Mat4; + } + + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy: number, aspect: number, near: number, far: number): Mat4 { + return Mat4.perspectiveNO(this, fovy, aspect, near, far) as Mat4; + } + + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy: number, aspect: number, near: number, far: number): Mat4 { + return Mat4.perspectiveZO(this, fovy, aspect, near, far) as Mat4; + } + + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4 { + return Mat4.orthoNO(this, left, right, bottom, top, near, far) as Mat4; + } + + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4 { + return Mat4.orthoZO(this, left, right, bottom, top, near, far) as Mat4; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH(): number { + return 16 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create(): Mat4 { + return new Mat4(); + } + + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a: Readonly): Mat4 { + return new Mat4(a); + } + + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat4Like, a: Readonly): Mat4Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values: number[]): Mat4 { + return new Mat4(...values); + } + + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat4Like, ...values: number[]): Mat4Like { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out: Mat4Like): Mat4Like { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat4Like, a: Readonly): Mat4Like { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + const a01 = a[1], + a02 = a[2], + a03 = a[3]; + const a12 = a[6], + a13 = a[7]; + const a23 = a[11]; + + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + + return out; + } + + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null { + const a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + const a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + const a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + const a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + let det = + b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return out; + } + + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like { + const a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + const a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + const a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + const a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number { + const a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + const a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + const a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + const a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + + // Calculate the determinant + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + + // Cache only the current line of the second matrix + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; } + + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like { + const x = v[0]; + const y = v[1]; + const z = v[2]; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; + } + + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like { + const x = v[0]; + const y = v[1]; + const z = v[2]; + + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + + if (len < GLM_EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + + // Construct the elements of the rotation matrix + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + + if (a !== out) { + // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat4Like, v: Readonly): Mat4Like { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + + if (len < GLM_EPSILON) { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + + // Perform rotation-specific matrix multiplication + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out: Mat4Like, rad: number): Mat4Like { + let s = Math.sin(rad); + let c = Math.cos(rad); + + // Perform axis-specific matrix multiplication + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out: Mat4Like, rad: number): Mat4Like { + let s = Math.sin(rad); + let c = Math.cos(rad); + + // Perform axis-specific matrix multiplication + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out: Mat4Like, rad: number): Mat4Like { + const s = Math.sin(rad); + const c = Math.cos(rad); + + // Perform axis-specific matrix multiplication + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like { + // Quaternion math + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + + return out; + } + + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + + let magnitude = bx * bx + by * by + bz * bz + bw * bw; + //Only scale if it makes sense + if (magnitude > 0) { + Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude; + Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude; + Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude; + } else { + Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3); + return out; + } + + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + let det = + b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + + // No translation + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return out; + } + + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + + // No translation + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return out; + } + + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + + return out; + } + + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out: Vec3Like, mat: Readonly): Vec3Like { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + + return out; + } + + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out: QuatLike, mat: Readonly): QuatLike { + Mat4.getScaling(Mat4.#TMP_VEC3, mat); + + const is1 = 1 / Mat4.#TMP_VEC3[0]; + const is2 = 1 / Mat4.#TMP_VEC3[1]; + const is3 = 1 / Mat4.#TMP_VEC3[2]; + + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + + const trace = sm11 + sm22 + sm33; + let S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + + return out; + } + + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + + const trace = sm11 + sm22 + sm33; + let S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + + return out_r; + } + + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like { + // Quaternion math + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + + return out; + } + + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like { + // Quaternion math + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + + return out; + } + + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat4Like, q: Readonly): Mat4Like { + 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; + + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return out; + } + + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; } + + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { + const f = 1.0 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; } + + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { + const f = 1.0 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like { + const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0); + const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0); + const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0); + const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0); + const xScale = 2.0 / (leftTan + rightTan); + const yScale = 2.0 / (upTan + downTan); + + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = (far * near) / (near - far); + out[15] = 0.0; + return out; + } + + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; } + + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + + if ( + Math.abs(eyex - centerx) < GLM_EPSILON && + Math.abs(eyey - centery) < GLM_EPSILON && + Math.abs(eyez - centerz) < GLM_EPSILON + ) { + return Mat4.identity(out); + } + + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return out; + } + + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number { + return Math.sqrt( + a[0] * a[0] + + a[1] * a[1] + + a[2] * a[2] + + a[3] * a[3] + + a[4] * a[4] + + a[5] * a[5] + + a[6] * a[6] + + a[7] * a[7] + + a[8] * a[8] + + a[9] * a[9] + + a[10] * a[10] + + a[11] * a[11] + + a[12] * a[12] + + a[13] * a[13] + + a[14] * a[14] + + a[15] * a[15] + ); + } + + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; } + + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + 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] + ); + } + + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && + Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && + Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && + Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && + Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && + Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && + Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && + Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && + Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)) + ); + } + + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string { + return `Mat4(${a.join(', ')})`; + } +} + +// Instance method alias assignments +Mat4.prototype.mul = Mat4.prototype.multiply; + +// Static method alias assignments +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; diff --git a/src/_lib/f64/Quat.ts b/src/_lib/f64/Quat.ts new file mode 100644 index 00000000..729f3cb0 --- /dev/null +++ b/src/_lib/f64/Quat.ts @@ -0,0 +1,1068 @@ +import { Vec3 } from './Vec3.js'; +import { Vec4 } from './Vec4.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types'; + +/** + * Quaternion + */ +export class Quat extends Float64Array { + static #DEFAULT_ANGLE_ORDER = 'zyx'; + + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + + static #TMP_QUAT1 = new Float64Array(4); + static #TMP_QUAT2 = new Float64Array(4); + static #TMP_MAT3 = new Float64Array(9); + + static #TMP_VEC3 = new Float64Array(3); + static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]); + static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]); + + /** + * Create a {@link Quat}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch(values.length) { + case 4: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 4); break; + case 1: { + const v = values[0]; + if (typeof v === 'number') { + super([v, v, v, v]); + } else { + super(v as ArrayBufferLike, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + + //============ + // Attributes + //============ + + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion components + */ + get x(): number { return this[0]; } + set x(value: number) { this[0] = value; } + + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion components + */ + get y(): number { return this[1]; } + set y(value: number) { this[1] = value; } + + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion components + */ + get z(): number { return this[2]; } + set z(value: number) { this[2] = value; } + + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion components + */ + get w(): number { return this[3]; } + set w(value: number) { this[3] = value; } + + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + */ + get magnitude(): number { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + + /** + * Alias for {@link Quat.magnitude} + */ + get mag(): number { return this.magnitude; } + + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + */ + get str(): string { + return Quat.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Quat} into `this`. + * + * @param a the source quaternion + * @returns `this` + */ + copy(a: Readonly): Quat { + super.set(a); + return this; + } + + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * + * @returns `this` + */ + identity(): Quat { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): Quat { + return Quat.multiply(this, this, b) as Quat; + } + + /** + * Alias for {@link Quat.multiply} + */ + mul(b: Readonly): Quat { return this; } + + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad: number): Quat { + return Quat.rotateX(this, this, rad) as Quat; + } + + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad: number): Quat { + return Quat.rotateY(this, this, rad) as Quat; + } + + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad: number): Quat { + return Quat.rotateZ(this, this, rad) as Quat; + } + + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * + * @returns `this` + */ + invert(): Quat { + return Quat.invert(this, this) as Quat; + } + + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale: number): QuatLike { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b: Readonly): number { + return Quat.dot(this, b); + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH(): number { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create(): Quat { + return new Quat(); + } + + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike { + rad = rad * 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis: Vec3Like, q: Readonly): number { + const rad = Math.acos(q[3]) * 2.0; + const s = Math.sin(rad / 2.0); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + // If s is zero, return any axis (no rotation - axis does not matter) + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a: Readonly, b: Readonly): number { + const dotproduct = Quat.dot(a, b); + + return Math.acos(2 * dotproduct * dotproduct - 1); + } + + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike { + 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]; + + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike { + rad *= 0.5; + + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike { + rad *= 0.5; + + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike { + rad *= 0.5; + + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out: QuatLike, a: Readonly): QuatLike { + const x = a[0], + y = a[1], + z = a[2]; + + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); + return out; + } + + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out: QuatLike, a: Readonly): QuatLike { + const x = a[0], + y = a[1], + z = a[2], + w = a[3]; + + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? (et * Math.sin(r)) / r : 0; + + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + + return out; + } + + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out: QuatLike, a: Readonly): QuatLike { + const x = a[0], + y = a[1], + z = a[2], + w = a[3]; + + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + + return out; + } + + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out: QuatLike, a: Readonly, b: number): QuatLike { + Quat.ln(out, a); + Quat.scale(out, out, b); + Quat.exp(out, out); + return out; + } + + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + const ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + let bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + + let scale0: number; + let scale1: number; + + // calc cosine + let cosom = ax * bx + ay * by + az * bz + aw * bw; + // adjust signs (if necessary) + if (cosom < 0.0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + // calculate coefficients + if (1.0 - cosom > GLM_EPSILON) { + // standard case (slerp) + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } + // calculate final values + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + + return out; + } + + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out: QuatLike, a: Readonly): QuatLike { + const a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1.0 / dot : 0; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out: QuatLike, a: Readonly): QuatLike { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out: QuatLike, m: Readonly): QuatLike { + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + const fTrace = m[0] + m[4] + m[8]; + let fRoot: number; + + if (fTrace > 0.0) { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; // 1/(4w) + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + // |w| <= 1/2 + let i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + let j = (i + 1) % 3; + let k = (i + 2) % 3; + + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + + return out; + } + + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike { + let halfToRad = (0.5 * Math.PI) / 180.0; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + + let sx = Math.sin(x); + let cx = Math.cos(x); + let sy = Math.sin(y); + let cy = Math.cos(y); + let sz = Math.sin(z); + let cz = Math.cos(z); + + switch (order) { + case 'xyz': + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + + case 'xzy': + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + + case 'yxz': + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + + case 'yzx': + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + + case 'zxy': + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + + case 'zyx': + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + + default: + throw new Error('Unknown angle order ' + order); + } + + return out; + } + + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string { + return `Quat(${a.join(', ')})`; + } + + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a: Readonly): Quat { + return new Quat(a); + } + + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x: number, y: number, z: number, w: number): Quat { + return new Quat(x, y, z, w); + } + + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out: QuatLike, a: Readonly): QuatLike { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; } + + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; } + + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; } + + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out: QuatLike, a: Readonly, scale: number): QuatLike { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out } + + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a: Readonly): number { return 0; } + + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number { return 0; } + + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out: QuatLike, a: Readonly): QuatLike { return out; } + + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { return false; } + + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { return false; } + + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike { + let dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a); + if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); + Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3); + Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(Quat.#TMP_VEC3, a, b); + out[0] = Quat.#TMP_VEC3[0]; + out[1] = Quat.#TMP_VEC3[1]; + out[2] = Quat.#TMP_VEC3[2]; + out[3] = 1 + dot; + return Quat.normalize(out, out); + } + } + + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike { + Quat.slerp(Quat.#TMP_QUAT1, a, d, t); + Quat.slerp(Quat.#TMP_QUAT2, b, c, t); + Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t)); + + return out; + } + + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike { + Quat.#TMP_MAT3[0] = right[0]; + Quat.#TMP_MAT3[3] = right[1]; + Quat.#TMP_MAT3[6] = right[2]; + + Quat.#TMP_MAT3[1] = up[0]; + Quat.#TMP_MAT3[4] = up[1]; + Quat.#TMP_MAT3[7] = up[2]; + + Quat.#TMP_MAT3[2] = -view[0]; + Quat.#TMP_MAT3[5] = -view[1]; + Quat.#TMP_MAT3[8] = -view[2]; + + return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3)); + } +} + +// Methods which re-use the Vec4 implementation +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; + +// Instance method alias assignments +Quat.prototype.mul = Quat.prototype.multiply; + +// Static method alias assignments +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; diff --git a/src/_lib/f64/Quat2.ts b/src/_lib/f64/Quat2.ts new file mode 100644 index 00000000..eab86a7c --- /dev/null +++ b/src/_lib/f64/Quat2.ts @@ -0,0 +1,997 @@ +import { Mat4 } from './Mat4.js'; +import { Quat } from './Quat.js'; +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; + +/** + * Dual Quaternion + */ +export class Quat2 extends Float64Array { + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + + static #TMP_QUAT = new Float64Array(4); + static #TMP_VEC3 = new Float64Array(3); + + /** + * Create a {@link Quat2}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch(values.length) { + case 8: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 8); break; + case 1: { + const v = values[0]; + if (typeof v === 'number') { + super([v, v, v, v, v, v, v, v]); + } else { + super(v as ArrayBufferLike, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + + //============ + // Attributes + //============ + + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + */ + get str(): string { + return Quat2.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Quat2} into `this`. + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a: Readonly): Quat2 { + super.set(a); + return this; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH(): number { + return 8 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create(): Quat2 { + return new Quat2(); + } + + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a: Quat2Like): Quat2 { + return new Quat2(a); + } + + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1: number, y1: number, z1: number, w1: number, + x2: number, y2: number, z2: number, w2: number): Quat2 { + return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number, + x2: number, y2: number, z2: number): Quat2 { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + + return new Quat2(x1, y1, z1, w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1); + } + + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out: Quat2Like, q: Readonly): Quat2Like { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out: Quat2Like, a: Readonly): Quat2Like { + Mat4.getRotation(Quat2.#TMP_QUAT, a); + Mat4.getTranslation(Quat2.#TMP_VEC3, a); + return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3); + } + + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out: Quat2Like, a: Readonly): Quat2Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number, + x2: number, y2: number, z2: number, w2: number): Quat2Like { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out: QuatLike, a: Readonly): QuatLike { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + }; + + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out: QuatLike, a: Readonly): QuatLike { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out: Quat2Like, a: Readonly): Quat2Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + }; + + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out: Quat2Like, a: Readonly): Quat2Like { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out: Vec3Like, a: Readonly): Vec3Like { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out as QuatLike, a as QuatLike, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out as QuatLike, a as QuatLike, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out as QuatLike, a as QuatLike, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like { + //Special case for rad = 0 + if (Math.abs(rad) < GLM_EPSILON) { + return Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + + rad = rad * 0.5; + const s = Math.sin(rad); + const bx = (s * axis[0]) / axisLength; + const by = (s * axis[1]) / axisLength; + const bz = (s * axis[2]) / axisLength; + const bw = Math.cos(rad); + + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + + return out; + } + + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = + ax0 * bw1 + + aw0 * bx1 + + ay0 * bz1 - + az0 * by1 + + ax1 * bw0 + + aw1 * bx0 + + ay1 * bz0 - + az1 * by0; + out[5] = + ay0 * bw1 + + aw0 * by1 + + az0 * bx1 - + ax0 * bz1 + + ay1 * bw0 + + aw1 * by0 + + az1 * bx0 - + ax1 * bz0; + out[6] = + az0 * bw1 + + aw0 * bz1 + + ax0 * by1 - + ay0 * bx1 + + az1 * bw0 + + aw1 * bz0 + + ax1 * by0 - + ay1 * bx0; + out[7] = + aw0 * bw1 - + ax0 * bx1 - + ay0 * by1 - + az0 * bz1 + + aw1 * bw0 - + ax1 * bx0 - + ay1 * by0 - + az1 * bz0; + return out; + } + + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; } + + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number { return 0; } + + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like { + const mt = 1 - t; + if (Quat2.dot(a, b) < 0) t = -t; + + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + + return out; + } + + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out: Quat2Like, a: Readonly): Quat2Like { + const sqlen = Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out: Quat2Like, a: Readonly): Quat2Like { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a: Readonly): number { return 0; } + + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number { return 0; } + + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number { return 0; } + + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out: Quat2Like, a: Readonly): Quat2Like { + let magnitude = Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string { + return `Quat2(${a.join(', ')})`; + } + + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + 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] + ); + } + + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) + ); + } +} + +// Methods which re-use the Quat implementation +// @ts-ignore +Quat2.dot = Quat.dot; +// @ts-ignore +Quat2.squaredLength = Quat.squaredLength; +// @ts-ignore +Quat2.sqrLen = Quat.squaredLength; +// @ts-ignore +Quat2.mag = Quat.magnitude; +// @ts-ignore +Quat2.length = Quat.magnitude; +// @ts-ignore +Quat2.len = Quat.magnitude; + +// Static method alias assignments +Quat2.mul = Quat2.multiply; diff --git a/src/_lib/f64/Vec2.ts b/src/_lib/f64/Vec2.ts new file mode 100644 index 00000000..022451f1 --- /dev/null +++ b/src/_lib/f64/Vec2.ts @@ -0,0 +1,950 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types'; + +/** + * 2 Dimensional Vector + */ +export class Vec2 extends Float64Array { + /** + * Create a {@link Vec2}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch(values.length) { + case 2:{ + const v = values[0]; + if (typeof v === 'number') { + super([v, values[1]]); + } else { + super(v as ArrayBufferLike, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === 'number') { + super([v, v]); + } else { + super(v as ArrayBufferLike, 0, 2); + } + break; + } + default: + super(2); break; + } + } + + //============ + // Attributes + //============ + + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector components + */ + get x(): number { return this[0]; } + set x(value: number) { this[0] = value; } + + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector components + */ + get y(): number { return this[1]; } + set y(value: number) { this[1] = value; } + + // Alternate set of getters and setters in case this is being used to define + // a color. + + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color components + */ + get r(): number { return this[0]; } + set r(value: number) { this[0] = value; } + + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color components + */ + get g(): number { return this[1]; } + set g(value: number) { this[1] = value; } + + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + */ + get magnitude(): number { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + */ + get mag(): number { return this.magnitude; } + + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + */ + get squaredMagnitude(): number { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + */ + get sqrMag(): number { return this.squaredMagnitude; } + + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + */ + get str(): string { + return Vec2.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Vec2} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Vec2 { + this.set(a); + return this; + } + + // Instead of zero(), use a.fill(0) for instances; + + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): Vec2 { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): Vec2 { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + + /** + * Alias for {@link Vec2.subtract} + */ + sub(b: Readonly): Vec2 { return this; } + + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): Vec2 { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + */ + mul(b: Readonly): Vec2 { return this; } + + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * + * @param b - The vector to divide `this` by + * @returns {Vec2} `this` + */ + divide(b: Readonly): Vec2 { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + */ + div(b: Readonly): Vec2 { return this; } + + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): Vec2 { + this[0] *= b; + this[1] *= b; + return this; + } + + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): Vec2 { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + + /** + * Calculates the euclidian distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number { + return Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + */ + dist(b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number { + return Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + */ + sqrDist(b: Readonly): number { return 0; } + + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * + * @returns `this` + */ + negate(): Vec2 { + this[0] *= -1; + this[1] *= -1; + return this; + } + + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * + * @returns `this` + */ + invert(): Vec2 { + this[0] = 1.0 / this[0]; + this[1] = 1.0 / this[1]; + return this; + } + + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * + * @returns `this` + */ + abs(): Vec2 { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number { + return this[0] * b[0] + this[1] * b[1]; + } + + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * + * @returns `this` + */ + normalize(): Vec2 { + return Vec2.normalize(this, this) as Vec2; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH(): number { + return 2 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create(): Vec2 { + return new Vec2(); + } + + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a: Readonly): Vec2 { + return new Vec2(a); + } + + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x: number, y: number): Vec2 { + return new Vec2(x, y); + } + + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out: Vec2Like, x: number, y: number): Vec2Like { + out[0] = x; + out[1] = y; + return out; + } + + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + + /** + * Calculates the euclidian distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a: Readonly, b: Readonly): number { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a: Readonly, b: Readonly): number { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number { + let x = a[0]; + let y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a: Readonly): number { return 0; } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a: Readonly): number { return 0; } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a: Readonly): number { return 0; } + + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a: Readonly): number { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + */ + static sqrLen(a: Readonly, b: Readonly): number { return 0; } + + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out: Vec2Like, a: Readonly) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; + } + + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec2Like, a: Readonly): Vec2Like { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out: Vec2Like, a: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a: Readonly, b: Readonly): number { + return a[0] * b[0] + a[1] * b[1]; + } + + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like { + //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 + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + + return out; + } + + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + // mag is the product of the magnitudes of a and b + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + // mag &&.. short circuits if mag == 0 + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out: Vec2Like): Vec2Like { + out[0] = 0.0; + out[1] = 0.0; + return out; + } + + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + return a[0] === b[0] && a[1] === b[1]; + } + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) + ); + } + + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a: Readonly): string { + return `Vec2(${a.join(', ')})`; + } +} + +// Instance method alias assignments +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; + +// Static method alias assignments +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; diff --git a/src/_lib/f64/Vec3.ts b/src/_lib/f64/Vec3.ts new file mode 100644 index 00000000..f93023fa --- /dev/null +++ b/src/_lib/f64/Vec3.ts @@ -0,0 +1,1161 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types'; + + /** + * 3 Dimensional Vector + */ +export class Vec3 extends Float64Array { + /** + * Create a {@link Vec3}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch(values.length) { + case 3: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 3); break; + case 1: { + const v = values[0]; + if (typeof v === 'number') { + super([v, v, v]); + } else { + super(v as ArrayBufferLike, 0, 3); + } + break; + } + default: + super(3); break; + } + } + + //============ + // Attributes + //============ + + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector components + */ + get x(): number { return this[0]; } + set x(value: number) { this[0] = value; } + + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector components + */ + get y(): number { return this[1]; } + set y(value: number) { this[1] = value; } + + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector components + */ + get z(): number { return this[2]; } + set z(value: number) { this[2] = value; } + + // Alternate set of getters and setters in case this is being used to define + // a color. + + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color components + */ + get r(): number { return this[0]; } + set r(value: number) { this[0] = value; } + + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color components + */ + get g(): number { return this[1]; } + set g(value: number) { this[1] = value; } + + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color components + */ + get b(): number { return this[2]; } + set b(value: number) { this[2] = value; } + + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + */ + get magnitude(): number { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + */ + get mag(): number { return this.magnitude; } + + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + */ + get squaredMagnitude(): number { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + */ + get sqrMag(): number { return this.squaredMagnitude; } + + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + */ + get str(): string { + return Vec3.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Vec3} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Vec3 { + this.set(a); + return this; + } + + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): Vec3 { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): Vec3 { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + + /** + * Alias for {@link Vec3.subtract} + */ + sub(b: Readonly): Vec3 { return this; } + + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): Vec3 { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + + /** + * Alias for {@link Vec3.multiply} + */ + mul(b: Readonly): Vec3 { return this; } + + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): Vec3 { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + + /** + * Alias for {@link Vec3.divide} + */ + div(b: Readonly): Vec3 { return this; } + + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): Vec3 { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): Vec3 { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + + /** + * Calculates the euclidian distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number { + return Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + */ + dist(b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number { + return Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + */ + sqrDist(b: Readonly): number { return 0; } + + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * + * @returns `this` + */ + negate(): Vec3 { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * + * @returns `this` + */ + invert(): Vec3 { + this[0] = 1.0 / this[0]; + this[1] = 1.0 / this[1]; + this[2] = 1.0 / this[2]; + return this; + } + + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec3.abs(this, this);` + * + * @returns `this` + */ + abs(): Vec3 { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * + * @returns `this` + */ + normalize(): Vec3 { + return Vec3.normalize(this, this) as Vec3; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH(): number { + return 3 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create(): Vec3 { + return new Vec3(); + } + + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a: Readonly): Vec3 { + return new Vec3(a); + } + + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number { + let x = a[0]; + let y = a[1]; + let z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a: Readonly): number { return 0; } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a: Readonly): number { return 0; } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a: Readonly): number { return 0; } + + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x: number, y: number, z: number): Vec3 { + return new Vec3(x, y, z); + } + + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; + + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; } + + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; + + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + + /** + * Calculates the euclidian distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + */ + static dist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + */ + static sqrDist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + */ + static sqrLen(a: Readonly, b: Readonly): number { return 0; } + + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + return out; + } + + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec3Like, a: Readonly): Vec3Like { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { + const ax = a[0], + ay = a[1], + az = a[2]; + const bx = b[0], + by = b[1], + bz = b[2]; + + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like { + const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + + return out; + } + + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + + return out; + } + + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + + return out; + } + + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like { + const x = a[0], + y = a[1], + z = a[2]; + const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like { + let x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like { + // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + // var qvec = [qx, qy, qz]; + // var uv = vec3.cross([], qvec, a); + const uvx = (qy * z - qz * y); + const uvy = (qz * x - qx * z); + const uvz = (qx * y - qy * x); + // var uuv = vec3.cross([], qvec, uv); + // vec3.scale(uuv, uuv, 2); + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + // vec3.scale(uv, uv, 2 * w); + // return vec3.add(out, a, vec3.add(out, uv, uuv)); + out[0] = x + (uvx*w2) + uuvx; + out[1] = y + (uvy*w2) + uuvy; + out[2] = z + (uvz*w2) + uuvz; + return out; + } + + /** + * Rotate a 3D vector around the x-axis + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like { + const by = b[1]; + const bz = b[2]; + + //Translate point to the origin + const py = a[1] - by; + const pz = a[2] - bz; + + //perform rotation + //translate to correct position + out[0] = a[0]; + out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by; + out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz; + + return out; + } + + /** + * Rotate a 3D vector around the y-axis + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like { + const bx = b[0]; + const bz = b[2]; + + //Translate point to the origin + const px = a[0] - bx; + const pz = a[2] - bz; + + //perform rotation + //translate to correct position + out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx; + out[1] = a[1]; + out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz; + + return out; + } + + /** + * Rotate a 3D vector around the z-axis + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like { + const bx = b[0]; + const by = b[1]; + + //Translate point to the origin + const px = a[0] - bx; + const py = a[1] - by; + + //perform rotation + //translate to correct position + out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx; + out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by; + out[2] = b[2]; + + return out; + } + + /** + * Get the angle between two 3D vectors + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly) { + 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec3Like): Vec3Like { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + return out; + } + + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string { + return `Vec3(${a.join(', ')})`; + } + + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) + ); + } +} + +// Instance method alias assignments +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; + +// Static method alias assignments +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; diff --git a/src/_lib/f64/Vec4.ts b/src/_lib/f64/Vec4.ts new file mode 100644 index 00000000..95b97851 --- /dev/null +++ b/src/_lib/f64/Vec4.ts @@ -0,0 +1,1030 @@ +import { GLM_EPSILON } from '#gl-matrix/common'; + +import type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types'; + +/** + * 4 Dimensional Vector + */ +export class Vec4 extends Float64Array { + /** + * Create a {@link Vec4}. + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch(values.length) { + case 4: + super(values); break; + case 2: + super(values[0] as ArrayBufferLike, values[1], 4); break; + case 1: { + const v = values[0]; + if (typeof v === 'number') { + super([v, v, v, v]); + } else { + super(v as ArrayBufferLike, 0, 4); + } + break; + } + default: + super(4); break; + } + } + + //============ + // Attributes + //============ + + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector components + */ + get x(): number { return this[0]; } + set x(value: number) { this[0] = value; } + + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector components + */ + get y(): number { return this[1]; } + set y(value: number) { this[1] = value; } + + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector components + */ + get z(): number { return this[2]; } + set z(value: number) { this[2] = value; } + + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector components + */ + get w(): number { return this[3]; } + set w(value: number) { this[3] = value; } + + // Alternate set of getters and setters in case this is being used to define + // a color. + + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color components + */ + get r(): number { return this[0]; } + set r(value: number) { this[0] = value; } + + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color components + */ + get g(): number { return this[1]; } + set g(value: number) { this[1] = value; } + + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color components + */ + get b(): number { return this[2]; } + set b(value: number) { this[2] = value; } + + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color components + */ + get a(): number { return this[3]; } + set a(value: number) { this[3] = value; } + + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + */ + get magnitude(): number { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + + /** + * Alias for {@link Vec4.magnitude} + */ + get mag(): number { return this.magnitude; } + + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + */ + get str(): string { + return Vec4.str(this); + } + + //=================== + // Instances methods + //=================== + + /** + * Copy the values from another {@link Vec4} into `this`. + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): Vec4 { + super.set(a); + return this; + } + + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): Vec4 { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): Vec4 { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + + /** + * Alias for {@link Vec4.subtract} + */ + sub(b: Readonly): Vec4 { return this; } + + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): Vec4 { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + + /** + * Alias for {@link Vec4.multiply} + */ + mul(b: Readonly): Vec4 { return this; } + + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): Vec4 { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + + /** + * Alias for {@link Vec4.divide} + */ + div(b: Readonly): Vec4 { return this; } + + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): Vec4 { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): Vec4 { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + + /** + * Calculates the euclidian distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number { + return Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + */ + dist(b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number { + return Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + */ + sqrDist(b: Readonly): number { return 0; } + + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * + * @returns `this` + */ + negate(): Vec4 { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * + * @returns `this` + */ + invert(): Vec4 { + this[0] = 1.0 / this[0]; + this[1] = 1.0 / this[1]; + this[2] = 1.0 / this[2]; + this[3] = 1.0 / this[3]; + return this; + } + + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * + * @returns `this` + */ + abs(): Vec4 { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * + * @returns `this` + */ + normalize(): Vec4 { + return Vec4.normalize(this, this) as Vec4; + } + + //=================== + // Static accessors + //=================== + + /** + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH(): number { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + + //=================== + // Static methods + //=================== + + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create(): Vec4 { + return new Vec4(); + } + + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a: Vec4Like): Vec4 { + return new Vec4(a); + } + + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x: number, y: number, z: number, w: number): Vec4 { + return new Vec4(x, y, z, w); + } + + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } + + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } + + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } + + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + + /** + * Calculates the euclidian distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the squared euclidian distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number { return 0; } + + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a: Readonly): number { return 0; } + + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a: Readonly): number { return 0; } + + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a: Readonly): number { return 0; } + + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number { return 0; } + + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + out[3] = 1.0 / a[3]; + return out; + } + + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec4Like, a: Readonly): Vec4Like { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec4Like, a: Readonly): Vec4Like { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + + return out; + } + + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + + // calculate quat * vec + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec4Like): Vec4Like { + out[0] = 0.0; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + return out; + } + + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string { + return `Vec4(${a.join(', ')})`; + } + + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return ( + Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) + ); + } +} + +// Instance method alias assignments +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; + +// Static method alias assignments +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; diff --git a/src/_lib/f64/index.ts b/src/_lib/f64/index.ts new file mode 100644 index 00000000..d7e65584 --- /dev/null +++ b/src/_lib/f64/index.ts @@ -0,0 +1,9 @@ +export { Mat2 } from './Mat2.js'; +export { Mat2d } from './Mat2d.js'; +export { Mat3 } from './Mat3.js'; +export { Mat4 } from './Mat4.js'; +export { Quat } from './Quat.js'; +export { Quat2 } from './Quat2.js'; +export { Vec2 } from './Vec2.js'; +export { Vec3 } from './Vec3.js'; +export { Vec4 } from './Vec4.js'; diff --git a/src/classic/index.ts b/src/classic/index.ts new file mode 100644 index 00000000..a0d7ff89 --- /dev/null +++ b/src/classic/index.ts @@ -0,0 +1,28 @@ +/** + * Provides aliases for backwards compatibility with the `3.x` API (32-bit). + * + * To facilitate easier adoption of version 4 of `gl-matrix` and maintain compatability with existing codebases the + * modern API can be accessed via remapped exports matching the version 3 API from the `gl-matrix/classic` sub-path + * export. The only change required is altering imports from `gl-matrix` to `gl-matrix/classic`. + * + * ```js + * import { vec3 } from 'gl-matrix/classic'; + * + * const vec = vec3.create(); + * ``` + * + * @packageDocumentation + */ + +export { + Mat2 as mat2, + Mat2d as mat2d, + Mat3 as mat3, + Mat4 as mat4, + Quat as quat, + Quat2 as quat2, + Vec2 as vec2, + Vec3 as vec3, + Vec4 as vec4, +} from '#gl-matrix'; + diff --git a/src/common.ts b/src/common.ts deleted file mode 100644 index 935c269c..00000000 --- a/src/common.ts +++ /dev/null @@ -1,31 +0,0 @@ -export const EPSILON = 0.000001; -export const ANGLE_ORDER = "zyx"; - -/** - * The floating point typed arrays that can be used in place of a vector, - * matrix, or quaternion. - */ -export type FloatArray = Float32Array | Float64Array; - -const DEG_TO_RAD = Math.PI / 180; -const RAD_TO_DEG = 180 / Math.PI; - -/** - * Convert Degrees To Radians - * - * @param value - Angle in Degrees - * @returns Angle in Radians - */ -export function toRadian(value: number): number { - return value * DEG_TO_RAD; -} - -/** - * Convert Radians To Degrees - * - * @param value - Angle in Radians - * @returns Angle in Degrees - */ -export function toDegree(value: number): number { - return value * RAD_TO_DEG; -} diff --git a/src/common/index.ts b/src/common/index.ts new file mode 100644 index 00000000..86b159ae --- /dev/null +++ b/src/common/index.ts @@ -0,0 +1,10 @@ +/** + * Provides common resources and constants shared across `gl-matrix`. + * + * @packageDocumentation + */ + +/** + * A small constant used to determine the acceptable error margin in floating-point calculations. + */ +export const GLM_EPSILON: number = 0.000001; diff --git a/src/f64/index.ts b/src/f64/index.ts new file mode 100644 index 00000000..775efe65 --- /dev/null +++ b/src/f64/index.ts @@ -0,0 +1,23 @@ +/** + * Provides the modern `gl-matrix` API (64-bit). All classes extend from `Float64Array`. The API is identical to + * the main 32-bit variation. + * + * ```js + * import { Vec3 } from 'gl-matrix/f64'; + * + * const vec = new Vec3(0, 1, 2); + * ``` + * + * If you have a need to mix and match the 64-bit and 32-bit versions you can do so by importing them as different + * names. + * + * ```js + * import { Vec3 as Vec3F32 } from 'gl-matrix'; + * import { Vec3 as Vec3F64 } from 'gl-matrix/f64'; + * ``` + * + * @packageDocumentation + */ + +export * from '../_lib/f64/index.js'; + diff --git a/src/index.ts b/src/index.ts index fbc224c4..12dada5d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,25 +1,13 @@ -import { Mat2, mat2, Mat2Like } from './mat2.js'; -import { Mat2d, mat2d, Mat2dLike } from './mat2d.js'; -import { Mat3, mat3, Mat3Like } from './mat3.js'; -import { Mat4, mat4, Mat4Like } from './mat4.js'; -import { Quat, quat, QuatLike } from './quat.js'; -import { Quat2, quat2, Quat2Like } from './quat2.js'; -import { Vec2, vec2, Vec2Like } from './vec2.js'; -import { Vec3, vec3, Vec3Like } from './vec3.js'; -import { Vec4, vec4, Vec4Like } from './vec4.js'; -import { FloatArray } from './common.js'; -import { EnableSwizzles } from './swizzle.js'; +/** + * Provides the modern `gl-matrix` API (32-bit). All classes extend from `Float32Array`. + * + * ```js + * import { Vec3 } from 'gl-matrix'; + * + * const vec = new Vec3(0, 1, 2); + * ``` + * + * @packageDocumentation + */ -export { - Mat2, mat2, Mat2Like, - Mat2d, mat2d, Mat2dLike, - Mat3, mat3, Mat3Like, - Mat4, mat4, Mat4Like, - Quat, quat, QuatLike, - Quat2, quat2, Quat2Like, - Vec2, vec2, Vec2Like, - Vec3, vec3, Vec3Like, - Vec4, vec4, Vec4Like, - FloatArray, - EnableSwizzles -}; \ No newline at end of file +export * from './_lib/f32/index.js'; diff --git a/src/swizzle/f64/index.ts b/src/swizzle/f64/index.ts new file mode 100644 index 00000000..4a9e4eca --- /dev/null +++ b/src/swizzle/f64/index.ts @@ -0,0 +1,127 @@ +/** + * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from + * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support + * please see {@link gl-matrix/types/swizzle/f64}. + * + * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}. + * + * @example + * ```ts + * import { Vec3 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * const vec = new Vec3(0, 1, 2); + * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). + * ``` + * + * @packageDocumentation + */ + +import { Vec2, Vec3, Vec4 } from '#gl-matrix/f64'; + +/** + * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit). + */ +let GLM_SWIZZLES_ENABLED_F64: boolean = false; + +/** + * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / + * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit). + * + * Swizzle operations are performed by using the `.` operator in conjunction with any combination + * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed). + * They return a new vector with the same number of components as specified in the swizzle attribute. + * + * @example + * ```js + * import { Vec3 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * let v = new Vec3(0, 1, 2); + * + * v.yx; // returns new Vec2(1, 0) + * v.xzy; // returns new Vec3(0, 2, 1) + * v.zyxz; // returns new Vec4(2, 1, 0, 2) + * + * v.rgb; // returns new Vec3(0, 1, 2) + * v.rbg; // returns new Vec3(0, 2, 1) + * v.gg; // returns new Vec2(1, 1) + * ``` + */ +export function EnableSwizzlesF64(): void { + /* v8 ignore next 1 */ + if (GLM_SWIZZLES_ENABLED_F64) { return; } + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg']; + const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb']; + const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa']; + + // [/Swizzle Autogen] + + /** + * Internal swizzle index table for `gl-matrix`. + */ + const SWIZZLE_INDEX = { + x: 0, r: 0, + y: 1, g: 1, + z: 2, b: 2, + w: 3, a: 3, + }; + + /** + * Internal helper function to convert and return a `gl-matrix` vector by swizzle format. + * + * @param swizzle - Swizzle format to apply. + * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance. + */ + function getSwizzleImpl(swizzle: string): () => any { + switch(swizzle.length) { + case 2: + return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); }; + case 3: + return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); }; + case 4: + return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; + } + } + + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + + GLM_SWIZZLES_ENABLED_F64 = true; +} diff --git a/src/swizzle.ts b/src/swizzle/index.ts similarity index 68% rename from src/swizzle.ts rename to src/swizzle/index.ts index 8aafaa95..22d9396d 100644 --- a/src/swizzle.ts +++ b/src/swizzle/index.ts @@ -1,42 +1,37 @@ -import { Vec2 } from './vec2.js'; -import { Vec3 } from './vec3.js'; -import { Vec4 } from './vec4.js'; - -// The contents of the following section are autogenerated by scripts/gen-swizzle.js and should -// not be modified by hand. -// [Swizzle Autogen] - - const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg']; - const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb']; - const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa']; - -// [/Swizzle Autogen] - -const SWIZZLE_INDEX = { - x: 0, r: 0, - y: 1, g: 1, - z: 2, b: 2, - w: 3, a: 3, -}; +/** + * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from + * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please + * see {@link gl-matrix/types/swizzle}. + * + * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}. + * + * @example + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import { EnableSwizzles } from 'gl-matrix/swizzle'; + * + * EnableSwizzles(); + * + * const vec = new Vec3(0, 1, 2); + * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). + * ``` + * + * @packageDocumentation + */ -function getSwizzleImpl(swizzle: string): () => any { - switch(swizzle.length) { - case 2: - return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); }; - case 3: - return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); }; - case 4: - return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; - } -} +import { Vec2, Vec3, Vec4 } from '#gl-matrix'; -let swizzlesEnabled = false; +/** + * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit). + */ +let GLM_SWIZZLES_ENABLED_F32: boolean = false; /** - * Enables Swizzle operations on {@link Vec2}, {@link Vec3}, and {@link Vec4} types. + * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / + * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit). * * Swizzle operations are performed by using the `.` operator in conjunction with any combination - * of between two to four component names, either from the set `xyzw` or `rgbw` (though not intermixed). + * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed). * They return a new vector with the same number of components as specified in the swizzle attribute. * * @example @@ -47,17 +42,55 @@ let swizzlesEnabled = false; * * let v = new Vec3(0, 1, 2); * - * v.yx // returns new Vec2(1, 0); - * v.xzy // returns new Vec3(0, 2, 1); - * v.zyxz // returns new Vec4(2, 1, 0, 2); + * v.yx; // returns new Vec2(1, 0) + * v.xzy; // returns new Vec3(0, 2, 1) + * v.zyxz; // returns new Vec4(2, 1, 0, 2) * - * v.rgb // returns new Vec3(0, 1, 2); - * v.rbg // returns new Vec3(0, 2, 1); - * v.gg // returns new Vec2(1, 1); + * v.rgb; // returns new Vec3(0, 1, 2) + * v.rbg; // returns new Vec3(0, 2, 1) + * v.gg; // returns new Vec2(1, 1) * ``` */ -export function EnableSwizzles() { - if (swizzlesEnabled) { return; } +export function EnableSwizzles(): void { + /* v8 ignore next 1 */ + if (GLM_SWIZZLES_ENABLED_F32) { return; } + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg']; + const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb']; + const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa']; + + // [/Swizzle Autogen] + + /** + * Internal swizzle index table for `gl-matrix`. + */ + const SWIZZLE_INDEX = { + x: 0, r: 0, + y: 1, g: 1, + z: 2, b: 2, + w: 3, a: 3, + }; + + /** + * Internal helper function to convert and return a `gl-matrix` vector by swizzle format. + * + * @param swizzle - Swizzle format to apply. + * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance. + */ + function getSwizzleImpl(swizzle: string): () => any { + switch(swizzle.length) { + case 2: + return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); }; + case 3: + return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); }; + case 4: + return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; + } + } for (const swizzle of VEC2_SWIZZLES) { const impl = getSwizzleImpl(swizzle); @@ -89,6 +122,5 @@ export function EnableSwizzles() { }); } - swizzlesEnabled = true; + GLM_SWIZZLES_ENABLED_F32 = true; } - diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 00000000..cc712a7d --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,108 @@ +/** + * Provides all common type declarations shared across `gl-matrix`. + * + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import type { Vec3Like } from 'gl-matrix/types'; + * + * const vec: Vec3Like = new Vec3(0, 1, 2); + * ``` + * + * For JSDoc using the new Typescript 5.5 `@import` tag: + * ```js + * /** + * * @import { Vec3Like } from 'gl-matrix/types' + * *\/ + * ``` + * + * For JSDoc using the older `import types` Typescript mechanism: + * ```js + * /** + * * @type {import('gl-matrix/types').Vec3Like} + * *\/ + * ``` + * + * @packageDocumentation + */ + +/** + * The floating-point typed arrays that can be used in place of a vector, matrix, or quaternion. + */ +type FloatArray = Float32Array | Float64Array; + +/** + * A 2x2 Matrix given as a {@link Mat2}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Mat2Like = [ + number, number, + number, number +] | FloatArray; + +/** + * A 2x3 Matrix given as a {@link Mat2d}, a 6-element floating-point TypedArray, or an array of 6 numbers. + */ +type Mat2dLike = [ + number, number, + number, number, + number, number +] | FloatArray; + +/** + * A 3x3 Matrix given as a {@link Mat3}, a 9-element floating-point TypedArray, or an array of 9 numbers. + */ +type Mat3Like = [ + number, number, number, + number, number, number, + number, number, number +] | FloatArray; + +/** + * A 4x4 Matrix given as a {@link Mat4}, a 16-element floating-point TypedArray, or an array of 16 numbers. + */ +type Mat4Like = [ + number, number, number, number, + number, number, number, number, + number, number, number, number, + number, number, number, number +] | FloatArray; + +/** + * A Quaternion given as a {@link Quat}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type QuatLike = Vec4Like; + +/** + * A Dual Quaternion given as a {@link Quat2}, an 8-element floating-point TypedArray, or an array of 8 numbers. + */ +type Quat2Like = [ + number, number, number, number, + number, number, number, number +] | FloatArray; + +/** + * A 2-dimensional vector given as a {@link Vec2}, a 2-element floating-point TypedArray, or an array of 2 numbers. + */ +type Vec2Like = [number, number] | FloatArray; + +/** + * A 3-dimensional vector given as a {@link Vec3}, a 3-element floating-point TypedArray, or an array of 3 numbers. + */ +type Vec3Like = [number, number, number] | FloatArray; + +/** + * A 4-dimensional vector given as a {@link Vec4}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Vec4Like = [number, number, number, number] | FloatArray; + +export { + FloatArray, + Mat2Like, + Mat2dLike, + Mat3Like, + Mat4Like, + QuatLike, + Quat2Like, + Vec2Like, + Vec3Like, + Vec4Like +}; diff --git a/src/types/swizzle/f64/index.ts b/src/types/swizzle/f64/index.ts new file mode 100644 index 00000000..52861ea4 --- /dev/null +++ b/src/types/swizzle/f64/index.ts @@ -0,0 +1,1997 @@ +/** + * Ambient module declarations for `gl-matrix/f64` (64-bit) swizzle extensions for vector classes. + * + * When swizzle accessors via {@link gl-matrix/swizzle/f64.EnableSwizzlesF64 | EnableSwizzlesF64} are enabled include + * this sub-path export as a `side effect` import to add ambient module declarations for the additional accessors to + * {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / {@link gl-matrix/f64.Vec4 | Vec4}. + * + * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}. + * + * ```js + * import { Vec2 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * import 'gl-matrix/types/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * const vec = new Vec2(0, 1); + * + * // Swizzled instance - returns new Vec2(1, 0). + * const vecSwizzled = vec.yx; + * ``` + * + * @packageDocumentation + */ + +import type { Vec2, Vec3, Vec4 } from '#gl-matrix/f64'; + +/** + * A type alias for Vec2 (64-bit). + * @hidden + */ +type Vec2Alias = Vec2; + +/** + * A type alias for Vec3 (64-bit). + * @hidden + */ +type Vec3Alias = Vec3; + +/** + * A type alias for Vec4 (64-bit). + * @hidden + */ +type Vec4Alias = Vec4; + +declare module '#gl-matrix/f64' { + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + /** + * Vec2 swizzle extension accessors. + */ + interface Vec2 { + /** @return New instance of swizzled Vec2 */ + get xx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get xy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yy(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyy(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyy(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get rg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gg(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rrg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggg(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggg(): Vec4Alias; + } + + /** + * Vec3 swizzle extension accessors. + */ + interface Vec3 { + /** @return New instance of swizzled Vec2 */ + get xx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get xy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yy(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyy(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyy(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get rg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gg(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rrg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggg(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggg(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get xz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zz(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzz(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzz(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get br(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bb(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbb(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbb(): Vec4Alias; + } + + /** + * Vec4 swizzle extension accessors. + */ + interface Vec4 { + /** @return New instance of swizzled Vec2 */ + get xx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get xy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yy(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyy(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyy(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get rg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gg(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rrg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggg(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggg(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get xz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zz(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzz(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzz(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get br(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bb(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbb(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbb(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get xw(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yw(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zw(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get wx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get wy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get wz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ww(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xwx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xwy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xwz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xww(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ywx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ywy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ywz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yww(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zwx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zwy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zwz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zww(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wwx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wwy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wwz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get www(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwww(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get ra(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ga(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ba(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ar(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ag(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ab(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get aa(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rra(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get raa(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gra(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gaa(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bra(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get baa(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get arr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get arg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get arb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ara(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get agr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get agg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get agb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get abr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get abg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get abb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aaa(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rraa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rarr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rarg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rarb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ragr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ragg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ragb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rabr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rabg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rabb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get graa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get garr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get garg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get garb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gagr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gagg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gagb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gabr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gabg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gabb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get braa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get barr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get barg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get barb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bagr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bagg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bagb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get babr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get babg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get babb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get argr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get argg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get argb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get araa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aarr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aarg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aarb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aagr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aagg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aagb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aabr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aabg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aabb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaaa(): Vec4Alias; + } + + // [/Swizzle Autogen] +} + +export {}; diff --git a/src/types/swizzle/index.ts b/src/types/swizzle/index.ts new file mode 100644 index 00000000..4712c29f --- /dev/null +++ b/src/types/swizzle/index.ts @@ -0,0 +1,1997 @@ +/** + * Ambient module declarations for `gl-matrix` (32-bit) swizzle extensions for vector classes. + * + * When swizzle accessors via {@link gl-matrix/swizzle.EnableSwizzles | EnableSwizzles} are enabled include this + * sub-path export as a `side effect` import to add ambient module declarations for the additional accessors to + * {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / {@link gl-matrix.Vec4 | Vec4} + * + * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}. + * + * ```js + * import { Vec2 } from 'gl-matrix'; + * import { EnableSwizzles } from 'gl-matrix/swizzle'; + * + * import 'gl-matrix/types/swizzle'; + * + * EnableSwizzles(); + * + * const vec = new Vec2(0, 1); + * + * // Swizzled instance - returns new Vec2(1, 0). + * const vecSwizzled = vec.yx; + * ``` + * + * @packageDocumentation + */ + +import type { Vec2, Vec3, Vec4 } from '#gl-matrix'; + +/** + * A type alias for Vec2 (32-bit). + * @hidden + */ +type Vec2Alias = Vec2; + +/** + * A type alias for Vec3 (32-bit). + * @hidden + */ +type Vec3Alias = Vec3; + +/** + * A type alias for Vec4 (32-bit). + * @hidden + */ +type Vec4Alias = Vec4; + +declare module '#gl-matrix' { + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + /** + * Vec2 swizzle extension accessors. + */ + interface Vec2 { + /** @return New instance of swizzled Vec2 */ + get xx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get xy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yy(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyy(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyy(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get rg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gg(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rrg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggg(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggg(): Vec4Alias; + } + + /** + * Vec3 swizzle extension accessors. + */ + interface Vec3 { + /** @return New instance of swizzled Vec2 */ + get xx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get xy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yy(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyy(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyy(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get rg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gg(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rrg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggg(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggg(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get xz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zz(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzz(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzz(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get br(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bb(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbb(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbb(): Vec4Alias; + } + + /** + * Vec4 swizzle extension accessors. + */ + interface Vec4 { + /** @return New instance of swizzled Vec2 */ + get xx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get xy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yy(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyy(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyy(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get rg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gr(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gg(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rrg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggg(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggg(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get xz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zz(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzz(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzz(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get rb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get gb(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get br(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bg(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get bb(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rrb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get grb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ggb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gbb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get brb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bgb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bbb(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbbb(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get xw(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get yw(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get zw(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get wx(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get wy(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get wz(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ww(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get xxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xwx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xwy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xwz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get xww(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ywx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ywy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ywz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get yww(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zwx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zwy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zwz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get zww(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wxw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wyw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wzw(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wwx(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wwy(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get wwz(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get www(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get xxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get xwww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get yzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ywww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get zwww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wxww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wywx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wywy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wywz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wyww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wzww(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwxw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwyw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwzw(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwwx(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwwy(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwwz(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get wwww(): Vec4Alias; + /** @return New instance of swizzled Vec2 */ + get ra(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ga(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ba(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ar(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ag(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get ab(): Vec2Alias; + /** @return New instance of swizzled Vec2 */ + get aa(): Vec2Alias; + /** @return New instance of swizzled Vec3 */ + get rra(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get rab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get raa(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gra(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get gaa(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bra(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get bab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get baa(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get arr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get arg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get arb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get ara(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get agr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get agg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get agb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aga(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get abr(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get abg(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get abb(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aba(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aar(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aag(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aab(): Vec3Alias; + /** @return New instance of swizzled Vec3 */ + get aaa(): Vec3Alias; + /** @return New instance of swizzled Vec4 */ + get rrra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rrab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rraa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rgaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rbaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rarr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rarg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rarb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ragr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ragg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ragb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rabr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rabg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get rabb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get raaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get grab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get graa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get ggaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gbaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get garr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get garg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get garb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gagr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gagg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gagb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gabr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gabg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gabb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get gaaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get brab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get braa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bgaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bbaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get barr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get barg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get barb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bagr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bagg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get bagb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get babr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get babg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get babb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get baaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get argr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get argg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get argb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get arab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get araa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aggr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aggg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aggb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get agaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abrr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abrg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abrb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abra(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abgr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abgg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abgb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abbr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abbg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abbb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get abaa(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aarr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aarg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aarb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aara(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aagr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aagg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aagb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaga(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aabr(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aabg(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aabb(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaba(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaar(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaag(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaab(): Vec4Alias; + /** @return New instance of swizzled Vec4 */ + get aaaa(): Vec4Alias; + } + + // [/Swizzle Autogen] +} + +export {}; diff --git a/src/util/angleConversion.ts b/src/util/angleConversion.ts new file mode 100644 index 00000000..19da140f --- /dev/null +++ b/src/util/angleConversion.ts @@ -0,0 +1,29 @@ +/** + * Constant used in `gl-matrix` angle conversions. + */ +const GLM_DEG_TO_RAD: number = Math.PI / 180; + +/** + * Constant used in `gl-matrix` angle conversions. + */ +const GLM_RAD_TO_DEG: number = 180 / Math.PI; + +/** + * Convert `radians` to `degrees`. + * + * @param value - Angle in `radians`. + * @returns Angle in `degrees`. + */ +export function toDegree(value: number): number { + return value * GLM_RAD_TO_DEG; +} + +/** + * Convert `degrees` to `radians`. + * + * @param value - Angle in `degrees`. + * @returns Angle in `radians`. + */ +export function toRadian(value: number): number { + return value * GLM_DEG_TO_RAD; +} diff --git a/src/util/index.ts b/src/util/index.ts new file mode 100644 index 00000000..f3bfaafd --- /dev/null +++ b/src/util/index.ts @@ -0,0 +1,13 @@ +/** + * Provides optional utilities useful for working with `gl-matrix`. + * + * ```js + * import { toDegree, toRadian } from 'gl-matrix/util'; + * + * const rad = toRadian(180); + * ``` + * + * @packageDocumentation + */ + +export * from './angleConversion.js'; diff --git a/tests/classic-api.spec.ts b/tests/classic-api.spec.ts new file mode 100644 index 00000000..2ca43b2a --- /dev/null +++ b/tests/classic-api.spec.ts @@ -0,0 +1,22 @@ +import { expect, describe, it } from 'vitest'; + +import * as modern from '#gl-matrix'; +import * as classic from '#gl-matrix/classic'; + +const toUpper = (string: string) => string.charAt(0).toUpperCase() + string.slice(1); + +describe('Classic API', () => { + const classicKeys = Object.keys(classic); + const modernKeys = Object.keys(modern); + + it('Classic API re-exports Modern API', () => + { + // Ensure that the Classic & Modern APIs export the same amount of symbols. + expect(classicKeys.length).toEqual(modernKeys.length); + + // Verify that Classic API re-exports the Modern API. + for (const key of classicKeys) { + expect(classic[key]).toEqual(modern[toUpper(key)]); + } + }); +}); diff --git a/tests/common.spec.ts b/tests/common.spec.ts deleted file mode 100644 index 798a9722..00000000 --- a/tests/common.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { expect, describe, it } from 'vitest'; -import "./test-utils" -import { toRadian, toDegree } from "../src/common" - -describe("Common", function() { - describe("toRadian", function(){ - it("should return a value of 0 when passed 0", function(){ expect(toRadian(0)).toBeCloseTo(0); }); - it("should return a value of Math.PI/2 when passed 90", function(){ expect(toRadian(90)).toBeCloseTo(Math.PI/2); }); - it("should return a value of Math.PI when passed 180", function(){ expect(toRadian(180)).toBeCloseTo(Math.PI); }); - it("should return a value of Math.PI*2 when passed 360", function(){ expect(toRadian(360)).toBeCloseTo(Math.PI*2); }); - }); - - describe("toDegree", function(){ - it("should return a value of 0 when passed 0", function(){ expect(toDegree(0)).toBeCloseTo(0); }); - it("should return a value of 90 when passed Math.PI/2", function(){ expect(toDegree(Math.PI/2)).toBeCloseTo(90); }); - it("should return a value of 180 when passed Math.PI", function(){ expect(toDegree(Math.PI)).toBeCloseTo(180); }); - it("should return a value of 360 when passed Math.PI*2", function(){ expect(toDegree(Math.PI*2)).toBeCloseTo(360); }); - }); -}); \ No newline at end of file diff --git a/tests/f32/Mat2.spec.ts b/tests/f32/Mat2.spec.ts new file mode 100644 index 00000000..578a4ab7 --- /dev/null +++ b/tests/f32/Mat2.spec.ts @@ -0,0 +1,394 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat2 } from '#gl-matrix'; + +describe('Mat2', () => { + describe('constructor', () => { + it('should return an identity Mat2 if called with no arguments', () => { + expect(new Mat2()).toBeVec( + 1, 0, + 0, 1) + }); + + it('should return Mat2(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { + expect(new Mat2( + 1, 2, + 3, 4)).toBeVec( + 1, 2, + 3, 4); + }); + + it('should return Mat2(x, x, x, ...) if called with (x)', () => { + expect(new Mat2(1)).toBeVec( + 1, 1, + 1, 1); + }); + + it('should return Mat2(m0, m1, ...m8) if called with ([m0, m1, ...m8])', () => { + expect(new Mat2([ + 1, 2, + 3, 4])).toBeVec( + 1, 2, + 3, 4); + }); + + it('should return Mat2(m0, m1, ...m8) if called with (Mat4(m0, m1, ...m9))', () => { + let v = new Mat2( + 1, 2, + 3, 4); + expect(new Mat2(v)).toBeVec(v); + }); + + it('should return Mat2(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))', () => { + let arr = new Float32Array([ + 1, 2, + 3, 4]); + expect(new Mat2(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, identity, result; + + beforeEach(() => { + matA = new Float32Array([1, 2, 3, 4]); + matB = new Float32Array([5, 6, 7, 8]); + out = new Float32Array([0, 0, 0, 0]); + identity = new Float32Array([1, 0, 0, 1]); + }); + + describe('create', () => { + beforeEach(() => { result = Mat2.create(); }); + + it('should return a 4 element array initialized to a 2x2 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat2.clone(matA); }); + + it('should return a 4 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat2.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat2.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('transpose', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.transpose(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 3, 2, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.transpose(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec(1, 3, 2, 4)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.invert(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(-2, 1, 1.5, -0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.invert(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec(-2, 1, 1.5, -0.5)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('adjoint', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.adjoint(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(4, -2, -3, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.adjoint(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec(4, -2, -3, 1)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat2.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(-2)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat2.mul).toEqual(Mat2.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.multiply(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(23, 34, 31, 46)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.multiply(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(23, 34, 31, 46)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.multiply(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(23, 34, 31, 46)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('rotate', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.rotate(out, matA, Math.PI * 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, -1, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.rotate(matA, matA, Math.PI * 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(3, 4, -1, -2)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('scale', () => { + let vecA; + + beforeEach(() => { vecA = [2, 3]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.scale(out, matA, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 9, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.scale(matA, matA, vecA); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 9, 12)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat2.str(matA); }); + + it('should return a string representation of the matrix', () => expect(result).toEqual('Mat2(1, 2, 3, 4)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat2.frob(matA); }); + it('should return the Frobenius Norm of the matrix', + () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2)))); + }); + + describe('LDU', () => { + let L, D, U, L_result, D_result, U_result; + + beforeEach(() => { + L = Mat2.create(); + D = Mat2.create(); + U = Mat2.create(); + result = Mat2.LDU(L, D, U, [4,3,6,3]); + L_result = Mat2.create(); L_result[2] = 1.5; + D_result = Mat2.create(); + U_result = Mat2.create(); + U_result[0] = 4; U_result[1] = 3; U_result[3] = -1.5; + }); + + it('should return a lower triangular, a diagonal and an upper triangular matrix', () => { + expect(result[0]).toBeVec(L_result); + expect(result[1]).toBeVec(D_result); + expect(result[2]).toBeVec(U_result); + }); + }); + + describe('add', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.add(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.add(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(6, 8, 10, 12)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.add(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(6, 8, 10, 12)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Mat2.sub).toEqual(Mat2.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.subtract(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(-4, -4, -4, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.subtract(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(-4, -4, -4, -4)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.subtract(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(-4, -4, -4, -4)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat2.fromValues(1, 2, 3, 4); }); + + it('should return a 4 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3, 4)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat2.set(out, 1, 2, 3, 4); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalar(out, matA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 6, 8)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3.5, 5, 6.5, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(3.5, 5, 6.5, 8)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', () => expect(matB).toBeVec(3.5, 5, 6.5, 8)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3]; + matB = [0, 1, 2, 3]; + matC = [1, 2, 3, 4]; + r0 = Mat2.exactEquals(matA, matB); + r1 = Mat2.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3]; + matB = [0, 1, 2, 3]; + matC = [1, 2, 3, 4]; + matD = [1e-16, 1, 2, 3]; + r0 = Mat2.equals(matA, matB); + r1 = Mat2.equals(matA, matC); + r2 = Mat2.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3)); + }); + }); +}); diff --git a/tests/f32/Mat2d.spec.ts b/tests/f32/Mat2d.spec.ts new file mode 100644 index 00000000..f9e7d439 --- /dev/null +++ b/tests/f32/Mat2d.spec.ts @@ -0,0 +1,387 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat2d } from '#gl-matrix'; + +describe('Mat2d', () => { + describe('constructor', () => { + it('should return an identity Mat2d if called with no arguments', () => { + expect(new Mat2d()).toBeVec( + 1, 0, + 0, 1, + 0, 0) + }); + + it('should return Mat2d(m0, m1, ...m5) if called with (m0, m1, ...m5)', () => { + expect(new Mat2d( + 1, 2, + 3, 4, + 5, 6)).toBeVec( + 1, 2, + 3, 4, + 5, 6); + }); + + it('should return Mat2d(x, x, x, ...) if called with (x)', () => { + expect(new Mat2d(1)).toBeVec( + 1, 1, + 1, 1, + 1, 1); + }); + + it('should return Mat2d(m0, m1, ...m8) if called with ([m0, m1, ...m8])', () => { + expect(new Mat2d([ + 1, 2, + 3, 4, + 5, 6])).toBeVec( + 1, 2, + 3, 4, + 5, 6); + }); + + it('should return Mat2d(m0, m1, ...m8) if called with (Mat2d(m0, m1, ...m9))', () => { + let v = new Mat2d( + 1, 2, + 3, 4, + 5, 6); + expect(new Mat2d(v)).toBeVec(v); + }); + + it('should return Mat2d(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))', () => { + let arr = new Float32Array([ + 1, 2, + 3, 4, + 5, 6]); + expect(new Mat2d(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, oldA, oldB, identity, result; + + beforeEach(() => { + matA = new Float32Array([1, 2, + 3, 4, + 5, 6]); + + oldA = new Float32Array([1, 2, + 3, 4, + 5, 6]); + + matB = new Float32Array([7, 8, + 9, 10, + 11, 12]); + + oldB = new Float32Array([7, 8, + 9, 10, + 11, 12]); + + out = new Float32Array([0, 0, + 0, 0, + 0, 0]); + + identity = new Float32Array([1, 0, + 0, 1, + 0, 0]); + }); + + describe('create', () => { + beforeEach(() => { result = Mat2d.create(); }); + + it('should return a 6 element array initialized to a 2x3 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat2d.clone(matA); }); + + it('should return a 6 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat2d.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat2d.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.invert(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.invert(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat2d.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(-2)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat2d.mul).toEqual(Mat2d.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.multiply(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(31, 46, 39, 58, 52, 76)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiply(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(31, 46, 39, 58, 52, 76)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiply(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(31, 46, 39, 58, 52, 76)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + }); + + describe('rotate', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.rotate(out, matA, Math.PI * 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, -1, -2, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.rotate(matA, matA, Math.PI * 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(3, 4, -1, -2, 5, 6)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('scale', () => { + let vecA; + beforeEach(() => { vecA = [2, 3]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.scale(out, matA, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 9, 12, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.scale(matA, matA, vecA); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 9, 12, 5, 6)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('translate', () => { + let vecA; + beforeEach(() => { vecA = [2, 3]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.translate(out, matA, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4, 16, 22)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.translate(matA, matA, vecA); }); + + it('should place values into matA', () => expect(matA).toBeVec(1, 2, 3, 4, 16, 22)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat2d.str(matA); }); + + it('should return a string representation of the matrix', + () => expect(result).toEqual('Mat2d(1, 2, 3, 4, 5, 6)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat2d.frob(matA); }); + + it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual(Math.sqrt(Math.pow(1, 2) + + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2) + Math.pow(5, 2) + Math.pow(6, 2) + 1))); + }); + + describe('add', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.add(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(8, 10, 12, 14, 16, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.add(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(8, 10, 12, 14, 16, 18)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.add(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(8, 10, 12, 14, 16, 18)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Mat2d.sub).toEqual(Mat2d.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.subtract(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(-6, -6, -6, -6, -6, -6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.subtract(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(-6, -6, -6, -6, -6, -6)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.subtract(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(-6, -6, -6, -6, -6, -6)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat2d.fromValues(1, 2, 3, 4, 5, 6); }); + + it('should return a 6 element array initialized to the values passed', + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat2d.set(out, 1, 2, 3, 4, 5, 6); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalar(out, matA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(4.5, 6, 7.5, 9, 10.5, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + it('should not modify matB', () => expect(matB).toBeVec(7, 8, 9, 10, 11, 12)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(4.5, 6, 7.5, 9, 10.5, 12)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(7, 8, 9, 10, 11, 12)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', () => expect(matB).toBeVec(4.5, 6, 7.5, 9, 10.5, 12)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1; + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5]; + matB = [0, 1, 2, 3, 4, 5]; + matC = [1, 2, 3, 4, 5, 6]; + r0 = Mat2d.exactEquals(matA, matB); + r1 = Mat2d.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5]; + matB = [0, 1, 2, 3, 4, 5]; + matC = [1, 2, 3, 4, 5, 6]; + matD = [1e-16, 1, 2, 3, 4, 5]; + r0 = Mat2d.equals(matA, matB); + r1 = Mat2d.equals(matA, matC); + r2 = Mat2d.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5)); + }); + }); +}); diff --git a/tests/f32/Mat3.spec.ts b/tests/f32/Mat3.spec.ts new file mode 100644 index 00000000..537bd5fc --- /dev/null +++ b/tests/f32/Mat3.spec.ts @@ -0,0 +1,572 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat3, Mat4, Vec3 } from '#gl-matrix'; + +describe('Mat3', () => { + describe('constructor', () => { + it('should return an identity Mat3 if called with no arguments', () => { + expect(new Mat3()).toBeVec( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1) + }); + + it('should return Mat3(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { + expect(new Mat3( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9)).toBeVec( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + }); + + it('should return Mat3(x, x, x, ...) if called with (x)', () => { + expect(new Mat3(1)).toBeVec( + 1, 1, 1, + 1, 1, 1, + 1, 1, 1); + }); + + it('should return Mat3(m0, m1, ...m8) if called with ([m0, m1, ...m8])', () => { + expect(new Mat3([ + 1, 2, 3, + 4, 5, 6, + 7, 8, 9])).toBeVec( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + }); + + it('should return Mat3(m0, m1, ...m8) if called with (Mat3(m0, m1, ...m9))', () => { + let v = new Mat3( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + expect(new Mat3(v)).toBeVec(v); + }); + + it('should return Mat3(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))', () => { + let arr = new Float32Array([ + 1, 2, 3, + 4, 5, 6, + 7, 8, 9]); + expect(new Mat3(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, identity, result; + + beforeEach(() => { + matA = new Float32Array([1, 0, 0, + 0, 1, 0, + 1, 2, 1]); + + matB = new Float32Array([1, 0, 0, + 0, 1, 0, + 3, 4, 1]); + + out = new Float32Array([0, 0, 0, + 0, 0, 0, + 0, 0, 0]); + + identity = new Float32Array([1, 0, 0, + 0, 1, 0, + 0, 0, 1]); + }); + + describe('normalFromMat4', () => { + beforeEach(() => { + matA = new Float32Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); + result = Mat3.normalFromMat4(out, matA); + }); + + it('should return out', () => expect(result).toBe(out)); + + describe('with translation and rotation', () => { + beforeEach(() => { + Mat4.translate(matA, matA, [2, 4, 6]); + Mat4.rotateX(matA, matA, Math.PI / 2); + + result = Mat3.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => { + expect(result).toBeVec(1, 0, 0, + 0, 0, 1, + 0,-1, 0); + }); + + describe('and scale', () => { + beforeEach(() => { + Mat4.scale(matA, matA, [2, 3, 4]); + + result = Mat3.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => { + expect(result).toBeVec(0.5, 0, 0, + 0, 0, 0.333333, + 0, -0.25, 0); + }); + }); + }); + }); + + describe('fromQuat', () => { + let q; + + beforeEach(() => { + q = [ 0, -0.7071067811865475, 0, 0.7071067811865475 ]; + result = Mat3.fromQuat(out, q); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should rotate a vector the same as the original quat', () => { + let vecOut = new Vec3(); + Vec3.transformQuat(vecOut, [0,0,-1], q); + expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(vecOut); + }); + + it('should rotate a vector by PI/2 radians', + () => expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(1,0,0)); + }); + + describe('fromMat4', () => { + beforeEach(() => { + result = Mat3.fromMat4(out, [ 1, 2, 3, 4, + 5, 6, 7, 8, + 9,10,11,12, + 13,14,15,16]); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should calculate proper Mat3', () => { + expect(out).toBeVec( 1, 2, 3, + 5, 6, 7, + 9,10,11); + }); + }); + + describe('scale', () => { + beforeEach(() => { result = Mat3.scale(out, matA, [2,2]); }); + + it('should return out', () => expect(result).toBe(out)); + it('should place proper values in out', () => { + expect(out).toBeVec( 2, 0, 0, + 0, 2, 0, + 1, 2, 1); + }); + }); + + describe('create', () => { + beforeEach(() => { result = Mat3.create(); }); + + it('should return a 9 element array initialized to a 3x3 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat3.clone(matA); }); + + it('should return a 9 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat3.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat3.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('transpose', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.transpose(out, matA); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 1, + 0, 1, 2, + 0, 0, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.transpose(matA, matA); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 1, + 0, 1, 2, + 0, 0, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.invert(out, matA); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.invert(matA, matA); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('adjoint', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.adjoint(out, matA); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.adjoint(matA, matA); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat3.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(1)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat3.mul).toEqual(Mat3.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.multiply(out, matA, matB); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + it('should not modify matB', () => { + expect(matB).toBeVec( + 1, 0, 0, + 0, 1, 0, + 3, 4, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.multiply(matA, matA, matB); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => { + expect(matB).toBeVec( + 1, 0, 0, + 0, 1, 0, + 3, 4, 1 + ); + }); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.multiply(matB, matA, matB); }); + + it('should place values into matB', () => { + expect(matB).toBeVec( + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ); + }); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat3.str(matA); }); + + it('should return a string representation of the matrix', + () => expect(result).toEqual('Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat3.frob(matA); }); + + it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(1, 2) + + Math.pow(2, 2) + Math.pow(1, 2)))); + }); + + describe('add', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.add(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.add(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.add(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + }); + + describe('subtract', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + + it('should have an alias called `sub`', () => expect(Mat3.sub).toEqual(Mat3.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.subtract(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.subtract(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.subtract(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); }); + + it('should return a 9 element array initialized to the values passed', + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat3.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + beforeEach(() => { matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalar(out, matA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', () => expect(matB).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + }); + + describe('projection', () => { + beforeEach(() => { result = Mat3.projection(out, 100.0, 200.0); }); + + it('should return out', () => expect(result).toBe(out)); + + it('should give projection matrix', () => { + expect(result).toBeVec(0.02, 0, 0, + 0, -0.01, 0, + -1, 1, 1); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + r0 = Mat3.exactEquals(matA, matB); + r1 = Mat3.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8]; + r0 = Mat3.equals(matA, matB); + r1 = Mat3.equals(matA, matC); + r2 = Mat3.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + }); + }); +}); diff --git a/tests/f32/Mat4.spec.ts b/tests/f32/Mat4.spec.ts new file mode 100644 index 00000000..b2d59080 --- /dev/null +++ b/tests/f32/Mat4.spec.ts @@ -0,0 +1,1165 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat4, Quat, Vec3 } from '#gl-matrix'; + +import type { Vec3Like } from '#gl-matrix/types'; + +describe('Mat4', () => { + describe('constructor', () => { + it('should return an identity Mat4 if called with no arguments', () => { + expect(new Mat4()).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + }); + + it('should return Mat4(m0, m1, ...m15) if called with (m0, m1, ...m15)', () => { + expect(new Mat4( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16)).toBeVec( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + }); + + it('should return Mat4(x, x, x) if called with (x)', () => { + expect(new Mat4(1)).toBeVec( + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1); + }); + + it('should return Mat4(m0, m1, ...m15) if called with ([m0, m1, ...m15])', () => { + expect(new Mat4([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16])).toBeVec( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + }); + + it('should return Mat4(m0, m1, ...m15) if called with (Mat4(m0, m1, ...m15))', () => { + let v = new Mat4( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + expect(new Mat4(v)).toBeVec(v); + }); + + it('should return Mat4(m0, m1, ...m15) if called with (Float32Array([m0, m1, ...m15]))', () => { + let arr = new Float32Array([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16]); + expect(new Mat4(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, identity, result; + + beforeEach(() => { + // Attempting to portray a semi-realistic transform matrix + matA = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + + matB = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + ]); + + out = new Float32Array([ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 + ]); + + identity = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]); + }); + + describe('create', () => { + beforeEach(() => { result = Mat4.create(); }); + + it('should return a 16 element array initialized to a 4x4 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat4.clone(matA); }); + + it('should return a 16 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat4.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat4.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('transpose', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.transpose(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3, + 0, 0, 0, 1 + )); + + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.transpose(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3, + 0, 0, 0, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.invert(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.invert(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('adjoint', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.adjoint(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.adjoint(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat4.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(1)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat4.mul).toEqual(Mat4.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.multiply(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + it('should not modify matB', () => expect(matB).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.multiply(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + )); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.multiply(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + }); + + describe('translate', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.translate(out, matA, [4, 5, 6]); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.translate(matA, matA, [4, 5, 6]); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('scale', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.scale(out, matA, [4, 5, 6]); }); + + it('should place values into out', () => expect(out).toBeVec( + 4, 0, 0, 0, + 0, 5, 0, 0, + 0, 0, 6, 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.scale(matA, matA, [4, 5, 6]); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 4, 0, 0, 0, + 0, 5, 0, 0, + 0, 0, 6, 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotate', () => { + let rad = Math.PI * 0.5; + let axis: Vec3Like = [1, 0, 0]; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotate(out, matA, rad, axis); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotate(matA, matA, rad, axis); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotateX', () => { + let rad = Math.PI * 0.5; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotateX(out, matA, rad); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotateX(matA, matA, rad); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotateY', () => { + let rad = Math.PI * 0.5; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotateY(out, matA, rad); }); + + it('should place values into out', () => expect(out).toBeVec( + Math.cos(rad), 0, -Math.sin(rad), 0, + 0, 1, 0, 0, + Math.sin(rad), 0, Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotateY(matA, matA, rad); }); + + it('should place values into matA', () => expect(matA).toBeVec( + Math.cos(rad), 0, -Math.sin(rad), 0, + 0, 1, 0, 0, + Math.sin(rad), 0, Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotateZ', () => { + let rad = Math.PI * 0.5; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotateZ(out, matA, rad); }); + + it('should place values into out', () => expect(out).toBeVec( + Math.cos(rad), Math.sin(rad), 0, 0, + -Math.sin(rad), Math.cos(rad), 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotateZ(matA, matA, rad); }); + + it('should place values into matA', () => expect(matA).toBeVec( + Math.cos(rad), Math.sin(rad), 0, 0, + -Math.sin(rad), Math.cos(rad), 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + // TODO: fromRotationTranslation + + describe('normalFromMat4', () => { + beforeEach(() => { + matA = new Float32Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); + result = Mat4.normalFromMat4(out, matA); + }); + + it('should return out', () => expect(result).toBe(out)); + + describe('with translation and rotation', () => { + beforeEach(() => { + Mat4.translate(matA, matA, [2, 4, 6]); + Mat4.rotateX(matA, matA, Math.PI / 2); + + result = Mat4.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 0, 1, 0, + 0,-1, 0, 0, + 0, 0, 0, 1 + )); + + describe('and scale', () => { + beforeEach(() => { + Mat4.scale(matA, matA, [2, 3, 4]); + + result = Mat4.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => expect(result).toBeVec( + 0.5, 0, 0, 0, + 0, 0, 0.333333, 0, + 0, -0.25, 0, 0, + 0, 0, 0, 1 + )); + }); + }); + }); + + describe('getTranslation', () => { + describe('from the identity matrix', () => { + beforeEach(() => { + result = Vec3.fromValues(1, 2, 3); + out = Vec3.fromValues(1, 2, 3); + result = Mat4.getTranslation(out, identity); + }); + + it('should place result both in result and out', () => expect(result).toBe(out)); + it('should return the zero vector', () => expect(result).toBeVec(0, 0, 0)); + }); + + describe('from a translation-only matrix', () => { + beforeEach(() => { + result = new Vec3(1, 2, 3); + out = new Vec3(1, 2, 3); + result = Mat4.getTranslation(out, matB); + }); + + it('should return translation vector', () => expect(out).toBeVec(4, 5, 6)); + }); + + describe('from a translation and rotation matrix', () => { + beforeEach(() => { + let q = new Quat(); + let v = new Vec3(5, 6, 7); + Quat.setAxisAngle(q, [0.26726124, 0.534522474, 0.8017837], 0.55); + Mat4.fromRotationTranslation(out, q, v); + + result = new Vec3(); + Mat4.getTranslation(result, out); + }); + + it('should keep the same translation vector, regardless of rotation', () => expect(result).toBeVec(5, 6, 7)); + }); + }); + + describe('getScaling', () => { + describe('from the identity matrix', () => { + beforeEach(() => { + result = new Vec3(1, 2, 3); + out = new Vec3(1, 2, 3); + result = Mat4.getScaling(out, identity); + }); + + it('should place result both in result and out', () => expect(result).toBe(out)); + it('should return the identity vector', () => expect(result).toBeVec(1, 1, 1)); + }); + + describe('from a scale-only matrix', () => { + beforeEach(() => { + let v = new Vec3(4, 5, 6); + result = new Vec3(1, 2, 3) + out = new Vec3(1, 2, 3); + Mat4.fromScaling(matA, v); + result = Mat4.getScaling(out, matA); + }); + + it('should return translation vector', () => expect(out).toBeVec(4, 5, 6)); + }); + + describe('from a translation and rotation matrix', () => { + beforeEach(() => { + let q = Quat.create(); + let v = Vec3.fromValues(5, 6, 7); + q = Quat.setAxisAngle(q, [1, 0, 0], 0.5) as Quat; + Mat4.fromRotationTranslation(out, q, v); + + result = Vec3.fromValues(1, 2, 3); + Mat4.getScaling(result, out); + }); + + it('should return the identity vector', () => expect(result).toBeVec(1, 1, 1)); + }); + + describe('from a translation, rotation and scale matrix', () => { + beforeEach(() => { + let q = Quat.create(); + let t = Vec3.fromValues(1, 2, 3); + let s = Vec3.fromValues(5, 6, 7); + q = Quat.setAxisAngle(q, [0, 1, 0], 0.7) as Quat; + Mat4.fromRotationTranslationScale(out, q, t, s); + result = Vec3.fromValues(5, 6, 7); + Mat4.getScaling(result, out); + }); + + it('should return the same scaling factor when created', () => expect(result).toBeVec(5, 6, 7)); + }); + }); + + describe('getRotation', () => { + describe('from the identity matrix', () => { + beforeEach(() => { + result = Quat.fromValues(1, 2, 3, 4); + out = Quat.fromValues(1, 2, 3, 4); + result = Mat4.getRotation(out, identity); + }); + + it('should place result both in result and out', () => expect(result).toBe(out)); + it('should return the unit quaternion', () => { + let unitQuat = Quat.create(); + Quat.identity(unitQuat); + expect(result).toBeVec(unitQuat); + }); + }); + + describe('from a translation-only matrix', () => { + beforeEach(() => { + result = Quat.fromValues(1, 2, 3, 4); + out = Quat.fromValues(1, 2, 3, 4); + result = Mat4.getRotation(out, matB); + }); + + it('should return the unit quaternion', () => { + let unitQuat = Quat.create(); + Quat.identity(unitQuat); + expect(result).toBeVec(unitQuat); + }); + }); + + describe('from a translation and rotation matrix', () => { + it('should keep the same rotation as when created', () => { + let q = Quat.create(); + let outVec = Vec3.fromValues(5, 6, 7); + let testVec = Vec3.fromValues(1, 5, 2); + let ang = 0.78972; + + Vec3.normalize(testVec, testVec); + q = Quat.setAxisAngle(q, testVec, ang) as Quat; + Mat4.fromRotationTranslation(out, q, outVec); + + result = Quat.fromValues(2, 3, 4, 6); + Mat4.getRotation(result, out); + let outaxis = Vec3.create(); + let outangle = Quat.getAxisAngle(outaxis, result); + + expect(outaxis).toBeVec(testVec); + expect(outangle).toBeCloseTo(ang); + }); + }); + }); + + describe('frustumNO', () => { + it('should have an alias called `frustum`', () => expect(Mat4.frustumNO).toEqual(Mat4.frustum)); + + beforeEach(() => { result = Mat4.frustumNO(out, -1, 1, -1, 1, -1, 1); }); + + it('should place values into out', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 0, -1, + 0, 0, 1, 0 + )); + it('should return out', () => expect(result).toBe(out)); + + describe('with an Infinite far plane', () => { + beforeEach(() => { result = Mat4.frustumNO(out, -1, 1, -1, 1, -1, Infinity); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, -1, + 0, 0, 2, 0 + )); + }); + }); + + describe('frustumZO', () => { + beforeEach(() => { result = Mat4.frustumZO(out, -1, 1, -1, 1, -1, 1); }); + + it('should place values into out', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -0.5, -1, + 0, 0, 0.5, 0 + )); + it('should return out', () => expect(result).toBe(out)); + + describe('with an Infinite far plane', () => { + beforeEach(() => { result = Mat4.frustumZO(out, -1, 1, -1, 1, -1, Infinity); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, -1, + 0, 0, 1, 0 + )); + }); + }); + + describe('perspectiveNO', () => { + it('should have an alias called `perspective`', () => expect(Mat4.perspectiveNO).toEqual(Mat4.perspective)); + + let fovy = Math.PI * 0.5; + beforeEach(() => { result = Mat4.perspectiveNO(out, fovy, 1, 0, 1); }); + + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, -1, + 0, 0, 0, 0 + )); + it('should return out', () => expect(result).toBe(out)); + + describe('with nonzero near, 45deg fovy, and realistic aspect ratio', () => { + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, 200); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1.001, -1, + 0, 0, -0.2001, 0 + )); + }); + + describe('with no far plane, 45deg fovy, and realistic aspect ratio', () => { + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1, -1, + 0, 0, -0.2, 0 + )); + }); + + describe('with infinite far plane, 45deg fovy, and realistic aspect ratio', () => { + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, Infinity); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1, -1, + 0, 0, -0.2, 0 + )); + }); + }); + + describe('orthoNO', () => { + beforeEach(() => { result = Mat4.orthoNO(out, -1, 1, -1, 1, -1, 1); }); + + it('should have an alias called `ortho`', () => expect(Mat4.orthoNO).toEqual(Mat4.ortho)); + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1 + )); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('lookAt', () => { + let eye = new Float32Array([0, 0, 1]); + let center = new Float32Array([0, 0, -1]); + let up = new Float32Array([0, 1, 0]); + let view, right; + + beforeEach(() => { + eye = new Float32Array([0, 0, 1]); + center = new Float32Array([0, 0, -1]); + up = new Float32Array([0, 1, 0]); + result = Mat4.lookAt(out, eye, center, up); + }); + + describe('looking down', () => { + beforeEach(() => { + view = new Float32Array([0, -1, 0]); + up = new Float32Array([0, 0, -1]); + right= new Float32Array([1, 0, 0]); + result = Mat4.lookAt(out, [0, 0, 0], view, up); + }); + + it('should transform view into local -Z', () => { + result = Vec3.transformMat4(new Float32Array(3), view, out); + expect(result).toBeVec(0, 0, -1); + }); + + it('should transform up into local +Y', () => { + result = Vec3.transformMat4(new Float32Array(3), up, out); + expect(result).toBeVec(0, 1, 0); + }); + + it('should transform right into local +X', () => { + result = Vec3.transformMat4(new Float32Array(3), right, out); + expect(result).toBeVec(1, 0, 0); + }); + + it('should return out', () => expect(result).toBe(out)); + }); + + describe('#74', () => { + beforeEach(() => { + Mat4.lookAt(out, + new Float32Array([0,2,0]), + new Float32Array([0,0.6,0]), + new Float32Array([0,0,-1])); + }); + + it('should transform a point `above` into local +Y', () => { + result = Vec3.transformMat4(new Float32Array(3), [0, 2, -1], out); + expect(result).toBeVec(0, 1, 0); + }); + + it('should transform a point `right of` into local +X', () => { + result = Vec3.transformMat4(new Float32Array(3), [1, 2, 0], out); + expect(result).toBeVec(1, 0, 0); + }); + + it('should transform a point `in front of` into local -Z', () => { + result = Vec3.transformMat4(new Float32Array(3), [0, 1, 0], out); + expect(result).toBeVec(0, 0, -1); + }); + }); + + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, -1, 1 + )); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('targetTo', () => { + let eye = new Float32Array([0, 0, 1]); + let center = new Float32Array([0, 0, -1]); + let up = new Float32Array([0, 1, 0]); + let view: Float32Array, right: Float32Array; + + beforeEach(() => { + eye = new Float32Array([0, 0, 1]); + center = new Float32Array([0, 0, -1]); + up = new Float32Array([0, 1, 0]); + result = Mat4.targetTo(out, eye, center, up); + }); + + describe('looking down', () => { + beforeEach(() => { + view = new Float32Array([0, -1, 0]); + up = new Float32Array([0, 0, -1]); + right= new Float32Array([1, 0, 0]); + result = Mat4.targetTo(out, [0, 0, 0], view, up); + }); + + it('should transform view into local Z', () => { + result = Vec3.transformMat4(new Float32Array(3), view, out); + expect(result).toBeVec(0, 0, 1); + }); + + it('should transform up into local -Y', () => { + result = Vec3.transformMat4(new Float32Array(3), up, out); + expect(result).toBeVec(0, -1, 0); + }); + + it('should transform right into local +X', () => { + result = Vec3.transformMat4(new Float32Array(3), right, out); + expect(result).toBeVec(1, 0, 0); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float32Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + describe('#74', () => { + beforeEach(() => { + Mat4.targetTo(out, + new Float32Array([0,2,0]), + new Float32Array([0,0.6,0]), + new Float32Array([0,0,-1])); + }); + + it('should transform a point `above` into local +Y', () => { + result = Vec3.transformMat4(new Float32Array(3), [0, 2, -1], out); + expect(result).toBeVec(0, 1, -2); + }); + + it('should transform a point `right of` into local +X', () => { + result = Vec3.transformMat4(new Float32Array(3), [1, 2, 0], out); + expect(result).toBeVec(1, 2, -2); + }); + + it('should transform a point `in front of` into local -Z', () => { + result = Vec3.transformMat4(new Float32Array(3), [0, 1, 0], out); + expect(result).toBeVec(0, 2, -1); + }); + + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float32Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + describe('scaling test', () => { + beforeEach(() => { + Mat4.targetTo(out, + new Float32Array([0,1,0]), + new Float32Array([0,0,1]), + new Float32Array([0,0,-1])); + }); + + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float32Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float32Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat4.str(matA); }); + + it('should return a string representation of the matrix', + () => expect(result).toEqual('Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat4.frob(matA); }); + + it('should return the Frobenius Norm of the matrix', () => expect(result).toBeCloseTo( Math.sqrt(Math.pow(1, 2) + + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) ))); + }); + + describe('add', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.add(out, matA, matB); }); + + it('should place values into out', + () => expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.add(matA, matA, matB); }); + + it('should place values into matA', + () => expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.add(matB, matA, matB); }); + + it('should place values into matB', + () => expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + }); + + describe('subtract', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + + it('should have an alias called `sub`', () => expect(Mat4.sub).toEqual(Mat4.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.subtract(out, matA, matB); }); + + it('should place values into out', + () => expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.subtract(matA, matA, matB); }); + + it('should place values into matA', + () => expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.subtract(matB, matA, matB); }); + + it('should place values into matB', + () => expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); + + it('should return a 16 element array initialized to the values passed', + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat4.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); + + it('should place values into out', + () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + beforeEach(() => { matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalar(out, matA, 2); }); + + it('should place values into out', + () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', + () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', + () => expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', + () => expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', + () => expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + r0 = Mat4.exactEquals(matA, matB); + r1 = Mat4.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + r0 = Mat4.equals(matA, matB); + r1 = Mat4.equals(matA, matC); + r2 = Mat4.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + }); + }); +}); diff --git a/tests/f32/Quat.spec.ts b/tests/f32/Quat.spec.ts new file mode 100644 index 00000000..5b1b4b61 --- /dev/null +++ b/tests/f32/Quat.spec.ts @@ -0,0 +1,750 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Quat, Vec3 } from '#gl-matrix'; + +import type { Vec3Like, QuatLike } from '#gl-matrix/types'; + +describe('Quat', () => { + describe('constructor', () => { + it('should return Quat(0, 0, 0, 1) if called with no arguments', () => expect(new Quat()).toBeVec(0, 0, 0, 1)); + + it('should return Quat(x, y, z, w) if called with (x, y, z, w)', () => { + expect(new Quat(1, 2, 3, 4)).toBeVec(1, 2, 3, 4); + expect(new Quat(-3, 4.4, -5.6, 7.8)).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Quat(x, x, x, x) if called with (x)', () => { + expect(new Quat(1)).toBeVec(1, 1, 1, 1); + expect(new Quat(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3); + }); + + it('should return Quat(x, y, z, w) if called with ([x, y, z, w])', () => { + expect(new Quat([1, 2, 3, 4])).toBeVec(1, 2, 3, 4); + expect(new Quat([-3, 4.4, -5.6, 7.8])).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Quat(x, y, z, w) if called with (Quat(x, y, z, w))', () => { + let v = new Quat(3.4, 5.6, 7.8, 9); + expect(new Quat(v)).toBeVec(v); + }); + + it('should return Quat(x, y, z, w) if called with (Float32Array([x, y, z, w]))', () => { + let arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); + expect(new Quat(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Quat + let quatA: QuatLike; + let quatB: QuatLike; + let result: any; + let vec: Vec3Like; + + const id = new Quat(0, 0, 0, 1); + const deg90 = Math.PI / 2; + + beforeEach(() => { + quatA = new Quat(1, 2, 3, 4); + quatB = new Quat(5, 6, 7, 8); + out = new Quat(0, 0, 0, 0); + vec = [1, 1, -1]; + }); + + describe('slerp', () => { + describe('the normal case', () => { + beforeEach(() => { result = Quat.slerp(out, [0, 0, 0, 1], [0, 1, 0, 0], 0.5); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quat', () => expect(result).toBeVec(0, 0.707106, 0, 0.707106)); + }); + + describe('where a == b', () => { + beforeEach(() => { result = Quat.slerp(out, [0, 0, 0, 1], [0, 0, 0, 1], 0.5); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quat', () => expect(result).toBeVec(0, 0, 0, 1)); + }); + + describe('where theta == 180deg', () => { + beforeEach(() => { + Quat.rotateX(quatA, [1,0,0,0], Math.PI); // 180 deg + result = Quat.slerp(out, [1,0,0,0], quatA, 1); + }); + + it('should calculate proper quat', () => expect(result).toBeVec(0,0,0,-1)); + }); + + describe('where a == -b', () => { + beforeEach(() => { result = Quat.slerp(out, [1, 0, 0, 0], [-1, 0, 0, 0], 0.5); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quat', () => expect(result).toBeVec(1, 0, 0, 0)); + }); + }); + + describe('pow', () => { + describe('identity quat', () => { + beforeEach(() => { result = Quat.pow(out, id, 2.1 /* random number */); }); + + it('should return out', () => expect(result).toBe(out)); + it('should be the identity', () => expect(result).toBeVec(id)); + }); + + describe('power of one', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + result = Quat.pow(out, quatA, 1); + }); + + it('should be the identity', () => expect(result).toBeVec(quatA)); + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + + describe('squared', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + result = Quat.pow(out, quatA, 2); + }); + + it('should be the square', () => { + let reference = Quat.multiply(Quat.create(), quatA, quatA); + expect(result).toBeVec(reference); + }); + + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + + describe('conjugate', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + result = Quat.pow(out, quatA, -1); + }); + + it('should be the conjugate', () => { + let reference = Quat.conjugate(Quat.create(), quatA); + expect(result).toBeVec(reference); + }); + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + + describe('reversible', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + let b = 2.1; // random number + result = Quat.pow(out, quatA, b); + result = Quat.pow(out, result, 1/b); + }); + + it('should be reverted', () => expect(result).toBeVec(quatA)); + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + }); + + describe('rotateX', () => { + beforeEach(() => { result = Quat.rotateX(out, id, deg90); }); + + it('should return out', () => expect(result).toBe(out)); + it('should transform vec accordingly', () => { + Vec3.transformQuat(vec, [0,0,-1], out); + expect(vec).toBeVec(0, 1, 0); + }); + }); + + describe('rotateY', () => { + beforeEach(() => { result = Quat.rotateY(out, id, deg90); }); + + it('should return out', () => expect(result).toBe(out)); + it('should transform vec accordingly', () => { + Vec3.transformQuat(vec, [0,0,-1], out); + expect(vec).toBeVec(-1, 0, 0); + }); + }); + + describe('rotateZ', () => { + beforeEach(() => { result = Quat.rotateZ(out, id, deg90); }); + + it('should return out', () => expect(result).toBe(out)); + it('should transform vec accordingly', () => { + Vec3.transformQuat(vec, [0,1,0], out); + expect(vec).toBeVec(-1, 0, 0); + }); + }); + + /*describe('fromMat3', () => { + let matr; + + describe('legacy', () => { + beforeEach(() => { + matr = [ 1, 0, 0, + 0, 0, -1, + 0, 1, 0 ]; + result = Quat.fromMat3(out, matr); + }); + + it('should set dest to the correct value', () => expect(result).toBeVec(-0.707106, 0, 0, 0.707106)); + }); + + describe('where trace > 0', () => { + beforeEach(() => { + matr = [ 1, 0, 0, + 0, 0, -1, + 0, 1, 0 ]; + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the correct transformation', + () => expect(Vec3.transformQuat([], [0,1,0], out)).toBeVec(0,0,-1)); + }); + + describe('from a normal matrix looking `backward`', () => { + beforeEach(() => { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt( + mat4.create(), [0, 0, 0], [0, 0, 1], [0, 1, 0])))); + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the same transformation as the given matrix', () => expect(Vec3.transformQuat([], [3,2,-1], + Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr))); + }); + + describe('from a normal matrix looking `left` and `upside down`', () => { + beforeEach(() => { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt( + mat4.create(), [0, 0, 0], [-1, 0, 0], [0, -1, 0])))); + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the same transformation as the given matrix', () => expect(Vec3.transformQuat([], [3,2,-1], + Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr))); + }); + + describe('from a normal matrix looking `upside down`', () => { + beforeEach(() => { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt( + mat4.create(), [0, 0, 0], [0, 0, -1], [0, -1, 0])))); + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the same transformation as the given matrix', () => expect(Vec3.transformQuat([], [3,2,-1], + Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr))); + }); + });*/ + + describe('fromEuler', () => { + describe('legacy', () => { + beforeEach(() => { result = Quat.fromEuler(out, -90, 0, 0); }); + + it('should set dest to the correct value', () => expect(result).toBeVec(-0.707106, 0, 0, 0.707106)); + }); + + describe('where trace > 0', () => { + beforeEach(() => { result = Quat.fromEuler(out, -90, 0, 0); }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the correct transformation', + () => expect(Vec3.transformQuat([0, 0, 0], [0,1,0], out)).toBeVec(0,0,-1)); + }); + }); + + /*describe('setAxes', () => { + let r; + beforeEach(() => { r = Vec3.create(); }); + + describe('looking left', () => { + let view, up, right; + + beforeEach(() => { + view = [-1, 0, 0]; + up = [ 0, 1, 0]; + right= [ 0, 0,-1]; + result = Quat.setAxes([], view, right, up); + }); + + it('should transform local view into world left', () => { + r = Vec3.transformQuat([], [0,0,-1], result); + expect(r).toBeVec(1, 0, 0); + }); + + it('should transform local right into world front', () => { + r = Vec3.transformQuat([], [1,0,0], result); + expect(r).toBeVec(0, 0, 1); + }); + }); + + describe('given opengl defaults', () => { + let view, up, right; + + beforeEach(() => { + view = [0, 0, -1]; + up = [0, 1, 0]; + right= [1, 0, 0]; + result = Quat.setAxes(out, view, right, up); + }); + + it('should return out', () => expect(result).toBe(out)); + it('should produce identity', () => expect(out).toBeVec(0, 0, 0, 1)); + }); + + describe('legacy example', () => { + let view, up, right; + + beforeEach(() => { + right= [1, 0, 0]; + up = [0, 0, 1]; + view = [0, -1, 0]; + result = Quat.setAxes(out, view, right, up); + }); + + it('should set correct quat4 values', () => expect(result).toBeVec(0.707106, 0, 0, 0.707106)); + }); + });*/ + + describe('rotationTo', () => { + let r; + + beforeEach(() => { r = Vec3.create(); }); + + describe('at right angle', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 1, 0], [1, 0, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quaternion', () => expect(out).toBeVec(0, 0, -0.707106, 0.707106)); + }); + + describe('when vectors are parallel', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 1, 0], [0, 1, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [0, 1, 0], out)).toBeVec(0, 1, 0)); + }); + + describe('when vectors are opposed X', () => { + beforeEach(() => { result = Quat.rotationTo(out, [1, 0, 0], [-1, 0, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [1, 0, 0], out)).toBeVec(-1, 0, 0)); + }); + + describe('when vectors are opposed Y', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 1, 0], [0, -1, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [0, 1, 0], out)).toBeVec(0, -1, 0)); + }); + + describe('when vectors are opposed Z', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 0, 1], [0, 0, -1]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [0, 0, 1], out)).toBeVec(0, 0, -1)); + }); + }); + + describe('create', () => { + beforeEach(() => { result = Quat.create(); }); + + it('should return a 4 element array initialized to an identity quaternion', + () => expect(result).toBeVec(0, 0, 0, 1)); + }); + + describe('clone', () => { + beforeEach(() => { result = Quat.clone(quatA); }); + + it('should return a 4 element array initialized to the values in quatA', () => expect(result).toBeVec(quatA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Quat.fromValues(1, 2, 3, 4); }); + + it('should return a 4 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3, 4)); + }); + + describe('copy', () => { + beforeEach(() => { result = Quat.copy(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Quat.set(out, 1, 2, 3, 4); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Quat.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(0, 0, 0, 1)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('setAxisAngle', () => { + beforeEach(() => { result = Quat.setAxisAngle(out, [1, 0, 0], Math.PI * 0.5); }); + + it('should place values into out', () => expect(result).toBeVec(0.707106, 0, 0, 0.707106)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('getAxisAngle', () => { + let angle: number; + + describe('for a quaternion representing no rotation', () => { + beforeEach(() => { result = Quat.setAxisAngle(out, [0, 1, 0], 0.0); angle = Quat.getAxisAngle(vec, out); }); + + it('should return a multiple of 2*PI as the angle component', + () => expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0)); + }); + + describe('for a simple rotation about X axis', () => { + beforeEach(() => { result = Quat.setAxisAngle(out, [1, 0, 0], 0.7778); angle = Quat.getAxisAngle(vec, out); }); + + it('should return the same provided angle', () => expect(angle).toBeCloseTo(0.7778)); + it('should return the X axis as the angle', () => expect(vec).toBeVec(1, 0, 0)); + }); + + describe('for a simple rotation about Y axis', () => { + beforeEach(() => { + result = Quat.setAxisAngle(out, [0, 1, 0], 0.879546); + angle = Quat.getAxisAngle(vec, out); + }); + + it('should return the same provided angle', () => expect(angle).toBeCloseTo(0.879546)); + it('should return the X axis as the angle', () => expect(vec).toBeVec(0, 1, 0)); + }); + + describe('for a simple rotation about Z axis', () => { + beforeEach(() => { + result = Quat.setAxisAngle(out, [0, 0, 1], 0.123456); + angle = Quat.getAxisAngle(vec, out); + }); + + it('should return the same provided angle', () => expect(angle).toBeCloseTo(0.123456)); + it('should return the X axis as the angle', () => expect(vec).toBeVec(0, 0, 1)); + }); + + describe('for a slightly irregular axis and right angle', () => { + beforeEach(() => { + result = Quat.setAxisAngle(out, [0.707106, 0, 0.707106], Math.PI * 0.5); + angle = Quat.getAxisAngle(vec, out); + }); + + it('should place values into vec', () => expect(vec).toBeVec(0.707106, 0, 0.707106)); + it('should return a numeric angle', () => expect(angle).toBeCloseTo(Math.PI * 0.5)); + }); + + describe('for a very irregular axis and negative input angle', () => { + beforeEach(() => { + quatA = Quat.setAxisAngle(quatA, [0.65538555, 0.49153915, 0.57346237], 8.8888) as Quat; + angle = Quat.getAxisAngle(vec, quatA); + quatB = Quat.setAxisAngle(quatB, vec, angle) as Quat; + }); + + it('should return an angle between 0 and 2*PI', () => { + expect(angle).toBeGreaterThan(0.0); + expect(angle).toBeLessThan(Math.PI * 2.0); + }); + it('should create the same quaternion from axis and angle extracted', () => expect(quatA).toBeVec(quatB)); + }); + }); + + describe('getAngle', () => { + describe('from itself', () => { + beforeEach(() => { Quat.normalize(quatA, quatA); }); + + it('should be zero', () => expect(Quat.getAngle(quatA, quatA)).toBeCloseTo(0)); + }); + + describe('from rotated', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + Quat.rotateX(quatB, quatA, Math.PI / 4); + }); + + it('should be 45 degrees', () => expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(Math.PI / 4)); + }); + + describe('compare with axisAngle', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + Quat.normalize(quatB, quatB); + }); + + it('should be equalish', () => { + // compute reference value as axisAngle of quatA^{-1} * quatB + let quatAInv = Quat.conjugate(Quat.create(), quatA); + let quatAB = Quat.multiply(quatAInv, quatAInv, quatB); + let dummy = Vec3.create(); + let reference = Quat.getAxisAngle(dummy, quatAB); + + expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(reference); + }); + }); + }); + + describe('add', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.add(out, quatA, quatB); }); + + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.add(quatA, quatA, quatB); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(6, 8, 10, 12)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.add(quatB, quatA, quatB); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(6, 8, 10, 12)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Quat.mul).toEqual(Quat.multiply)); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.multiply(out, quatA, quatB); }); + + it('should place values into out', () => expect(out).toBeVec(24, 48, 48, -6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.multiply(quatA, quatA, quatB); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(24, 48, 48, -6)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.multiply(quatB, quatA, quatB); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(24, 48, 48, -6)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('scale', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.scale(out, quatA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.scale(quatA, quatA, 2); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(2, 4, 6, 8)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('length', () => { + beforeEach(() => { result = Quat.len(quatA); }); + + it('should have an alias called `len`', () => expect(Quat.len).toEqual(Quat.length)); + it('should return the length', () => expect(result).toBeCloseTo(5.477225)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Quat.squaredLength(quatA); }); + + it('should have an alias called `sqrLen``', () => expect(Quat.sqrLen).toEqual(Quat.squaredLength)); + it('should return the squared length', () => expect(result).toEqual(30)); + }); + + describe('normalize', () => { + beforeEach(() => { quatA = [5, 0, 0, 0]; }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.normalize(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(5, 0, 0, 0)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.normalize(quatA, quatA); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(1, 0, 0, 0)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('lerp', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.lerp(out, quatA, quatB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.lerp(quatA, quatA, quatB, 0.5); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(3, 4, 5, 6)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.lerp(quatB, quatA, quatB, 0.5); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(3, 4, 5, 6)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('slerp', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.slerp(out, quatA, quatB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.slerp(quatA, quatA, quatB, 0.5); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(3, 4, 5, 6)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.slerp(quatB, quatA, quatB, 0.5); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(3, 4, 5, 6)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + /*describe('random', () => { + beforeEach(() => { result = Quat.random(out); }); + + it('should result in a normalized quaternion', () => { + let copy = Quat.clone(out); + expect(Quat.normalize(out, out)).toBeVec(copy); + }); + it('should return out', () => expect(result).toBe(out)); + });*/ + + describe('invert', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.invert(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(-0.033333, -0.066666, -0.1, 0.133333)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.invert(quatA, quatA); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(-0.033333, -0.066666, -0.1, 0.133333)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('conjugate', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.conjugate(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2, -3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.conjugate(quatA, quatA); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(-1, -2, -3, 4)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Quat.str(quatA); }); + + it('should return a string representation of the quaternion', () => expect(result).toEqual('Quat(1, 2, 3, 4)')); + }); + + describe('exactEquals', () => { + let quatC, r0, r1; + + beforeEach(() => { + quatA = [0, 1, 2, 3]; + quatB = [0, 1, 2, 3]; + quatC = [1, 2, 3, 4]; + r0 = Quat.exactEquals(quatA, quatB); + r1 = Quat.exactEquals(quatA, quatC); + }); + + it('should return true for identical quaternions', () => expect(r0).toBe(true)); + it('should return false for different quaternions', () => expect(r1).toBe(false)); + it('should not modify quatA', () => expect(quatA).toBeVec(0, 1, 2, 3)); + it('should not modify quatB', () => expect(quatB).toBeVec(0, 1, 2, 3)); + }); + + describe('equals', () => { + let quatC, quatD, r0, r1, r2; + + beforeEach(() => { + quatA = [0, 1, 2, 3]; + quatB = [0, 1, 2, 3]; + quatC = [1, 2, 3, 4]; + quatD = [1e-16, 1, 2, 3]; + r0 = Quat.equals(quatA, quatB); + r1 = Quat.equals(quatA, quatC); + r2 = Quat.equals(quatA, quatD); + }); + + it('should return true for identical quaternions', () => expect(r0).toBe(true)); + it('should return false for different quaternions', () => expect(r1).toBe(false)); + it('should return true for close but not identical quaternions', () => expect(r2).toBe(true)); + it('should not modify quatA', () => expect(quatA).toBeVec(0, 1, 2, 3)); + it('should not modify quatB', () => expect(quatB).toBeVec(0, 1, 2, 3)); + }); + }); +}); diff --git a/tests/f32/Quat2.spec.ts b/tests/f32/Quat2.spec.ts new file mode 100644 index 00000000..824a1c94 --- /dev/null +++ b/tests/f32/Quat2.spec.ts @@ -0,0 +1,787 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat4, Quat, Quat2, Vec3 } from '#gl-matrix'; + +import type { QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; + +describe('Quat2', () => { + describe('constructor', () => { + it('should return Quat2(0, 0, 0, 1, 0, 0, 0, 0) if called with no arguments', () => { + expect(new Quat2()).toBeVec(0, 0, 0, 1, 0, 0, 0, 0); + }); + + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (x, y, z, w, x2, y2, z2, w2)', () => { + expect(new Quat2(1, 2, 3, 4, 5, 6, 7, 8)).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); + expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + }); + + it('should return Quat(x, x, x, x, x, x, x, x) if called with (x)', () => { + expect(new Quat2(1)).toBeVec(1, 1, 1, 1, 1, 1, 1, 1); + expect(new Quat2(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3, -2.3, -2.3, -2.3, -2.3); + }); + + it('should return Quat(x, y, z, w) if called with ([x, y, z, w])', () => { + expect(new Quat2([1, 2, 3, 4, 5, 6, 7, 8])).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); + expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + }); + + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Quat(x, y, z, w, x2, y2, z2, w2))', () => { + let v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); + expect(new Quat2(v)).toBeVec(v); + }); + + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float32Array([x, y, z, w, x2, y2, z2, w2]))', () => { + let arr = new Float32Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); + expect(new Quat2(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Quat2; + let outVec: Vec3; + let quat2A: Quat2Like; + let quat2B: Quat2Like; + let result: any; + let resultVec: Vec3Like; + let outQuat: QuatLike; + let vec: Vec3Like; + + beforeEach(() => { + quat2A = new Quat2(1, 2, 3, 4, 2, 5, 6, -2); + quat2B = new Quat2(5, 6, 7, 8, 9, 8, 6, -4); + out = new Quat2(); + outVec = new Vec3(); + outQuat = new Quat(); + vec = new Vec3(1, 1, -1); + }); + + describe('translate', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.translate(out, quat2A, vec); + //Same thing with a matrix + Mat4.translate(matOut, matrixA, vec); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + it('should not modify vec', () => expect(vec).toBeVec(1,1,-1)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.translate(quat2A, quat2A, vec); + //Same thing with a matrix + Mat4.translate(matOut, matrixA, vec); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('rotateAroundAxis', () => { + let matrixA = new Mat4(); + let matOut = new Mat4(); + let ax: Vec3Like = [1,4,2]; + + beforeEach(() => { + //quat2A only seems to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateAroundAxis(out, quat2A, ax, 5); + + //Same thing with a matrix + Mat4.rotate(matOut, matrixA, 5, ax); + Quat2.fromMat4(quat2B, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quat2B)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2( + 0.18257418583505536, 0.3651483716701107, 0.5477225575051661, 0.7302967433402214, + -2.556038601690775, 3.742770809618635, 2.37346441585572, -3.0124740662784135 + )); + it('should not modify ax', () => expect(ax).toBeVec(1, 4, 2)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateAroundAxis(quat2A, quat2A, ax, 5); + //Same thing with a matrix + + Mat4.rotate(matOut, matrixA, 5, ax); + Quat2.fromMat4(quat2B, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify ax', () => expect(ax).toBeVec(1, 4, 2)); + }); + }); + + describe('rotateByQuatAppend', () => { + let correctResult = Quat2.create(); + let rotationQuat = Quat2.create(); + + beforeEach(() => { + rotationQuat[0] = 2; + rotationQuat[1] = 5; + rotationQuat[2] = 2; + rotationQuat[3] = -10; + Quat2.multiply(correctResult, quat2A, rotationQuat); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatAppend(out, quat2A, [2, 5, 2, -10]); }); + + it('should place values into out', () => expect(out).toBeQuat2(correctResult)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatAppend(quat2A, quat2A, [2, 5, 2, -10]); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + }); + + describe('rotateByQuatPrepend', () => { + let correctResult = Quat2.create(); + let rotationQuat = Quat2.create(); + + beforeEach(() => { + rotationQuat[0] = 2; + rotationQuat[1] = 5; + rotationQuat[2] = 2; + rotationQuat[3] = -10; + Quat2.multiply(correctResult, rotationQuat, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatPrepend(out, Quat2.getReal(outQuat, rotationQuat), quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(correctResult)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatPrepend(quat2A, Quat2.getReal(outQuat, rotationQuat), quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + }); + + describe('rotateX', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]) as Quat2; + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateX(out, quat2A, 5); + //Same thing with a matrix + Mat4.rotateX(matOut, matrixA, 5); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateX(quat2A, quat2A, 5); + //Same thing with a matrix + Mat4.rotateX(matOut, matrixA, 5); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('rotateY', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [5, 4, -10]) as Quat2; + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateY(out, quat2A, -2); + //Same thing with a matrix + Mat4.rotateY(matOut, matrixA, -2); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateY(quat2A, quat2A, -2); + //Same thing with a matrix + Mat4.rotateY(matOut, matrixA, -2); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('rotateZ', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,0,3,-4], [0, -4, -10]) as Quat2; + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateZ(out, quat2A, 1); + //Same thing with a matrix + Mat4.rotateZ(matOut, matrixA, 1); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateZ(quat2A, quat2A, 1); + //Same thing with a matrix + Mat4.rotateZ(matOut, matrixA, 1); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('from/toMat4', () => { + let matRes = Mat4.create(), matOut = Mat4.create(); + let rotationQuat = Quat.create(); + + describe('quat to matrix and back', () => { + beforeEach(() => { + Quat.normalize(rotationQuat, [1,2,3,4]); + + Quat2.fromRotationTranslation(quat2A, rotationQuat, [1,-5,3]); + matRes = Mat4.fromQuat2(matOut, quat2A) as Mat4; + + result = Quat2.fromMat4(out, matRes); + }); + + it('should return out', () => expect(result).toBe(out)); + it('should return matOut', () => expect(matRes).toBe(matOut)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(0.18257418, 0.36514836, 0.54772257, 0.73029673, + -1.5518806, -1.82574184, 1.73445473, 0 )); + it('should be equal to the starting dual quat', () => expect(quat2A).toBeQuat2(result)); + }); + }); + + describe('create', () => { + beforeEach(() => { result = Quat2.create(); }); + + it('should return 2 4 element arrays initialized to an identity dual quaternion', + () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Quat2.clone(quat2A); }); + + it('should return 2 4 element arrays initialized to the values in quat2A', + () => expect(result).toBeQuat2(quat2A)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Quat2.fromValues(1, 2, 3, 4, 5, 7, 8, -2); }); + + it('should return 2 4 element arrays initialized to the values passedd to the values passed', + () => expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2)); + }); + + describe('copy', () => { + beforeEach(() => { result = Quat2.copy(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Quat2.set(out, 1, 2, 3, 4, 2, 5, 6, -2); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Quat2.identity(out); }); + + it('should place values into out', () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.add(out, quat2A, quat2B); }); + + it('should place values into out', () => expect(out).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2A is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.add(quat2A, quat2A, quat2B); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2B is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.add(quat2B, quat2A, quat2B); }); + + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6)); + it('should return quat2B', () => expect(result).toBe(quat2B)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Quat2.mul).toEqual(Quat2.multiply)); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.multiply(out, quat2A, quat2B); }); + + it('should place values into out', () => expect(out).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.multiply(quat2A, quat2A, quat2B); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157 )); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2B is the output quaternion', () => { + beforeEach(() => { result = Quat2.multiply(quat2B, quat2A, quat2B); }); + + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157)); + it('should return quat2B', () => expect(result).toBe(quat2B)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('same as matrix multiplication', () => { + let matrixA = Mat4.create(), matrixB = Mat4.create(); + let matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A and quat2B only seem to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + + Quat2.fromRotationTranslation(quat2B, [5, 6, 7, 8], [9, 8, 6]); + Quat2.normalize(quat2B, quat2B); + Mat4.fromQuat2(matrixB, quat2B); + }); + + it('the matrices should be equal to the dual quaternions', () => { + let testQuat = Quat2.create(); + Quat2.fromMat4(testQuat, matrixA); + expect(testQuat).toBeQuat2(...quat2A); + + Quat2.fromMat4(testQuat, matrixB); + expect(testQuat).toBeQuat2(...quat2B); + }); + + it('should be equal to the matrix multiplication', () => { + Quat2.multiply(out, quat2A, quat2B); + Mat4.mul(matOut, matrixA, matrixB); + Quat2.fromMat4(quatOut, matOut); + expect(out).toBeQuat2(quatOut); + }); + }); + }); + + describe('scale', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.scale(out, quat2A, 2); }); + + it('should place values into out', () => expect(out).toBeQuat2(2, 4, 6, 8, 4, 10, 12, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('when quat2A is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.scale(quat2A, quat2A, 2); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(2, 4, 6, 8, 4, 10, 12, -4)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('length', () => { + beforeEach(() => { result = Quat2.length(quat2A); }); + + it('should have an alias called `len`', () => expect(Quat2.len).toEqual(Quat2.length)); + it('should return the length', () => expect(result).toBeCloseTo(5.477225)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Quat2.squaredLength(quat2A); }); + + it('should have an alias called `sqrLen`', () => expect(Quat2.sqrLen).toEqual(Quat2.squaredLength)); + it('should return the squared length', () => expect(result).toBeCloseTo(30)); + }); + + describe('fromRotation', () => { + beforeEach(() => { result = Quat2.fromRotation(out, [1, 2, 3, 4]); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 0, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify the quaternion', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('fromTranslation', () => { + beforeEach(() => { vec = [1, 2, 3]; result = Quat2.fromTranslation(out, vec); }); + + it('should place values into out', () => expect(out).toBeQuat2(0, 0, 0, 1, 0.5, 1, 1.5, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify the vector', () => expect(vec).toBeVec(1, 2, 3)); + }); + + describe('fromRotationTranslation', () => { + beforeEach(() => { + vec = [1, 2, 3]; + result = Quat2.fromRotationTranslation(out, [1, 2, 3, 4], vec); + }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify the quaternion', () => expect(Quat2.getReal(outQuat, quat2A)).toBeVec(1, 2, 3, 4)); + it('should not modify the vector', () => expect(vec).toBeVec(1, 2, 3)); + it('should have a translation that can be retrieved with getTranslation', () => { + let t: Vec3Like = [0, 0, 0]; + Quat2.normalize(out, out); + Quat2.getTranslation(t, out); + + expect(t).toBeVec(1, 2, 3); + }); + }); + + describe('fromRotationTranslationValues', () => { + beforeEach(() => { result = Quat2.fromRotationTranslationValues(1,2,3,4, 1,2,3); }); + + it('should return the correct result', () => expect(result).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7)); + it('should have a translation that can be retrieved with getTranslation', () => { + let t: Vec3Like = [0, 0, 0]; + + Quat2.normalize(result, result); + Quat2.getTranslation(t, result); + expect(t).toBeVec(1, 2, 3); + }); + }); + + describe('getTranslation', () => { + describe('without a real part', () => { + beforeEach(() => { + Quat2.fromTranslation(out, [1,2,3]); + resultVec = Quat2.getTranslation(outVec, out); + }); + + describe('not normalized', () => { + it('should return the same translation value', () => expect(outVec).toBeVec(1, 2, 3)); + it('should return out', () => expect(outVec).toBe(resultVec)); + }); + + describe('normalized', () => { + it('should return the same translation value', () => { + Quat2.normalize(outVec, outVec); + expect(outVec).toBeVec(1, 2, 3); + }); + }); + }); + + describe('with a real part', () => { + beforeEach(() => { + Quat2.fromRotationTranslation(out, [2, 4, 6, 2], [1, 2, 3]); + resultVec = Quat2.getTranslation(outVec, out); + }); + + describe('not normalized', () => { + it('should not return the same translation value', () => expect(outVec).not.toBeVec(1, 2, 3)); + it('should return out', () => expect(outVec).toBe(resultVec)); + }); + + describe('normalized', () => { + it('should return the same translation value', () => { + Quat2.normalize(out, out); + Quat2.getTranslation(outVec, out); + expect(outVec).toBeVec(1, 2, 3); + }); + }); + }); + }); + + describe('normalize', () => { + describe('when it is normalizing quat2A', () => { + beforeEach(() => { + quat2A = [1, 2, 3, 4, 2, 5, 6, -2]; + Quat2.normalize(out, quat2A); + }); + + it('both parts should have been normalized', () => expect(out).toBeQuat2(1/5.4772255, 2/5.4772255, + 3/5.4772255, 4/5.4772255, 0.231260, 0.6450954, 0.693781,-0.9006993)); + }); + + beforeEach(() => { quat2A = [5, 0, 0, 0, 0, 0, 0, 0]; }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.normalize(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 0, 0, 0, 0, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(5, 0, 0, 0, 0, 0, 0, 0)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.normalize(quat2A, quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(1, 0, 0, 0, 0, 0, 0, 0)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + + describe('when it contains a translation', () => { + beforeEach(() => { + Quat2.set(out, 5, 0, 0, 0, 1, 2, 3, 5); + Quat2.normalize(out, out); + }); + + it('both parts should have been normalized', () => expect(out).toBeQuat2(1, 0, 0, 0, 0, 0.4, 0.6, 1)); + }); + }); + + describe('lerp', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.lerp(out, quat2A, quat2B, 0.7); }); + + it('should place values into out', () => expect(out).toBeQuat2(3.8, 4.8, 5.8, 6.8, 6.9, 7.1, 6.0, -3.4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.lerp(quat2A, quat2A, quat2B, 0.5); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2B is the output quaternion', () => { + beforeEach(() => { result = Quat2.lerp(quat2B, quat2A, quat2B, 0.5); }); + + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should return quat2B', () => expect(result).toBe(quat2B)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('shortest path', () => { + beforeEach(() => { result = Quat2.lerp(out, [1, 2, 3, -4, 2, 5, 6, -2], [5, -6, 7, 8, 9, 8, 6, -4], 0.4); }); + + it('should pick the shorter path', () => expect(out).toBeQuat2( -1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4 )); + }); + }); + + describe('dot', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.dot(quat2A, quat2B); }); + + it('should return the dot product', () => expect(result).toBe(70)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + }); + + describe('invert', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.invert(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2( + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('the real part should be equal to a inverted quaternion', () => { + Quat.invert(outQuat, [1, 2, 3, 4]); + expect(Quat2.getReal(outQuat, out)).toBeVec(...outQuat); + }); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.invert(quat2A, quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeVec( + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('get real/dual', () => { + describe('get real', () => { + beforeEach(() => { result = Quat2.getReal(outQuat, quat2A); }); + + it('should place values into out', () => expect(outQuat).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(outQuat)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('get dual', () => { + beforeEach(() => { result = Quat2.getDual(outQuat, quat2A); }); + + it('should place values into out', () => expect(outQuat).toBeVec(2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(outQuat)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + }); + + describe('set real/dual', () => { + describe('set real', () => { + beforeEach(() => { + outQuat = [4, 6, 8, -100]; + result = Quat2.setReal(quat2A, outQuat); + }); + + it('should place values into out', () => expect(quat2A).toBeQuat2(4, 6, 8, -100, 2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(quat2A)); + it('should not modify outQuat', () => expect(outQuat).toBeVec(4, 6, 8, -100)); + }); + + describe('set dual', () => { + beforeEach(() => { + outQuat = [4.3, 6, 8, -100]; + result = Quat2.setDual(quat2A, outQuat); + }); + + it('should place values into out', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 4.3, 6, 8, -100)); + it('should return out', () => expect(result).toBe(quat2A)); + it('should not modify outQuat', () => expect(outQuat).toBeVec(4.3, 6, 8, -100)); + }); + }); + + describe('conjugate', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.conjugate(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(-1, -2, -3, 4, -2, -5, -6, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('when quat2A is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.conjugate(quat2A, quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(-1, -2, -3, 4, -2, -5, -6, -2)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Quat2.str(quat2A); }); + + it('should return a string representation of the quaternion', + () => expect(result).toEqual('Quat2(1, 2, 3, 4, 2, 5, 6, -2)')); + }); + + describe('exactEquals', () => { + let quat2C, r0, r1; + + beforeEach(() => { + quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2B = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2C = [1, 2, 3, 4, 5, 6, 7, 8]; + r0 = Quat2.exactEquals(quat2A, quat2B); + r1 = Quat2.exactEquals(quat2A, quat2C); + }); + + it('should return true for identical quaternions', () => expect(r0).toBe(true)); + it('should return false for different quaternions', () => expect(r1).toBe(false)); + it('should not modify quat2A', () => expect(quat2A).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + it('should not modify quat2B', () => expect(quat2B).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + }); + + describe('equals', () => { + let quat2C, quat2D, r0, r1, r2; + + beforeEach(() => { + quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2B = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2C = [1, 2, 3, 4, 5, 6, 7, 8]; + quat2D = [1e-16, 1, 2, 3, 4, 5, 6, 7]; + r0 = Quat2.equals(quat2A, quat2B); + r1 = Quat2.equals(quat2A, quat2C); + r2 = Quat2.equals(quat2A, quat2D); + }); + + it('should return true for identical dual quaternions', () => expect(r0).toBe(true)); + it('should return false for different dual quaternions', () => expect(r1).toBe(false)); + it('should return true for close but not identical quaternions', () => expect(r2).toBe(true)); + it('should not modify quat2A', () => expect(quat2A).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + it('should not modify quat2B', () => expect(quat2B).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + }); + }); +}); diff --git a/tests/f32/Vec2-swizzle.spec.ts b/tests/f32/Vec2-swizzle.spec.ts new file mode 100644 index 00000000..bdcbcf57 --- /dev/null +++ b/tests/f32/Vec2-swizzle.spec.ts @@ -0,0 +1,521 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec2 } from '#gl-matrix'; +import { EnableSwizzles } from '#gl-matrix/swizzle'; + +describe('Vec2 Swizzles', () => { + EnableSwizzles(); + + let v: Vec2; + beforeEach(() => { v = new Vec2(1, 2); }); + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + describe('Vec2().xx', () => { + it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xy', () => { + it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yx', () => { + it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yy', () => { + it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxx', () => { + it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxy', () => { + it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyx', () => { + it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyy', () => { + it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxx', () => { + it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxy', () => { + it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyx', () => { + it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyy', () => { + it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxxx', () => { + it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxxy', () => { + it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxyx', () => { + it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxyy', () => { + it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyxx', () => { + it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyxy', () => { + it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyyx', () => { + it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyyy', () => { + it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxxx', () => { + it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxxy', () => { + it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxyx', () => { + it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxyy', () => { + it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyxx', () => { + it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyxy', () => { + it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyyx', () => { + it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyyy', () => { + it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rr', () => { + it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rg', () => { + it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gr', () => { + it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gg', () => { + it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrr', () => { + it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrg', () => { + it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgr', () => { + it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgg', () => { + it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grr', () => { + it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grg', () => { + it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggr', () => { + it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggg', () => { + it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrrr', () => { + it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrrg', () => { + it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrgr', () => { + it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rrgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrgg', () => { + it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rrgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgrr', () => { + it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgrg', () => { + it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rggr', () => { + it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rggg', () => { + it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grrr', () => { + it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grrg', () => { + it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grgr', () => { + it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.grgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grgg', () => { + it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.grgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggrr', () => { + it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ggrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggrg', () => { + it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ggrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gggr', () => { + it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gggg', () => { + it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + // [/Swizzle Autogen] +}); diff --git a/tests/f32/Vec2.spec.ts b/tests/f32/Vec2.spec.ts new file mode 100644 index 00000000..56528f97 --- /dev/null +++ b/tests/f32/Vec2.spec.ts @@ -0,0 +1,799 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec2 } from '#gl-matrix'; + +import type { Vec2Like } from '#gl-matrix/types'; + +describe('Vec2', () => { + let vecA: Vec2; + let vecB: Vec2; + let out: Vec2; + + beforeEach(() => { + vecA = new Vec2(1, 2); + vecB = new Vec2([3, 4]); + out = new Vec2(); + }); + + describe('constructor', () => { + it('should return Vec2(0, 0) if called with no arguments', () => expect(new Vec2()).toBeVec(0, 0)); + + it('should return Vec2(x, y) if called with (x, y)', () => { + expect(new Vec2(1, 2)).toBeVec(1, 2); + expect(new Vec2(-3, 4.4)).toBeVec(-3, 4.4); + }); + + it('should return Vec2(x, x) if called with (x)', () => { + expect(new Vec2(1)).toBeVec(1, 1); + expect(new Vec2(-2.3)).toBeVec(-2.3, -2.3); + }); + + it('should return Vec2(x, y) if called with ([x, y])', () => { + expect(new Vec2([1, 2])).toBeVec(1, 2); + expect(new Vec2([-3, 4.4])).toBeVec(-3, 4.4); + }); + + it('should return Vec2(x, y) if called with (Vec2(x, y))', () => { + let v = new Vec2(3.4, 5.6); + expect(new Vec2(v)).toBeVec(v); + }); + + it('should return Vec2(x, y) if called with (Float32Array([x, y]))', () => { + let arr = new Float32Array([1.2, 3.4]); + expect(new Vec2(arr)).toBeVec(arr); + }); + }); + + describe('static methods', () => { + describe('create', () => { + it('should return Vec2(0, 0)', () => expect(Vec2.create()).toBeVec(0, 0)); + }); + + describe('add', () => { + let result: Vec2Like; + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(4, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(4, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('with raw array as the output', () => { + let outArray: Vec2Like = [0, 0]; + beforeEach(() => { result = Vec2.add(outArray, vecA, vecB); }); + + it('should place values into out', () => expect(outArray).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(outArray)); + }); + + describe('with raw arrays as the inputs', () => { + beforeEach(() => { result = Vec2.add(out, [1, 2], [3, 4]); }); + + it('should place values into out', () => expect(out).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(out)); + }); + }); + }); + + describe('static', () => { + let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: any; + + beforeEach(() => { + vecA = new Vec2(1, 2); + vecB = new Vec2(3, 4); + out = new Vec2(0, 0); + }); + + describe('create', () => { + beforeEach(() => { result = Vec2.create(); }); + + it('should return a 2 element array initialized to 0s', () => expect(result).toBeVec(0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Vec2.clone(vecA); }); + + it('should return a 2 element array initialized to the values in vecA', () => expect(result).toBeVec(vecA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Vec2.fromValues(1, 2); }); + + it('should return a 2 element array initialized to the values passed', () => expect(result).toBeVec(1, 2)); + }); + + describe('copy', () => { + beforeEach(() => { result = Vec2.copy(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Vec2.set(out, 1, 2); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(4, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(4, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Vec2.sub).toEqual(Vec2.subtract)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.subtract(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-2, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.subtract(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-2, -2)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.subtract(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-2, -2)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Vec2.mul).toEqual(Vec2.multiply)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.multiply(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.multiply(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 8)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.multiply(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 8)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('divide', () => { + it('should have an alias called `div`', () => expect(Vec2.div).toEqual(Vec2.divide)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.divide(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(0.3333333, 0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.divide(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0.3333333, 0.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.divide(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0.3333333, 0.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('ceil', () => { + beforeEach(() => { vecA = [Math.E, Math.PI]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.ceil(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.ceil(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('floor', () => { + beforeEach(() => { vecA = [Math.E, Math.PI]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.floor(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.floor(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('min', () => { + beforeEach(() => { vecA = [1, 4]; vecB = [3, 2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.min(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.min(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.min(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(1, 2)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + }); + }); + + describe('max', () => { + beforeEach(() => { vecA = [1, 4]; vecB = [3, 2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.max(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.max(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.max(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 4)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + }); + }); + + describe('round', () => { + beforeEach(() => { vecA = [Math.E, Math.PI]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.round(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.round(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scale', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.scale(out, vecA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.scale(vecA, vecA, 2); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scaleAndAdd', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(2.5, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2.5, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(2.5, 4)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('distance', () => { + beforeEach(() => { result = Vec2.distance(vecA, vecB); }); + + it('should have an alias called `dist`', () => expect(Vec2.dist).toEqual(Vec2.distance)); + it('should return the distance', () => expect(result).toBeCloseTo(2.828427)); + }); + + describe('squaredDistance', () => { + beforeEach(() => { result = Vec2.squaredDistance(vecA, vecB); }); + + it('should have an alias called `sqrDist`', () => expect(Vec2.sqrDist).toEqual(Vec2.squaredDistance)); + it('should return the squared distance', () => expect(result).toEqual(8)); + }); + + describe('length', () => { + beforeEach(() => { result = Vec2.len(vecA); }); + + it('should have an alias called `len`', () => expect(Vec2.len).toEqual(Vec2.length)); + it('should return the length', () => expect(result).toBeCloseTo(2.236067)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Vec2.squaredLength(vecA); }); + + it('should have an alias called `sqrLen`', () => expect(Vec2.sqrLen).toEqual(Vec2.squaredLength)); + it('should return the squared length', () => expect(result).toEqual(5)); + }); + + describe('negate', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.negate(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.negate(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-1, -2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('inverse', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.inverse(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1/2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.inverse(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('abs', () => { + beforeEach(() => { vecA = [-1, -2]; }); + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.abs(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(-1, -2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.abs(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('normalize', () => { + beforeEach(() => { vecA = [5, 0]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.normalize(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(5, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.normalize(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('dot', () => { + beforeEach(() => { result = Vec2.dot(vecA, vecB); }); + + it('should return the dot product', () => expect(result).toEqual(11)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('cross', () => { + let out3; + + beforeEach(() => { + out3 = [0, 0, 0]; + result = Vec2.cross(out3, vecA, vecB); + }); + + it('should place values into out', () => expect(out3).toBeVec(0, 0, -2)); + it('should return out', () => expect(result).toBe(out3)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('lerp', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.lerp(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.lerp(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.lerp(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(2, 3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + /*describe('random', () => { + describe('with no scale', () => { + beforeEach(() => { result = Vec2.random(out); }); + + it('should result in a unit length vector', () => expect(Vec2.len(out)).toBeCloseTo(1.0)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a scale', () => { + beforeEach(() => { result = Vec2.random(out, 5.0); }); + + it('should result in a unit length vector', () => expect(Vec2.len(out)).toBeCloseTo(5.0)); + it('should return out', () => expect(result).toBe(out)); + }); + });*/ + + describe('transformMat2', () => { + let matA; + + beforeEach(() => { matA = [1, 2, 3, 4]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.transformMat2(out, vecA, matA); }); + + it('should place values into out', () => expect(out).toBeVec(7, 10)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.transformMat2(vecA, vecA, matA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(7, 10)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('transformMat2d', () => { + let matA; + + beforeEach(() => { matA = [1, 2, 3, 4, 5, 6]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.transformMat2d(out, vecA, matA); }); + + it('should place values into out', () => expect(out).toBeVec(12, 16)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.transformMat2d(vecA, vecA, matA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(12, 16)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + }); + + /*describe('forEach', () => { + let vecArray; + + beforeEach(() => { + vecArray = [ + 1, 2, + 3, 4, + 0, 0 + ]; + }); + + describe('when performing operations that take no extra arguments', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, Vec2.normalize); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 0.447214, 0.894427, + 0.6, 0.8, + 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + + describe('when performing operations that takes one extra arguments', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, Vec2.add, vecA); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 2, 4, + 4, 6, + 1, 2 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when specifying an offset', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 2, 0, Vec2.add, vecA); }); + + it('should update all values except the first vector', () => { + expect(vecArray).toBeEqualish([ + 1, 2, + 4, 6, + 1, 2 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when specifying a count', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 2, Vec2.add, vecA); }); + + it('should update all values except the last vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, + 4, 6, + 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when specifying a stride', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 4, 0, 0, Vec2.add, vecA); }); + + it('should update all values except the second vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, + 3, 4, + 1, 2 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when calling a function that does not modify the out variable', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, function(out, vec) {}); }); + + it('values should remain unchanged', () => { + expect(vecArray).toBeEqualish([ + 1, 2, + 3, 4, + 0, 0, + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + });*/ + + describe('rotate', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [0, 1]; + vecB = [0, 0]; + result = Vec2.rotate(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -1)); + }); + + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [6, -5]; + vecB = [0, -5]; + result = Vec2.rotate(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(-6, -5)); + }); + }); + + describe('angle', () => { + beforeEach(() => { + vecA = [1,0]; + vecB = [1,2]; + result = Vec2.angle(vecA, vecB); + }); + + it('should return the angle', () => expect(result).toBeCloseTo(1.10714)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0)); + it('should not modify vecB', () => expect(vecB).toBeVec(1, 2)); + }); + + describe('str', () => { + it('should return a string representation of the vector', () => expect(Vec2.str(vecA)).toEqual('Vec2(1, 2)')); + }); + + describe('exactEquals', () => { + let vecC, r0, r1; + + beforeEach(() => { + vecA = [0, 1]; + vecB = [0, 1]; + vecC = [1, 2]; + r0 = Vec2.exactEquals(vecA, vecB); + r1 = Vec2.exactEquals(vecA, vecC); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1)); + }); + + describe('equals', () => { + let vecC, vecD, r0, r1, r2; + + beforeEach(() => { + vecA = [0, 1]; + vecB = [0, 1]; + vecC = [1, 2]; + vecD = [1e-16, 1]; + r0 = Vec2.equals(vecA, vecB); + r1 = Vec2.equals(vecA, vecC); + r2 = Vec2.equals(vecA, vecD); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should return true for close but not identical vectors', () => expect(r2).toBe(true)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1)); + }); + + describe('zero', () => { + beforeEach(() => { + vecA = [1, 2]; + result = Vec2.zero(vecA); + }); + + it('should result in a 2 element vector with zeros', () => expect(result).toBeVec(0, 0)); + }); + }); +}); diff --git a/tests/f32/Vec3-swizzle.spec.ts b/tests/f32/Vec3-swizzle.spec.ts new file mode 100644 index 00000000..077a706d --- /dev/null +++ b/tests/f32/Vec3-swizzle.spec.ts @@ -0,0 +1,2123 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec3 } from '#gl-matrix'; +import { EnableSwizzles } from '#gl-matrix/swizzle'; + +describe('Vec3 Swizzles', () => { + EnableSwizzles(); + + let v: Vec3; + beforeEach(() => { v = new Vec3(1, 2, 3); }); + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + describe('Vec3().xx', () => { + it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xy', () => { + it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xz', () => { + it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yx', () => { + it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yy', () => { + it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yz', () => { + it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zx', () => { + it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zy', () => { + it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zz', () => { + it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxx', () => { + it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxy', () => { + it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxz', () => { + it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyx', () => { + it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyy', () => { + it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyz', () => { + it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzx', () => { + it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzy', () => { + it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzz', () => { + it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxx', () => { + it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxy', () => { + it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxz', () => { + it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyx', () => { + it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyy', () => { + it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyz', () => { + it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzx', () => { + it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzy', () => { + it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzz', () => { + it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxx', () => { + it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxy', () => { + it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxz', () => { + it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyx', () => { + it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyy', () => { + it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyz', () => { + it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzx', () => { + it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzy', () => { + it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzz', () => { + it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxxx', () => { + it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxxy', () => { + it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxxz', () => { + it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxyx', () => { + it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxyy', () => { + it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxyz', () => { + it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxzx', () => { + it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxzy', () => { + it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxzz', () => { + it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyxx', () => { + it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyxy', () => { + it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyxz', () => { + it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyyx', () => { + it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyyy', () => { + it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyyz', () => { + it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyzx', () => { + it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyzy', () => { + it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyzz', () => { + it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzxx', () => { + it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzxy', () => { + it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzxz', () => { + it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzyx', () => { + it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzyy', () => { + it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzyz', () => { + it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzzx', () => { + it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzzy', () => { + it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzzz', () => { + it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxxx', () => { + it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxxy', () => { + it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxxz', () => { + it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxyx', () => { + it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxyy', () => { + it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxyz', () => { + it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxzx', () => { + it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxzy', () => { + it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxzz', () => { + it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyxx', () => { + it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyxy', () => { + it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyxz', () => { + it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyyx', () => { + it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyyy', () => { + it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyyz', () => { + it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyzx', () => { + it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyzy', () => { + it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyzz', () => { + it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzxx', () => { + it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzxy', () => { + it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzxz', () => { + it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzyx', () => { + it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzyy', () => { + it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzyz', () => { + it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzzx', () => { + it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzzy', () => { + it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzzz', () => { + it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxxx', () => { + it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxxy', () => { + it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxxz', () => { + it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxyx', () => { + it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxyy', () => { + it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxyz', () => { + it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxzx', () => { + it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxzy', () => { + it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxzz', () => { + it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyxx', () => { + it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyxy', () => { + it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyxz', () => { + it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyyx', () => { + it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyyy', () => { + it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyyz', () => { + it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyzx', () => { + it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyzy', () => { + it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyzz', () => { + it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzxx', () => { + it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzxy', () => { + it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzxz', () => { + it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzyx', () => { + it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzyy', () => { + it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzyz', () => { + it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzzx', () => { + it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzzy', () => { + it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzzz', () => { + it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rr', () => { + it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rg', () => { + it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rb', () => { + it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gr', () => { + it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gg', () => { + it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gb', () => { + it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().br', () => { + it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.br; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bg', () => { + it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bb', () => { + it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrr', () => { + it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrg', () => { + it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrb', () => { + it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgr', () => { + it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgg', () => { + it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgb', () => { + it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbr', () => { + it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbg', () => { + it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbb', () => { + it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grr', () => { + it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grg', () => { + it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grb', () => { + it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggr', () => { + it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggg', () => { + it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggb', () => { + it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbr', () => { + it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbg', () => { + it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbb', () => { + it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brr', () => { + it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brg', () => { + it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brb', () => { + it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgr', () => { + it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgg', () => { + it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgb', () => { + it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbr', () => { + it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbg', () => { + it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbb', () => { + it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrrr', () => { + it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrrg', () => { + it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrrb', () => { + it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrgr', () => { + it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rrgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrgg', () => { + it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rrgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrgb', () => { + it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rrgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrbr', () => { + it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rrbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrbg', () => { + it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rrbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrbb', () => { + it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rrbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgrr', () => { + it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgrg', () => { + it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgrb', () => { + it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rggr', () => { + it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rggg', () => { + it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rggb', () => { + it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgbr', () => { + it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgbg', () => { + it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgbb', () => { + it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbrr', () => { + it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbrg', () => { + it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbrb', () => { + it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbgr', () => { + it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbgg', () => { + it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbgb', () => { + it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbbr', () => { + it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbbg', () => { + it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbbb', () => { + it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grrr', () => { + it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grrg', () => { + it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grrb', () => { + it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grgr', () => { + it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.grgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grgg', () => { + it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.grgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grgb', () => { + it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.grgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grbr', () => { + it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.grbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grbg', () => { + it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.grbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grbb', () => { + it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.grbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggrr', () => { + it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ggrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggrg', () => { + it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ggrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggrb', () => { + it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.ggrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gggr', () => { + it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gggg', () => { + it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gggb', () => { + it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggbr', () => { + it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.ggbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggbg', () => { + it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.ggbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggbb', () => { + it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.ggbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbrr', () => { + it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.gbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbrg', () => { + it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.gbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbrb', () => { + it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.gbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbgr', () => { + it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbgg', () => { + it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbgb', () => { + it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbbr', () => { + it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbbg', () => { + it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbbb', () => { + it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brrr', () => { + it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brrg', () => { + it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brrb', () => { + it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brgr', () => { + it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.brgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brgg', () => { + it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.brgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brgb', () => { + it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.brgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brbr', () => { + it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.brbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brbg', () => { + it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.brbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brbb', () => { + it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.brbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgrr', () => { + it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgrg', () => { + it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgrb', () => { + it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bggr', () => { + it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bggg', () => { + it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bggb', () => { + it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgbr', () => { + it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgbg', () => { + it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgbb', () => { + it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbrr', () => { + it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbrg', () => { + it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbrb', () => { + it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbgr', () => { + it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbgg', () => { + it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbgb', () => { + it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbbr', () => { + it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbbg', () => { + it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbbb', () => { + it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + // [/Swizzle Autogen] +}); diff --git a/tests/f32/Vec3.spec.ts b/tests/f32/Vec3.spec.ts new file mode 100644 index 00000000..6ae5c693 --- /dev/null +++ b/tests/f32/Vec3.spec.ts @@ -0,0 +1,727 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat4, Vec3 } from '#gl-matrix'; + +import type { Mat4Like, Vec3Like } from '#gl-matrix/types'; + +describe('Vec3', () => { + describe('constructor', () => { + it('should return Vec3(0, 0, 0) if called with no arguments', () => expect(new Vec3()).toBeVec(0, 0, 0)); + + it('should return Vec3(x, y, z) if called with (x, y, z)', () => { + expect(new Vec3(1, 2, 3)).toBeVec(1, 2, 3); + expect(new Vec3(-3, 4.4, -5.6)).toBeVec(-3, 4.4, -5.6); + }); + + it('should return Vec3(x, x, x) if called with (x)', () => { + expect(new Vec3(1)).toBeVec(1, 1, 1); + expect(new Vec3(-2.3)).toBeVec(-2.3, -2.3, -2.3); + }); + + it('should return Vec3(x, y, z) if called with ([x, y, z])', () => { + expect(new Vec3([1, 2, 3])).toBeVec(1, 2, 3); + expect(new Vec3([-3, 4.4, -5.6])).toBeVec(-3, 4.4, -5.6); + }); + + it('should return Vec3(x, y, z) if called with (Vec3(x, y, z))', () => { + let v = new Vec3(3.4, 5.6, 7.8); + expect(new Vec3(v)).toBeVec(v); + }); + + it('should return Vec3(x, y, z) if called with (Float32Array([x, y, z]))', () => { + let arr = new Float32Array([1.2, 3.4, 5.6]); + expect(new Vec3(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Vec3Like; + let vecA: Vec3Like; + let vecB: Vec3Like; + let result: Vec3Like; + + beforeEach(() => { + vecA = new Vec3(1, 2, 3); + vecB = new Vec3(4, 5, 6); + out = new Vec3(0, 0, 0); + }); + + describe('rotateX', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [0, 1, 0]; + vecB = [0, 0, 0]; + result = Vec3.rotateX(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -1, 0)); + }); + + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [2, 7, 0]; + vecB = [2, 5, 0]; + result = Vec3.rotateX(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(2, 3, 0)); + }); + }); + + describe('rotateY', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [1, 0, 0]; + vecB = [0, 0, 0]; + result = Vec3.rotateY(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(-1, 0, 0)); + }); + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [-2, 3, 10]; + vecB = [-4, 3, 10]; + result = Vec3.rotateY(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(-6, 3, 10)); + }); + }); + + describe('rotateZ', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [0, 1, 0]; + vecB = [0, 0, 0]; + result = Vec3.rotateZ(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -1, 0)); + }); + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [0, 6, -5]; + vecB = [0, 0, -5]; + result = Vec3.rotateZ(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -6, -5)); + }); + }); + + describe('transformMat4', () => { + let matr : Mat4Like; + + describe('with an identity', () => { + beforeEach(() => { + matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; + result = Vec3.transformMat4(out, vecA, matr); + }); + + it('should produce the input', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a lookAt', () => { + beforeEach(() => { + matr = Mat4.lookAt(new Mat4(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); + result = Vec3.transformMat4(out, vecA, matr); + }); + + it('should rotate and translate the input', () => expect(out).toBeVec( 4, -4, -4 )); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a perspective matrix (#92)', () => { + it('should transform a point from perspective(pi/2, 4/3, 1, 100)', () => { + matr = [0.750, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1.02, -1, + 0, 0, -2.02, 0]; + result = Vec3.transformMat4([0, 0, 0], [10, 20, 30], matr); + expect(result).toBeVec(-0.25, -0.666666, 1.087333); + }); + }); + }); + + /*describe('transformMat3', () => { + let matr; + + describe('with an identity', () => { + beforeEach(() => { + matr = [1, 0, 0, 0, 1, 0, 0, 0, 1 ]; + result = Vec3.transformMat3(out, vecA, matr); + }); + + it('should produce the input', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with 90deg about X', () => { + beforeEach(() => { result = Vec3.transformMat3(out, [0,1,0], [1,0,0,0,0,1,0,-1,0]); }); + + it('should produce correct output', () => expect(out).toBeVec(0,0,1)); + }); + + describe('with 90deg about Y', () => { + beforeEach(() => { result = Vec3.transformMat3(out, [1,0,0], [0,0,-1,0,1,0,1,0,0]); }); + + it('should produce correct output', () => expect(out).toBeVec(0,0,-1)); + }); + + describe('with 90deg about Z', () => { + beforeEach(() => { result = Vec3.transformMat3(out, [1,0,0], [0,1,0,-1,0,0,0,0,1]); }); + + it('should produce correct output', () => expect(out).toBeVec(0,1,0)); + }); + + describe('with a lookAt normal matrix', () => { + beforeEach(() => { + matr = mat4.lookAt(mat4.create(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); + let n = mat3.create(); + matr = mat3.transpose(n, mat3.invert(n, mat3.fromMat4(n, matr))); + + result = Vec3.transformMat3(out, [1,0,0], matr); + }); + + it('should rotate the input', () => expect(out).toBeVec( 0,0,1 )); + it('should return out', () => expect(result).toBe(out)); + }); + });*/ + + describe('transformQuat', () => { + beforeEach(() => { + result = Vec3.transformQuat(out, vecA, + [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); + }); + + it('should rotate the input vector', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).not.toBe([1,2,3,4])); + }); + + describe('create', () => { + beforeEach(() => { result = Vec3.create(); }); + + it('should return a 3 element array initialized to 0s', () => expect(result).toBeVec(0, 0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Vec3.clone(vecA); }); + + it('should return a 3 element array initialized to the values in vecA', () => expect(result).toBeVec(vecA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Vec3.fromValues(1, 2, 3); }); + + it('should return a 3 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3)); + }); + + describe('copy', () => { + beforeEach(() => { result = Vec3.copy(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Vec3.set(out, 1, 2, 3); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(5, 7, 9)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(5, 7, 9)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(5, 7, 9)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Vec3.sub).toEqual(Vec3.subtract)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.subtract(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-3, -3, -3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.subtract(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-3, -3, -3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.subtract(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-3, -3, -3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Vec3.mul).toEqual(Vec3.multiply)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.multiply(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(4, 10, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.multiply(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(4, 10, 18)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.multiply(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(4, 10, 18)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('divide', () => { + it('should have an alias called `div`', () => expect(Vec3.div).toEqual(Vec3.divide)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.divide(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(0.25, 0.4, 0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.divide(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0.25, 0.4, 0.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.divide(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0.25, 0.4, 0.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('ceil', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.ceil(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.ceil(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4, 2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('floor', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.floor(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.floor(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('min', () => { + beforeEach(() => { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.min(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.min(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.min(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(1, 1, 1)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + }); + }); + + describe('max', () => { + beforeEach(() => { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.max(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.max(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.max(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 3, 3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + }); + }); + + /*describe('round', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.round(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.round(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + });*/ + + describe('scale', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.scale(out, vecA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.scale(vecA, vecA, 2); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 4, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scaleAndAdd', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4.5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4.5, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 4.5, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('distance', () => { + it('should have an alias called `dist`', () => expect(Vec3.dist).toEqual(Vec3.distance)); + it('should return the distance', () => expect(Vec3.distance(vecA, vecB)).toBeCloseTo(5.196152)); + }); + + describe('squaredDistance', () => { + it('should have an alias called `sqrDist`', () => expect(Vec3.sqrDist).toEqual(Vec3.squaredDistance)); + it('should return the squared distance', () => expect(Vec3.squaredDistance(vecA, vecB)).toEqual(27)); + }); + + describe('length', () => { + it('should have an alias called `len`', () => expect(Vec3.len).toEqual(Vec3.length)); + it('should return the length', () => expect(Vec3.len(vecA)).toBeCloseTo(3.741657)); + }); + + describe('squaredLength', () => { + it('should have an alias called `sqrLen`', () => expect(Vec3.sqrLen).toEqual(Vec3.squaredLength)); + it('should return the squared length', () => expect(Vec3.squaredLength(vecA)).toEqual(14)); + }); + + describe('negate', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.negate(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2, -3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.negate(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-1, -2, -3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('inverse', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.inverse(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.inverse(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('abs', () => { + beforeEach(() => { vecA = [-1, -2, -3]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.abs(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(-1, -2, -3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.abs(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('normalize', () => { + beforeEach(() => { vecA = [5, 0, 0]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.normalize(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(5, 0, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.normalize(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 0, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('dot', () => { + let value: number; + beforeEach(() => { value = Vec3.dot(vecA, vecB); }); + + it('should return the dot product', () => expect(value).toEqual(32)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('cross', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.cross(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-3, 6, -3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.cross(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-3, 6, -3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.cross(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-3, 6, -3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('lerp', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.lerp(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(2.5, 3.5, 4.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.lerp(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2.5, 3.5, 4.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.lerp(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(2.5, 3.5, 4.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('angle', () => { + let value: number; + + beforeEach(() => { value = Vec3.angle(vecA, vecB); }); + + it('should return the angle', () => expect(value).toBeCloseTo(0.225726)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('str', () => { + it('should return a string representation of the vector', () => expect(Vec3.str(vecA)).toEqual('Vec3(1, 2, 3)')); + }); + + describe('exactEquals', () => { + let vecC: Vec3Like, r0: boolean, r1: boolean; + + beforeEach(() => { + vecA = [0, 1, 2]; + vecB = [0, 1, 2]; + vecC = [1, 2, 3]; + r0 = Vec3.exactEquals(vecA, vecB); + r1 = Vec3.exactEquals(vecA, vecC); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2)); + }); + + describe('equals', () => { + let vecC: Vec3Like, + vecD: Vec3Like, + r0: boolean, + r1: boolean, + r2: boolean; + + beforeEach(() => { + vecA = [0, 1, 2]; + vecB = [0, 1, 2]; + vecC = [1, 2, 3]; + vecD = [1e-16, 1, 2]; + r0 = Vec3.equals(vecA, vecB); + r1 = Vec3.equals(vecA, vecC); + r2 = Vec3.equals(vecA, vecD); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should return true for close but not identical vectors', () => expect(r2).toBe(true)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2)); + }); + + describe('zero', () => { + beforeEach(() => { + vecA = [1, 2, 3]; + result = Vec3.zero(vecA); + }); + + it('should result in a 3 element vector with zeros', () => expect(result).toBeVec(0, 0, 0)); + }); + }); +}); diff --git a/tests/f32/Vec4-swizzle.spec.ts b/tests/f32/Vec4-swizzle.spec.ts new file mode 100644 index 00000000..5858fa0f --- /dev/null +++ b/tests/f32/Vec4-swizzle.spec.ts @@ -0,0 +1,6065 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec4 } from '#gl-matrix'; +import { EnableSwizzles } from '#gl-matrix/swizzle'; + +describe('Vec4 Swizzles', () => { + EnableSwizzles(); + + let v: Vec4; + beforeEach(() => { v = new Vec4(1, 2, 3); }); + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + describe('Vec4().xx', () => { + it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xy', () => { + it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xz', () => { + it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xw', () => { + it('should return Vec2(x, w)', () => expect(v.xw).toBeVec(v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yx', () => { + it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yy', () => { + it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yz', () => { + it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yw', () => { + it('should return Vec2(y, w)', () => expect(v.yw).toBeVec(v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zx', () => { + it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zy', () => { + it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zz', () => { + it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zw', () => { + it('should return Vec2(z, w)', () => expect(v.zw).toBeVec(v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wx', () => { + it('should return Vec2(w, x)', () => expect(v.wx).toBeVec(v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wy', () => { + it('should return Vec2(w, y)', () => expect(v.wy).toBeVec(v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wz', () => { + it('should return Vec2(w, z)', () => expect(v.wz).toBeVec(v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ww', () => { + it('should return Vec2(w, w)', () => expect(v.ww).toBeVec(v[3], v[3])); + it('should be return a copy', () => { + let sw = v.ww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxx', () => { + it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxy', () => { + it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxz', () => { + it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxw', () => { + it('should return Vec3(x, x, w)', () => expect(v.xxw).toBeVec(v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyx', () => { + it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyy', () => { + it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyz', () => { + it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyw', () => { + it('should return Vec3(x, y, w)', () => expect(v.xyw).toBeVec(v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzx', () => { + it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzy', () => { + it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzz', () => { + it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzw', () => { + it('should return Vec3(x, z, w)', () => expect(v.xzw).toBeVec(v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwx', () => { + it('should return Vec3(x, w, x)', () => expect(v.xwx).toBeVec(v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwy', () => { + it('should return Vec3(x, w, y)', () => expect(v.xwy).toBeVec(v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwz', () => { + it('should return Vec3(x, w, z)', () => expect(v.xwz).toBeVec(v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xww', () => { + it('should return Vec3(x, w, w)', () => expect(v.xww).toBeVec(v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxx', () => { + it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxy', () => { + it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxz', () => { + it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxw', () => { + it('should return Vec3(y, x, w)', () => expect(v.yxw).toBeVec(v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyx', () => { + it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyy', () => { + it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyz', () => { + it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyw', () => { + it('should return Vec3(y, y, w)', () => expect(v.yyw).toBeVec(v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzx', () => { + it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzy', () => { + it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzz', () => { + it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzw', () => { + it('should return Vec3(y, z, w)', () => expect(v.yzw).toBeVec(v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywx', () => { + it('should return Vec3(y, w, x)', () => expect(v.ywx).toBeVec(v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywy', () => { + it('should return Vec3(y, w, y)', () => expect(v.ywy).toBeVec(v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywz', () => { + it('should return Vec3(y, w, z)', () => expect(v.ywz).toBeVec(v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yww', () => { + it('should return Vec3(y, w, w)', () => expect(v.yww).toBeVec(v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxx', () => { + it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxy', () => { + it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxz', () => { + it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxw', () => { + it('should return Vec3(z, x, w)', () => expect(v.zxw).toBeVec(v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyx', () => { + it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyy', () => { + it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyz', () => { + it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyw', () => { + it('should return Vec3(z, y, w)', () => expect(v.zyw).toBeVec(v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzx', () => { + it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzy', () => { + it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzz', () => { + it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzw', () => { + it('should return Vec3(z, z, w)', () => expect(v.zzw).toBeVec(v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwx', () => { + it('should return Vec3(z, w, x)', () => expect(v.zwx).toBeVec(v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwy', () => { + it('should return Vec3(z, w, y)', () => expect(v.zwy).toBeVec(v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwz', () => { + it('should return Vec3(z, w, z)', () => expect(v.zwz).toBeVec(v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zww', () => { + it('should return Vec3(z, w, w)', () => expect(v.zww).toBeVec(v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxx', () => { + it('should return Vec3(w, x, x)', () => expect(v.wxx).toBeVec(v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxy', () => { + it('should return Vec3(w, x, y)', () => expect(v.wxy).toBeVec(v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxz', () => { + it('should return Vec3(w, x, z)', () => expect(v.wxz).toBeVec(v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxw', () => { + it('should return Vec3(w, x, w)', () => expect(v.wxw).toBeVec(v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyx', () => { + it('should return Vec3(w, y, x)', () => expect(v.wyx).toBeVec(v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyy', () => { + it('should return Vec3(w, y, y)', () => expect(v.wyy).toBeVec(v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyz', () => { + it('should return Vec3(w, y, z)', () => expect(v.wyz).toBeVec(v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyw', () => { + it('should return Vec3(w, y, w)', () => expect(v.wyw).toBeVec(v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzx', () => { + it('should return Vec3(w, z, x)', () => expect(v.wzx).toBeVec(v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzy', () => { + it('should return Vec3(w, z, y)', () => expect(v.wzy).toBeVec(v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzz', () => { + it('should return Vec3(w, z, z)', () => expect(v.wzz).toBeVec(v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzw', () => { + it('should return Vec3(w, z, w)', () => expect(v.wzw).toBeVec(v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwx', () => { + it('should return Vec3(w, w, x)', () => expect(v.wwx).toBeVec(v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwy', () => { + it('should return Vec3(w, w, y)', () => expect(v.wwy).toBeVec(v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwz', () => { + it('should return Vec3(w, w, z)', () => expect(v.wwz).toBeVec(v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().www', () => { + it('should return Vec3(w, w, w)', () => expect(v.www).toBeVec(v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.www; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxx', () => { + it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxy', () => { + it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxz', () => { + it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxw', () => { + it('should return Vec4(x, x, x, w)', () => expect(v.xxxw).toBeVec(v[0], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyx', () => { + it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyy', () => { + it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyz', () => { + it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyw', () => { + it('should return Vec4(x, x, y, w)', () => expect(v.xxyw).toBeVec(v[0], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzx', () => { + it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzy', () => { + it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzz', () => { + it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzw', () => { + it('should return Vec4(x, x, z, w)', () => expect(v.xxzw).toBeVec(v[0], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxwx', () => { + it('should return Vec4(x, x, w, x)', () => expect(v.xxwx).toBeVec(v[0], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxwy', () => { + it('should return Vec4(x, x, w, y)', () => expect(v.xxwy).toBeVec(v[0], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxwz', () => { + it('should return Vec4(x, x, w, z)', () => expect(v.xxwz).toBeVec(v[0], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxww', () => { + it('should return Vec4(x, x, w, w)', () => expect(v.xxww).toBeVec(v[0], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxx', () => { + it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxy', () => { + it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxz', () => { + it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxw', () => { + it('should return Vec4(x, y, x, w)', () => expect(v.xyxw).toBeVec(v[0], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyx', () => { + it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyy', () => { + it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyz', () => { + it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyw', () => { + it('should return Vec4(x, y, y, w)', () => expect(v.xyyw).toBeVec(v[0], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzx', () => { + it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzy', () => { + it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzz', () => { + it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzw', () => { + it('should return Vec4(x, y, z, w)', () => expect(v.xyzw).toBeVec(v[0], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xywx', () => { + it('should return Vec4(x, y, w, x)', () => expect(v.xywx).toBeVec(v[0], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xywy', () => { + it('should return Vec4(x, y, w, y)', () => expect(v.xywy).toBeVec(v[0], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xywz', () => { + it('should return Vec4(x, y, w, z)', () => expect(v.xywz).toBeVec(v[0], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyww', () => { + it('should return Vec4(x, y, w, w)', () => expect(v.xyww).toBeVec(v[0], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxx', () => { + it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxy', () => { + it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxz', () => { + it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxw', () => { + it('should return Vec4(x, z, x, w)', () => expect(v.xzxw).toBeVec(v[0], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyx', () => { + it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyy', () => { + it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyz', () => { + it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyw', () => { + it('should return Vec4(x, z, y, w)', () => expect(v.xzyw).toBeVec(v[0], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzx', () => { + it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzy', () => { + it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzz', () => { + it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzw', () => { + it('should return Vec4(x, z, z, w)', () => expect(v.xzzw).toBeVec(v[0], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzwx', () => { + it('should return Vec4(x, z, w, x)', () => expect(v.xzwx).toBeVec(v[0], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzwy', () => { + it('should return Vec4(x, z, w, y)', () => expect(v.xzwy).toBeVec(v[0], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzwz', () => { + it('should return Vec4(x, z, w, z)', () => expect(v.xzwz).toBeVec(v[0], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzww', () => { + it('should return Vec4(x, z, w, w)', () => expect(v.xzww).toBeVec(v[0], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxx', () => { + it('should return Vec4(x, w, x, x)', () => expect(v.xwxx).toBeVec(v[0], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xwxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxy', () => { + it('should return Vec4(x, w, x, y)', () => expect(v.xwxy).toBeVec(v[0], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xwxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxz', () => { + it('should return Vec4(x, w, x, z)', () => expect(v.xwxz).toBeVec(v[0], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xwxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxw', () => { + it('should return Vec4(x, w, x, w)', () => expect(v.xwxw).toBeVec(v[0], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xwxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyx', () => { + it('should return Vec4(x, w, y, x)', () => expect(v.xwyx).toBeVec(v[0], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xwyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyy', () => { + it('should return Vec4(x, w, y, y)', () => expect(v.xwyy).toBeVec(v[0], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xwyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyz', () => { + it('should return Vec4(x, w, y, z)', () => expect(v.xwyz).toBeVec(v[0], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xwyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyw', () => { + it('should return Vec4(x, w, y, w)', () => expect(v.xwyw).toBeVec(v[0], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xwyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzx', () => { + it('should return Vec4(x, w, z, x)', () => expect(v.xwzx).toBeVec(v[0], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xwzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzy', () => { + it('should return Vec4(x, w, z, y)', () => expect(v.xwzy).toBeVec(v[0], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xwzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzz', () => { + it('should return Vec4(x, w, z, z)', () => expect(v.xwzz).toBeVec(v[0], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xwzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzw', () => { + it('should return Vec4(x, w, z, w)', () => expect(v.xwzw).toBeVec(v[0], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xwzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwwx', () => { + it('should return Vec4(x, w, w, x)', () => expect(v.xwwx).toBeVec(v[0], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xwwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwwy', () => { + it('should return Vec4(x, w, w, y)', () => expect(v.xwwy).toBeVec(v[0], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xwwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwwz', () => { + it('should return Vec4(x, w, w, z)', () => expect(v.xwwz).toBeVec(v[0], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xwwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwww', () => { + it('should return Vec4(x, w, w, w)', () => expect(v.xwww).toBeVec(v[0], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xwww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxx', () => { + it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxy', () => { + it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxz', () => { + it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxw', () => { + it('should return Vec4(y, x, x, w)', () => expect(v.yxxw).toBeVec(v[1], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyx', () => { + it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyy', () => { + it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyz', () => { + it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyw', () => { + it('should return Vec4(y, x, y, w)', () => expect(v.yxyw).toBeVec(v[1], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzx', () => { + it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzy', () => { + it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzz', () => { + it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzw', () => { + it('should return Vec4(y, x, z, w)', () => expect(v.yxzw).toBeVec(v[1], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxwx', () => { + it('should return Vec4(y, x, w, x)', () => expect(v.yxwx).toBeVec(v[1], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.yxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxwy', () => { + it('should return Vec4(y, x, w, y)', () => expect(v.yxwy).toBeVec(v[1], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.yxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxwz', () => { + it('should return Vec4(y, x, w, z)', () => expect(v.yxwz).toBeVec(v[1], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.yxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxww', () => { + it('should return Vec4(y, x, w, w)', () => expect(v.yxww).toBeVec(v[1], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxx', () => { + it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxy', () => { + it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxz', () => { + it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxw', () => { + it('should return Vec4(y, y, x, w)', () => expect(v.yyxw).toBeVec(v[1], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyx', () => { + it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyy', () => { + it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyz', () => { + it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyw', () => { + it('should return Vec4(y, y, y, w)', () => expect(v.yyyw).toBeVec(v[1], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzx', () => { + it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzy', () => { + it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzz', () => { + it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzw', () => { + it('should return Vec4(y, y, z, w)', () => expect(v.yyzw).toBeVec(v[1], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yywx', () => { + it('should return Vec4(y, y, w, x)', () => expect(v.yywx).toBeVec(v[1], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.yywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yywy', () => { + it('should return Vec4(y, y, w, y)', () => expect(v.yywy).toBeVec(v[1], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.yywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yywz', () => { + it('should return Vec4(y, y, w, z)', () => expect(v.yywz).toBeVec(v[1], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.yywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyww', () => { + it('should return Vec4(y, y, w, w)', () => expect(v.yyww).toBeVec(v[1], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxx', () => { + it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxy', () => { + it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxz', () => { + it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxw', () => { + it('should return Vec4(y, z, x, w)', () => expect(v.yzxw).toBeVec(v[1], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyx', () => { + it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyy', () => { + it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyz', () => { + it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyw', () => { + it('should return Vec4(y, z, y, w)', () => expect(v.yzyw).toBeVec(v[1], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzx', () => { + it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzy', () => { + it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzz', () => { + it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzw', () => { + it('should return Vec4(y, z, z, w)', () => expect(v.yzzw).toBeVec(v[1], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzwx', () => { + it('should return Vec4(y, z, w, x)', () => expect(v.yzwx).toBeVec(v[1], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.yzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzwy', () => { + it('should return Vec4(y, z, w, y)', () => expect(v.yzwy).toBeVec(v[1], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.yzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzwz', () => { + it('should return Vec4(y, z, w, z)', () => expect(v.yzwz).toBeVec(v[1], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.yzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzww', () => { + it('should return Vec4(y, z, w, w)', () => expect(v.yzww).toBeVec(v[1], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxx', () => { + it('should return Vec4(y, w, x, x)', () => expect(v.ywxx).toBeVec(v[1], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ywxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxy', () => { + it('should return Vec4(y, w, x, y)', () => expect(v.ywxy).toBeVec(v[1], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ywxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxz', () => { + it('should return Vec4(y, w, x, z)', () => expect(v.ywxz).toBeVec(v[1], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.ywxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxw', () => { + it('should return Vec4(y, w, x, w)', () => expect(v.ywxw).toBeVec(v[1], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ywxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyx', () => { + it('should return Vec4(y, w, y, x)', () => expect(v.ywyx).toBeVec(v[1], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ywyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyy', () => { + it('should return Vec4(y, w, y, y)', () => expect(v.ywyy).toBeVec(v[1], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ywyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyz', () => { + it('should return Vec4(y, w, y, z)', () => expect(v.ywyz).toBeVec(v[1], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ywyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyw', () => { + it('should return Vec4(y, w, y, w)', () => expect(v.ywyw).toBeVec(v[1], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.ywyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzx', () => { + it('should return Vec4(y, w, z, x)', () => expect(v.ywzx).toBeVec(v[1], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.ywzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzy', () => { + it('should return Vec4(y, w, z, y)', () => expect(v.ywzy).toBeVec(v[1], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.ywzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzz', () => { + it('should return Vec4(y, w, z, z)', () => expect(v.ywzz).toBeVec(v[1], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.ywzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzw', () => { + it('should return Vec4(y, w, z, w)', () => expect(v.ywzw).toBeVec(v[1], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.ywzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywwx', () => { + it('should return Vec4(y, w, w, x)', () => expect(v.ywwx).toBeVec(v[1], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ywwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywwy', () => { + it('should return Vec4(y, w, w, y)', () => expect(v.ywwy).toBeVec(v[1], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ywwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywwz', () => { + it('should return Vec4(y, w, w, z)', () => expect(v.ywwz).toBeVec(v[1], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ywwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywww', () => { + it('should return Vec4(y, w, w, w)', () => expect(v.ywww).toBeVec(v[1], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.ywww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxx', () => { + it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxy', () => { + it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxz', () => { + it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxw', () => { + it('should return Vec4(z, x, x, w)', () => expect(v.zxxw).toBeVec(v[2], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyx', () => { + it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyy', () => { + it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyz', () => { + it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyw', () => { + it('should return Vec4(z, x, y, w)', () => expect(v.zxyw).toBeVec(v[2], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzx', () => { + it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzy', () => { + it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzz', () => { + it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzw', () => { + it('should return Vec4(z, x, z, w)', () => expect(v.zxzw).toBeVec(v[2], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxwx', () => { + it('should return Vec4(z, x, w, x)', () => expect(v.zxwx).toBeVec(v[2], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxwy', () => { + it('should return Vec4(z, x, w, y)', () => expect(v.zxwy).toBeVec(v[2], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxwz', () => { + it('should return Vec4(z, x, w, z)', () => expect(v.zxwz).toBeVec(v[2], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxww', () => { + it('should return Vec4(z, x, w, w)', () => expect(v.zxww).toBeVec(v[2], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxx', () => { + it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxy', () => { + it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxz', () => { + it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxw', () => { + it('should return Vec4(z, y, x, w)', () => expect(v.zyxw).toBeVec(v[2], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyx', () => { + it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyy', () => { + it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyz', () => { + it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyw', () => { + it('should return Vec4(z, y, y, w)', () => expect(v.zyyw).toBeVec(v[2], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzx', () => { + it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzy', () => { + it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzz', () => { + it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzw', () => { + it('should return Vec4(z, y, z, w)', () => expect(v.zyzw).toBeVec(v[2], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zywx', () => { + it('should return Vec4(z, y, w, x)', () => expect(v.zywx).toBeVec(v[2], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zywy', () => { + it('should return Vec4(z, y, w, y)', () => expect(v.zywy).toBeVec(v[2], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zywz', () => { + it('should return Vec4(z, y, w, z)', () => expect(v.zywz).toBeVec(v[2], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyww', () => { + it('should return Vec4(z, y, w, w)', () => expect(v.zyww).toBeVec(v[2], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxx', () => { + it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxy', () => { + it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxz', () => { + it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxw', () => { + it('should return Vec4(z, z, x, w)', () => expect(v.zzxw).toBeVec(v[2], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyx', () => { + it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyy', () => { + it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyz', () => { + it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyw', () => { + it('should return Vec4(z, z, y, w)', () => expect(v.zzyw).toBeVec(v[2], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzx', () => { + it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzy', () => { + it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzz', () => { + it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzw', () => { + it('should return Vec4(z, z, z, w)', () => expect(v.zzzw).toBeVec(v[2], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzwx', () => { + it('should return Vec4(z, z, w, x)', () => expect(v.zzwx).toBeVec(v[2], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzwy', () => { + it('should return Vec4(z, z, w, y)', () => expect(v.zzwy).toBeVec(v[2], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzwz', () => { + it('should return Vec4(z, z, w, z)', () => expect(v.zzwz).toBeVec(v[2], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzww', () => { + it('should return Vec4(z, z, w, w)', () => expect(v.zzww).toBeVec(v[2], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxx', () => { + it('should return Vec4(z, w, x, x)', () => expect(v.zwxx).toBeVec(v[2], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zwxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxy', () => { + it('should return Vec4(z, w, x, y)', () => expect(v.zwxy).toBeVec(v[2], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zwxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxz', () => { + it('should return Vec4(z, w, x, z)', () => expect(v.zwxz).toBeVec(v[2], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zwxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxw', () => { + it('should return Vec4(z, w, x, w)', () => expect(v.zwxw).toBeVec(v[2], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zwxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyx', () => { + it('should return Vec4(z, w, y, x)', () => expect(v.zwyx).toBeVec(v[2], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zwyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyy', () => { + it('should return Vec4(z, w, y, y)', () => expect(v.zwyy).toBeVec(v[2], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zwyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyz', () => { + it('should return Vec4(z, w, y, z)', () => expect(v.zwyz).toBeVec(v[2], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zwyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyw', () => { + it('should return Vec4(z, w, y, w)', () => expect(v.zwyw).toBeVec(v[2], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zwyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzx', () => { + it('should return Vec4(z, w, z, x)', () => expect(v.zwzx).toBeVec(v[2], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zwzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzy', () => { + it('should return Vec4(z, w, z, y)', () => expect(v.zwzy).toBeVec(v[2], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zwzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzz', () => { + it('should return Vec4(z, w, z, z)', () => expect(v.zwzz).toBeVec(v[2], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zwzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzw', () => { + it('should return Vec4(z, w, z, w)', () => expect(v.zwzw).toBeVec(v[2], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zwzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwwx', () => { + it('should return Vec4(z, w, w, x)', () => expect(v.zwwx).toBeVec(v[2], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zwwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwwy', () => { + it('should return Vec4(z, w, w, y)', () => expect(v.zwwy).toBeVec(v[2], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zwwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwwz', () => { + it('should return Vec4(z, w, w, z)', () => expect(v.zwwz).toBeVec(v[2], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zwwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwww', () => { + it('should return Vec4(z, w, w, w)', () => expect(v.zwww).toBeVec(v[2], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zwww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxx', () => { + it('should return Vec4(w, x, x, x)', () => expect(v.wxxx).toBeVec(v[3], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxy', () => { + it('should return Vec4(w, x, x, y)', () => expect(v.wxxy).toBeVec(v[3], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxz', () => { + it('should return Vec4(w, x, x, z)', () => expect(v.wxxz).toBeVec(v[3], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxw', () => { + it('should return Vec4(w, x, x, w)', () => expect(v.wxxw).toBeVec(v[3], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyx', () => { + it('should return Vec4(w, x, y, x)', () => expect(v.wxyx).toBeVec(v[3], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyy', () => { + it('should return Vec4(w, x, y, y)', () => expect(v.wxyy).toBeVec(v[3], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyz', () => { + it('should return Vec4(w, x, y, z)', () => expect(v.wxyz).toBeVec(v[3], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyw', () => { + it('should return Vec4(w, x, y, w)', () => expect(v.wxyw).toBeVec(v[3], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzx', () => { + it('should return Vec4(w, x, z, x)', () => expect(v.wxzx).toBeVec(v[3], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzy', () => { + it('should return Vec4(w, x, z, y)', () => expect(v.wxzy).toBeVec(v[3], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzz', () => { + it('should return Vec4(w, x, z, z)', () => expect(v.wxzz).toBeVec(v[3], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzw', () => { + it('should return Vec4(w, x, z, w)', () => expect(v.wxzw).toBeVec(v[3], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxwx', () => { + it('should return Vec4(w, x, w, x)', () => expect(v.wxwx).toBeVec(v[3], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxwy', () => { + it('should return Vec4(w, x, w, y)', () => expect(v.wxwy).toBeVec(v[3], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxwz', () => { + it('should return Vec4(w, x, w, z)', () => expect(v.wxwz).toBeVec(v[3], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxww', () => { + it('should return Vec4(w, x, w, w)', () => expect(v.wxww).toBeVec(v[3], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxx', () => { + it('should return Vec4(w, y, x, x)', () => expect(v.wyxx).toBeVec(v[3], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxy', () => { + it('should return Vec4(w, y, x, y)', () => expect(v.wyxy).toBeVec(v[3], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxz', () => { + it('should return Vec4(w, y, x, z)', () => expect(v.wyxz).toBeVec(v[3], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxw', () => { + it('should return Vec4(w, y, x, w)', () => expect(v.wyxw).toBeVec(v[3], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyx', () => { + it('should return Vec4(w, y, y, x)', () => expect(v.wyyx).toBeVec(v[3], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyy', () => { + it('should return Vec4(w, y, y, y)', () => expect(v.wyyy).toBeVec(v[3], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyz', () => { + it('should return Vec4(w, y, y, z)', () => expect(v.wyyz).toBeVec(v[3], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyw', () => { + it('should return Vec4(w, y, y, w)', () => expect(v.wyyw).toBeVec(v[3], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzx', () => { + it('should return Vec4(w, y, z, x)', () => expect(v.wyzx).toBeVec(v[3], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzy', () => { + it('should return Vec4(w, y, z, y)', () => expect(v.wyzy).toBeVec(v[3], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzz', () => { + it('should return Vec4(w, y, z, z)', () => expect(v.wyzz).toBeVec(v[3], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzw', () => { + it('should return Vec4(w, y, z, w)', () => expect(v.wyzw).toBeVec(v[3], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wywx', () => { + it('should return Vec4(w, y, w, x)', () => expect(v.wywx).toBeVec(v[3], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wywy', () => { + it('should return Vec4(w, y, w, y)', () => expect(v.wywy).toBeVec(v[3], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wywz', () => { + it('should return Vec4(w, y, w, z)', () => expect(v.wywz).toBeVec(v[3], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyww', () => { + it('should return Vec4(w, y, w, w)', () => expect(v.wyww).toBeVec(v[3], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxx', () => { + it('should return Vec4(w, z, x, x)', () => expect(v.wzxx).toBeVec(v[3], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxy', () => { + it('should return Vec4(w, z, x, y)', () => expect(v.wzxy).toBeVec(v[3], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxz', () => { + it('should return Vec4(w, z, x, z)', () => expect(v.wzxz).toBeVec(v[3], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxw', () => { + it('should return Vec4(w, z, x, w)', () => expect(v.wzxw).toBeVec(v[3], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyx', () => { + it('should return Vec4(w, z, y, x)', () => expect(v.wzyx).toBeVec(v[3], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyy', () => { + it('should return Vec4(w, z, y, y)', () => expect(v.wzyy).toBeVec(v[3], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyz', () => { + it('should return Vec4(w, z, y, z)', () => expect(v.wzyz).toBeVec(v[3], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyw', () => { + it('should return Vec4(w, z, y, w)', () => expect(v.wzyw).toBeVec(v[3], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzx', () => { + it('should return Vec4(w, z, z, x)', () => expect(v.wzzx).toBeVec(v[3], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzy', () => { + it('should return Vec4(w, z, z, y)', () => expect(v.wzzy).toBeVec(v[3], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzz', () => { + it('should return Vec4(w, z, z, z)', () => expect(v.wzzz).toBeVec(v[3], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzw', () => { + it('should return Vec4(w, z, z, w)', () => expect(v.wzzw).toBeVec(v[3], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzwx', () => { + it('should return Vec4(w, z, w, x)', () => expect(v.wzwx).toBeVec(v[3], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzwy', () => { + it('should return Vec4(w, z, w, y)', () => expect(v.wzwy).toBeVec(v[3], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzwz', () => { + it('should return Vec4(w, z, w, z)', () => expect(v.wzwz).toBeVec(v[3], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzww', () => { + it('should return Vec4(w, z, w, w)', () => expect(v.wzww).toBeVec(v[3], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxx', () => { + it('should return Vec4(w, w, x, x)', () => expect(v.wwxx).toBeVec(v[3], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wwxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxy', () => { + it('should return Vec4(w, w, x, y)', () => expect(v.wwxy).toBeVec(v[3], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wwxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxz', () => { + it('should return Vec4(w, w, x, z)', () => expect(v.wwxz).toBeVec(v[3], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wwxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxw', () => { + it('should return Vec4(w, w, x, w)', () => expect(v.wwxw).toBeVec(v[3], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wwxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyx', () => { + it('should return Vec4(w, w, y, x)', () => expect(v.wwyx).toBeVec(v[3], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wwyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyy', () => { + it('should return Vec4(w, w, y, y)', () => expect(v.wwyy).toBeVec(v[3], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wwyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyz', () => { + it('should return Vec4(w, w, y, z)', () => expect(v.wwyz).toBeVec(v[3], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wwyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyw', () => { + it('should return Vec4(w, w, y, w)', () => expect(v.wwyw).toBeVec(v[3], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wwyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzx', () => { + it('should return Vec4(w, w, z, x)', () => expect(v.wwzx).toBeVec(v[3], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wwzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzy', () => { + it('should return Vec4(w, w, z, y)', () => expect(v.wwzy).toBeVec(v[3], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wwzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzz', () => { + it('should return Vec4(w, w, z, z)', () => expect(v.wwzz).toBeVec(v[3], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wwzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzw', () => { + it('should return Vec4(w, w, z, w)', () => expect(v.wwzw).toBeVec(v[3], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wwzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwwx', () => { + it('should return Vec4(w, w, w, x)', () => expect(v.wwwx).toBeVec(v[3], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wwwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwwy', () => { + it('should return Vec4(w, w, w, y)', () => expect(v.wwwy).toBeVec(v[3], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wwwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwwz', () => { + it('should return Vec4(w, w, w, z)', () => expect(v.wwwz).toBeVec(v[3], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wwwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwww', () => { + it('should return Vec4(w, w, w, w)', () => expect(v.wwww).toBeVec(v[3], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wwww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rr', () => { + it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rg', () => { + it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rb', () => { + it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ra', () => { + it('should return Vec2(r, a)', () => expect(v.ra).toBeVec(v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gr', () => { + it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gg', () => { + it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gb', () => { + it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ga', () => { + it('should return Vec2(g, a)', () => expect(v.ga).toBeVec(v[1], v[3])); + it('should be return a copy', () => { + let sw = v.ga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().br', () => { + it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.br; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bg', () => { + it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bb', () => { + it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ba', () => { + it('should return Vec2(b, a)', () => expect(v.ba).toBeVec(v[2], v[3])); + it('should be return a copy', () => { + let sw = v.ba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ar', () => { + it('should return Vec2(a, r)', () => expect(v.ar).toBeVec(v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ag', () => { + it('should return Vec2(a, g)', () => expect(v.ag).toBeVec(v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ab', () => { + it('should return Vec2(a, b)', () => expect(v.ab).toBeVec(v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aa', () => { + it('should return Vec2(a, a)', () => expect(v.aa).toBeVec(v[3], v[3])); + it('should be return a copy', () => { + let sw = v.aa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrr', () => { + it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrg', () => { + it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrb', () => { + it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rra', () => { + it('should return Vec3(r, r, a)', () => expect(v.rra).toBeVec(v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgr', () => { + it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgg', () => { + it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgb', () => { + it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rga', () => { + it('should return Vec3(r, g, a)', () => expect(v.rga).toBeVec(v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbr', () => { + it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbg', () => { + it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbb', () => { + it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rba', () => { + it('should return Vec3(r, b, a)', () => expect(v.rba).toBeVec(v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rar', () => { + it('should return Vec3(r, a, r)', () => expect(v.rar).toBeVec(v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rag', () => { + it('should return Vec3(r, a, g)', () => expect(v.rag).toBeVec(v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rab', () => { + it('should return Vec3(r, a, b)', () => expect(v.rab).toBeVec(v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raa', () => { + it('should return Vec3(r, a, a)', () => expect(v.raa).toBeVec(v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.raa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grr', () => { + it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grg', () => { + it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grb', () => { + it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gra', () => { + it('should return Vec3(g, r, a)', () => expect(v.gra).toBeVec(v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.gra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggr', () => { + it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggg', () => { + it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggb', () => { + it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gga', () => { + it('should return Vec3(g, g, a)', () => expect(v.gga).toBeVec(v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.gga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbr', () => { + it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbg', () => { + it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbb', () => { + it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gba', () => { + it('should return Vec3(g, b, a)', () => expect(v.gba).toBeVec(v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.gba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gar', () => { + it('should return Vec3(g, a, r)', () => expect(v.gar).toBeVec(v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.gar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gag', () => { + it('should return Vec3(g, a, g)', () => expect(v.gag).toBeVec(v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.gag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gab', () => { + it('should return Vec3(g, a, b)', () => expect(v.gab).toBeVec(v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.gab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaa', () => { + it('should return Vec3(g, a, a)', () => expect(v.gaa).toBeVec(v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.gaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brr', () => { + it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brg', () => { + it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brb', () => { + it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bra', () => { + it('should return Vec3(b, r, a)', () => expect(v.bra).toBeVec(v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgr', () => { + it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgg', () => { + it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgb', () => { + it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bga', () => { + it('should return Vec3(b, g, a)', () => expect(v.bga).toBeVec(v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.bga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbr', () => { + it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbg', () => { + it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbb', () => { + it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bba', () => { + it('should return Vec3(b, b, a)', () => expect(v.bba).toBeVec(v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.bba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bar', () => { + it('should return Vec3(b, a, r)', () => expect(v.bar).toBeVec(v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.bar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bag', () => { + it('should return Vec3(b, a, g)', () => expect(v.bag).toBeVec(v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.bag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bab', () => { + it('should return Vec3(b, a, b)', () => expect(v.bab).toBeVec(v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.bab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baa', () => { + it('should return Vec3(b, a, a)', () => expect(v.baa).toBeVec(v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.baa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arr', () => { + it('should return Vec3(a, r, r)', () => expect(v.arr).toBeVec(v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.arr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arg', () => { + it('should return Vec3(a, r, g)', () => expect(v.arg).toBeVec(v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.arg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arb', () => { + it('should return Vec3(a, r, b)', () => expect(v.arb).toBeVec(v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.arb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ara', () => { + it('should return Vec3(a, r, a)', () => expect(v.ara).toBeVec(v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agr', () => { + it('should return Vec3(a, g, r)', () => expect(v.agr).toBeVec(v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.agr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agg', () => { + it('should return Vec3(a, g, g)', () => expect(v.agg).toBeVec(v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.agg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agb', () => { + it('should return Vec3(a, g, b)', () => expect(v.agb).toBeVec(v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.agb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aga', () => { + it('should return Vec3(a, g, a)', () => expect(v.aga).toBeVec(v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.aga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abr', () => { + it('should return Vec3(a, b, r)', () => expect(v.abr).toBeVec(v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.abr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abg', () => { + it('should return Vec3(a, b, g)', () => expect(v.abg).toBeVec(v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.abg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abb', () => { + it('should return Vec3(a, b, b)', () => expect(v.abb).toBeVec(v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.abb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aba', () => { + it('should return Vec3(a, b, a)', () => expect(v.aba).toBeVec(v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.aba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aar', () => { + it('should return Vec3(a, a, r)', () => expect(v.aar).toBeVec(v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.aar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aag', () => { + it('should return Vec3(a, a, g)', () => expect(v.aag).toBeVec(v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.aag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aab', () => { + it('should return Vec3(a, a, b)', () => expect(v.aab).toBeVec(v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.aab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaa', () => { + it('should return Vec3(a, a, a)', () => expect(v.aaa).toBeVec(v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.aaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrrr', () => { + it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrrg', () => { + it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrrb', () => { + it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrra', () => { + it('should return Vec4(r, r, r, a)', () => expect(v.rrra).toBeVec(v[0], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rrra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrgr', () => { + it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rrgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrgg', () => { + it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rrgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrgb', () => { + it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rrgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrga', () => { + it('should return Vec4(r, r, g, a)', () => expect(v.rrga).toBeVec(v[0], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rrga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrbr', () => { + it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rrbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrbg', () => { + it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rrbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrbb', () => { + it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rrbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrba', () => { + it('should return Vec4(r, r, b, a)', () => expect(v.rrba).toBeVec(v[0], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rrba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrar', () => { + it('should return Vec4(r, r, a, r)', () => expect(v.rrar).toBeVec(v[0], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rrar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrag', () => { + it('should return Vec4(r, r, a, g)', () => expect(v.rrag).toBeVec(v[0], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rrag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrab', () => { + it('should return Vec4(r, r, a, b)', () => expect(v.rrab).toBeVec(v[0], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rrab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rraa', () => { + it('should return Vec4(r, r, a, a)', () => expect(v.rraa).toBeVec(v[0], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.rraa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgrr', () => { + it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgrg', () => { + it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgrb', () => { + it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgra', () => { + it('should return Vec4(r, g, r, a)', () => expect(v.rgra).toBeVec(v[0], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rgra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rggr', () => { + it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rggg', () => { + it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rggb', () => { + it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgga', () => { + it('should return Vec4(r, g, g, a)', () => expect(v.rgga).toBeVec(v[0], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rgga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgbr', () => { + it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgbg', () => { + it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgbb', () => { + it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgba', () => { + it('should return Vec4(r, g, b, a)', () => expect(v.rgba).toBeVec(v[0], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rgba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgar', () => { + it('should return Vec4(r, g, a, r)', () => expect(v.rgar).toBeVec(v[0], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rgar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgag', () => { + it('should return Vec4(r, g, a, g)', () => expect(v.rgag).toBeVec(v[0], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rgag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgab', () => { + it('should return Vec4(r, g, a, b)', () => expect(v.rgab).toBeVec(v[0], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rgab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgaa', () => { + it('should return Vec4(r, g, a, a)', () => expect(v.rgaa).toBeVec(v[0], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.rgaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbrr', () => { + it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbrg', () => { + it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbrb', () => { + it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbra', () => { + it('should return Vec4(r, b, r, a)', () => expect(v.rbra).toBeVec(v[0], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rbra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbgr', () => { + it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbgg', () => { + it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbgb', () => { + it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbga', () => { + it('should return Vec4(r, b, g, a)', () => expect(v.rbga).toBeVec(v[0], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rbga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbbr', () => { + it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbbg', () => { + it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbbb', () => { + it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbba', () => { + it('should return Vec4(r, b, b, a)', () => expect(v.rbba).toBeVec(v[0], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rbba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbar', () => { + it('should return Vec4(r, b, a, r)', () => expect(v.rbar).toBeVec(v[0], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rbar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbag', () => { + it('should return Vec4(r, b, a, g)', () => expect(v.rbag).toBeVec(v[0], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rbag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbab', () => { + it('should return Vec4(r, b, a, b)', () => expect(v.rbab).toBeVec(v[0], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rbab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbaa', () => { + it('should return Vec4(r, b, a, a)', () => expect(v.rbaa).toBeVec(v[0], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.rbaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rarr', () => { + it('should return Vec4(r, a, r, r)', () => expect(v.rarr).toBeVec(v[0], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rarr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rarg', () => { + it('should return Vec4(r, a, r, g)', () => expect(v.rarg).toBeVec(v[0], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rarg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rarb', () => { + it('should return Vec4(r, a, r, b)', () => expect(v.rarb).toBeVec(v[0], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rarb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rara', () => { + it('should return Vec4(r, a, r, a)', () => expect(v.rara).toBeVec(v[0], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ragr', () => { + it('should return Vec4(r, a, g, r)', () => expect(v.ragr).toBeVec(v[0], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ragr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ragg', () => { + it('should return Vec4(r, a, g, g)', () => expect(v.ragg).toBeVec(v[0], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ragg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ragb', () => { + it('should return Vec4(r, a, g, b)', () => expect(v.ragb).toBeVec(v[0], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ragb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raga', () => { + it('should return Vec4(r, a, g, a)', () => expect(v.raga).toBeVec(v[0], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.raga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rabr', () => { + it('should return Vec4(r, a, b, r)', () => expect(v.rabr).toBeVec(v[0], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rabr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rabg', () => { + it('should return Vec4(r, a, b, g)', () => expect(v.rabg).toBeVec(v[0], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rabg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rabb', () => { + it('should return Vec4(r, a, b, b)', () => expect(v.rabb).toBeVec(v[0], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rabb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raba', () => { + it('should return Vec4(r, a, b, a)', () => expect(v.raba).toBeVec(v[0], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.raba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raar', () => { + it('should return Vec4(r, a, a, r)', () => expect(v.raar).toBeVec(v[0], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.raar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raag', () => { + it('should return Vec4(r, a, a, g)', () => expect(v.raag).toBeVec(v[0], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.raag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raab', () => { + it('should return Vec4(r, a, a, b)', () => expect(v.raab).toBeVec(v[0], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.raab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raaa', () => { + it('should return Vec4(r, a, a, a)', () => expect(v.raaa).toBeVec(v[0], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.raaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grrr', () => { + it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grrg', () => { + it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grrb', () => { + it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grra', () => { + it('should return Vec4(g, r, r, a)', () => expect(v.grra).toBeVec(v[1], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.grra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grgr', () => { + it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.grgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grgg', () => { + it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.grgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grgb', () => { + it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.grgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grga', () => { + it('should return Vec4(g, r, g, a)', () => expect(v.grga).toBeVec(v[1], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.grga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grbr', () => { + it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.grbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grbg', () => { + it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.grbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grbb', () => { + it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.grbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grba', () => { + it('should return Vec4(g, r, b, a)', () => expect(v.grba).toBeVec(v[1], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.grba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grar', () => { + it('should return Vec4(g, r, a, r)', () => expect(v.grar).toBeVec(v[1], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.grar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grag', () => { + it('should return Vec4(g, r, a, g)', () => expect(v.grag).toBeVec(v[1], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.grag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grab', () => { + it('should return Vec4(g, r, a, b)', () => expect(v.grab).toBeVec(v[1], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.grab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().graa', () => { + it('should return Vec4(g, r, a, a)', () => expect(v.graa).toBeVec(v[1], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.graa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggrr', () => { + it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ggrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggrg', () => { + it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ggrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggrb', () => { + it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.ggrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggra', () => { + it('should return Vec4(g, g, r, a)', () => expect(v.ggra).toBeVec(v[1], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ggra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gggr', () => { + it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gggg', () => { + it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gggb', () => { + it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggga', () => { + it('should return Vec4(g, g, g, a)', () => expect(v.ggga).toBeVec(v[1], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.ggga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggbr', () => { + it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.ggbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggbg', () => { + it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.ggbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggbb', () => { + it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.ggbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggba', () => { + it('should return Vec4(g, g, b, a)', () => expect(v.ggba).toBeVec(v[1], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.ggba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggar', () => { + it('should return Vec4(g, g, a, r)', () => expect(v.ggar).toBeVec(v[1], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ggar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggag', () => { + it('should return Vec4(g, g, a, g)', () => expect(v.ggag).toBeVec(v[1], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ggag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggab', () => { + it('should return Vec4(g, g, a, b)', () => expect(v.ggab).toBeVec(v[1], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ggab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggaa', () => { + it('should return Vec4(g, g, a, a)', () => expect(v.ggaa).toBeVec(v[1], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.ggaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbrr', () => { + it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.gbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbrg', () => { + it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.gbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbrb', () => { + it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.gbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbra', () => { + it('should return Vec4(g, b, r, a)', () => expect(v.gbra).toBeVec(v[1], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.gbra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbgr', () => { + it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbgg', () => { + it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbgb', () => { + it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbga', () => { + it('should return Vec4(g, b, g, a)', () => expect(v.gbga).toBeVec(v[1], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.gbga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbbr', () => { + it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbbg', () => { + it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbbb', () => { + it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbba', () => { + it('should return Vec4(g, b, b, a)', () => expect(v.gbba).toBeVec(v[1], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.gbba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbar', () => { + it('should return Vec4(g, b, a, r)', () => expect(v.gbar).toBeVec(v[1], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.gbar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbag', () => { + it('should return Vec4(g, b, a, g)', () => expect(v.gbag).toBeVec(v[1], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.gbag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbab', () => { + it('should return Vec4(g, b, a, b)', () => expect(v.gbab).toBeVec(v[1], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.gbab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbaa', () => { + it('should return Vec4(g, b, a, a)', () => expect(v.gbaa).toBeVec(v[1], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.gbaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().garr', () => { + it('should return Vec4(g, a, r, r)', () => expect(v.garr).toBeVec(v[1], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.garr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().garg', () => { + it('should return Vec4(g, a, r, g)', () => expect(v.garg).toBeVec(v[1], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.garg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().garb', () => { + it('should return Vec4(g, a, r, b)', () => expect(v.garb).toBeVec(v[1], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.garb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gara', () => { + it('should return Vec4(g, a, r, a)', () => expect(v.gara).toBeVec(v[1], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.gara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gagr', () => { + it('should return Vec4(g, a, g, r)', () => expect(v.gagr).toBeVec(v[1], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gagr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gagg', () => { + it('should return Vec4(g, a, g, g)', () => expect(v.gagg).toBeVec(v[1], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gagg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gagb', () => { + it('should return Vec4(g, a, g, b)', () => expect(v.gagb).toBeVec(v[1], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gagb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaga', () => { + it('should return Vec4(g, a, g, a)', () => expect(v.gaga).toBeVec(v[1], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.gaga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gabr', () => { + it('should return Vec4(g, a, b, r)', () => expect(v.gabr).toBeVec(v[1], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gabr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gabg', () => { + it('should return Vec4(g, a, b, g)', () => expect(v.gabg).toBeVec(v[1], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gabg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gabb', () => { + it('should return Vec4(g, a, b, b)', () => expect(v.gabb).toBeVec(v[1], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gabb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaba', () => { + it('should return Vec4(g, a, b, a)', () => expect(v.gaba).toBeVec(v[1], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.gaba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaar', () => { + it('should return Vec4(g, a, a, r)', () => expect(v.gaar).toBeVec(v[1], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.gaar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaag', () => { + it('should return Vec4(g, a, a, g)', () => expect(v.gaag).toBeVec(v[1], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.gaag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaab', () => { + it('should return Vec4(g, a, a, b)', () => expect(v.gaab).toBeVec(v[1], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.gaab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaaa', () => { + it('should return Vec4(g, a, a, a)', () => expect(v.gaaa).toBeVec(v[1], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.gaaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brrr', () => { + it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brrg', () => { + it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brrb', () => { + it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brra', () => { + it('should return Vec4(b, r, r, a)', () => expect(v.brra).toBeVec(v[2], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.brra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brgr', () => { + it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.brgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brgg', () => { + it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.brgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brgb', () => { + it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.brgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brga', () => { + it('should return Vec4(b, r, g, a)', () => expect(v.brga).toBeVec(v[2], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.brga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brbr', () => { + it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.brbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brbg', () => { + it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.brbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brbb', () => { + it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.brbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brba', () => { + it('should return Vec4(b, r, b, a)', () => expect(v.brba).toBeVec(v[2], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.brba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brar', () => { + it('should return Vec4(b, r, a, r)', () => expect(v.brar).toBeVec(v[2], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.brar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brag', () => { + it('should return Vec4(b, r, a, g)', () => expect(v.brag).toBeVec(v[2], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.brag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brab', () => { + it('should return Vec4(b, r, a, b)', () => expect(v.brab).toBeVec(v[2], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.brab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().braa', () => { + it('should return Vec4(b, r, a, a)', () => expect(v.braa).toBeVec(v[2], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.braa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgrr', () => { + it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgrg', () => { + it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgrb', () => { + it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgra', () => { + it('should return Vec4(b, g, r, a)', () => expect(v.bgra).toBeVec(v[2], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bgra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bggr', () => { + it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bggg', () => { + it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bggb', () => { + it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgga', () => { + it('should return Vec4(b, g, g, a)', () => expect(v.bgga).toBeVec(v[2], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.bgga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgbr', () => { + it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgbg', () => { + it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgbb', () => { + it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgba', () => { + it('should return Vec4(b, g, b, a)', () => expect(v.bgba).toBeVec(v[2], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.bgba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgar', () => { + it('should return Vec4(b, g, a, r)', () => expect(v.bgar).toBeVec(v[2], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.bgar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgag', () => { + it('should return Vec4(b, g, a, g)', () => expect(v.bgag).toBeVec(v[2], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.bgag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgab', () => { + it('should return Vec4(b, g, a, b)', () => expect(v.bgab).toBeVec(v[2], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.bgab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgaa', () => { + it('should return Vec4(b, g, a, a)', () => expect(v.bgaa).toBeVec(v[2], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.bgaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbrr', () => { + it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbrg', () => { + it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbrb', () => { + it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbra', () => { + it('should return Vec4(b, b, r, a)', () => expect(v.bbra).toBeVec(v[2], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bbra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbgr', () => { + it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbgg', () => { + it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbgb', () => { + it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbga', () => { + it('should return Vec4(b, b, g, a)', () => expect(v.bbga).toBeVec(v[2], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.bbga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbbr', () => { + it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbbg', () => { + it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbbb', () => { + it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbba', () => { + it('should return Vec4(b, b, b, a)', () => expect(v.bbba).toBeVec(v[2], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.bbba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbar', () => { + it('should return Vec4(b, b, a, r)', () => expect(v.bbar).toBeVec(v[2], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.bbar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbag', () => { + it('should return Vec4(b, b, a, g)', () => expect(v.bbag).toBeVec(v[2], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.bbag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbab', () => { + it('should return Vec4(b, b, a, b)', () => expect(v.bbab).toBeVec(v[2], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.bbab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbaa', () => { + it('should return Vec4(b, b, a, a)', () => expect(v.bbaa).toBeVec(v[2], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.bbaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().barr', () => { + it('should return Vec4(b, a, r, r)', () => expect(v.barr).toBeVec(v[2], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.barr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().barg', () => { + it('should return Vec4(b, a, r, g)', () => expect(v.barg).toBeVec(v[2], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.barg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().barb', () => { + it('should return Vec4(b, a, r, b)', () => expect(v.barb).toBeVec(v[2], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.barb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bara', () => { + it('should return Vec4(b, a, r, a)', () => expect(v.bara).toBeVec(v[2], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bagr', () => { + it('should return Vec4(b, a, g, r)', () => expect(v.bagr).toBeVec(v[2], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bagr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bagg', () => { + it('should return Vec4(b, a, g, g)', () => expect(v.bagg).toBeVec(v[2], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bagg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bagb', () => { + it('should return Vec4(b, a, g, b)', () => expect(v.bagb).toBeVec(v[2], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bagb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baga', () => { + it('should return Vec4(b, a, g, a)', () => expect(v.baga).toBeVec(v[2], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.baga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().babr', () => { + it('should return Vec4(b, a, b, r)', () => expect(v.babr).toBeVec(v[2], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.babr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().babg', () => { + it('should return Vec4(b, a, b, g)', () => expect(v.babg).toBeVec(v[2], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.babg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().babb', () => { + it('should return Vec4(b, a, b, b)', () => expect(v.babb).toBeVec(v[2], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.babb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baba', () => { + it('should return Vec4(b, a, b, a)', () => expect(v.baba).toBeVec(v[2], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.baba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baar', () => { + it('should return Vec4(b, a, a, r)', () => expect(v.baar).toBeVec(v[2], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.baar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baag', () => { + it('should return Vec4(b, a, a, g)', () => expect(v.baag).toBeVec(v[2], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.baag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baab', () => { + it('should return Vec4(b, a, a, b)', () => expect(v.baab).toBeVec(v[2], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.baab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baaa', () => { + it('should return Vec4(b, a, a, a)', () => expect(v.baaa).toBeVec(v[2], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.baaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arrr', () => { + it('should return Vec4(a, r, r, r)', () => expect(v.arrr).toBeVec(v[3], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.arrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arrg', () => { + it('should return Vec4(a, r, r, g)', () => expect(v.arrg).toBeVec(v[3], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.arrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arrb', () => { + it('should return Vec4(a, r, r, b)', () => expect(v.arrb).toBeVec(v[3], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.arrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arra', () => { + it('should return Vec4(a, r, r, a)', () => expect(v.arra).toBeVec(v[3], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.arra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().argr', () => { + it('should return Vec4(a, r, g, r)', () => expect(v.argr).toBeVec(v[3], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.argr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().argg', () => { + it('should return Vec4(a, r, g, g)', () => expect(v.argg).toBeVec(v[3], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.argg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().argb', () => { + it('should return Vec4(a, r, g, b)', () => expect(v.argb).toBeVec(v[3], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.argb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arga', () => { + it('should return Vec4(a, r, g, a)', () => expect(v.arga).toBeVec(v[3], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.arga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arbr', () => { + it('should return Vec4(a, r, b, r)', () => expect(v.arbr).toBeVec(v[3], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.arbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arbg', () => { + it('should return Vec4(a, r, b, g)', () => expect(v.arbg).toBeVec(v[3], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.arbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arbb', () => { + it('should return Vec4(a, r, b, b)', () => expect(v.arbb).toBeVec(v[3], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.arbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arba', () => { + it('should return Vec4(a, r, b, a)', () => expect(v.arba).toBeVec(v[3], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.arba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arar', () => { + it('should return Vec4(a, r, a, r)', () => expect(v.arar).toBeVec(v[3], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.arar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arag', () => { + it('should return Vec4(a, r, a, g)', () => expect(v.arag).toBeVec(v[3], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.arag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arab', () => { + it('should return Vec4(a, r, a, b)', () => expect(v.arab).toBeVec(v[3], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.arab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().araa', () => { + it('should return Vec4(a, r, a, a)', () => expect(v.araa).toBeVec(v[3], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.araa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agrr', () => { + it('should return Vec4(a, g, r, r)', () => expect(v.agrr).toBeVec(v[3], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.agrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agrg', () => { + it('should return Vec4(a, g, r, g)', () => expect(v.agrg).toBeVec(v[3], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.agrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agrb', () => { + it('should return Vec4(a, g, r, b)', () => expect(v.agrb).toBeVec(v[3], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.agrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agra', () => { + it('should return Vec4(a, g, r, a)', () => expect(v.agra).toBeVec(v[3], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.agra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aggr', () => { + it('should return Vec4(a, g, g, r)', () => expect(v.aggr).toBeVec(v[3], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.aggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aggg', () => { + it('should return Vec4(a, g, g, g)', () => expect(v.aggg).toBeVec(v[3], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.aggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aggb', () => { + it('should return Vec4(a, g, g, b)', () => expect(v.aggb).toBeVec(v[3], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.aggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agga', () => { + it('should return Vec4(a, g, g, a)', () => expect(v.agga).toBeVec(v[3], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.agga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agbr', () => { + it('should return Vec4(a, g, b, r)', () => expect(v.agbr).toBeVec(v[3], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.agbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agbg', () => { + it('should return Vec4(a, g, b, g)', () => expect(v.agbg).toBeVec(v[3], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.agbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agbb', () => { + it('should return Vec4(a, g, b, b)', () => expect(v.agbb).toBeVec(v[3], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.agbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agba', () => { + it('should return Vec4(a, g, b, a)', () => expect(v.agba).toBeVec(v[3], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.agba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agar', () => { + it('should return Vec4(a, g, a, r)', () => expect(v.agar).toBeVec(v[3], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.agar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agag', () => { + it('should return Vec4(a, g, a, g)', () => expect(v.agag).toBeVec(v[3], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.agag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agab', () => { + it('should return Vec4(a, g, a, b)', () => expect(v.agab).toBeVec(v[3], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.agab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agaa', () => { + it('should return Vec4(a, g, a, a)', () => expect(v.agaa).toBeVec(v[3], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.agaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abrr', () => { + it('should return Vec4(a, b, r, r)', () => expect(v.abrr).toBeVec(v[3], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.abrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abrg', () => { + it('should return Vec4(a, b, r, g)', () => expect(v.abrg).toBeVec(v[3], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.abrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abrb', () => { + it('should return Vec4(a, b, r, b)', () => expect(v.abrb).toBeVec(v[3], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.abrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abra', () => { + it('should return Vec4(a, b, r, a)', () => expect(v.abra).toBeVec(v[3], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.abra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abgr', () => { + it('should return Vec4(a, b, g, r)', () => expect(v.abgr).toBeVec(v[3], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.abgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abgg', () => { + it('should return Vec4(a, b, g, g)', () => expect(v.abgg).toBeVec(v[3], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.abgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abgb', () => { + it('should return Vec4(a, b, g, b)', () => expect(v.abgb).toBeVec(v[3], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.abgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abga', () => { + it('should return Vec4(a, b, g, a)', () => expect(v.abga).toBeVec(v[3], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.abga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abbr', () => { + it('should return Vec4(a, b, b, r)', () => expect(v.abbr).toBeVec(v[3], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.abbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abbg', () => { + it('should return Vec4(a, b, b, g)', () => expect(v.abbg).toBeVec(v[3], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.abbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abbb', () => { + it('should return Vec4(a, b, b, b)', () => expect(v.abbb).toBeVec(v[3], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.abbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abba', () => { + it('should return Vec4(a, b, b, a)', () => expect(v.abba).toBeVec(v[3], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.abba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abar', () => { + it('should return Vec4(a, b, a, r)', () => expect(v.abar).toBeVec(v[3], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.abar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abag', () => { + it('should return Vec4(a, b, a, g)', () => expect(v.abag).toBeVec(v[3], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.abag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abab', () => { + it('should return Vec4(a, b, a, b)', () => expect(v.abab).toBeVec(v[3], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.abab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abaa', () => { + it('should return Vec4(a, b, a, a)', () => expect(v.abaa).toBeVec(v[3], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.abaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aarr', () => { + it('should return Vec4(a, a, r, r)', () => expect(v.aarr).toBeVec(v[3], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.aarr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aarg', () => { + it('should return Vec4(a, a, r, g)', () => expect(v.aarg).toBeVec(v[3], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.aarg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aarb', () => { + it('should return Vec4(a, a, r, b)', () => expect(v.aarb).toBeVec(v[3], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.aarb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aara', () => { + it('should return Vec4(a, a, r, a)', () => expect(v.aara).toBeVec(v[3], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.aara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aagr', () => { + it('should return Vec4(a, a, g, r)', () => expect(v.aagr).toBeVec(v[3], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.aagr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aagg', () => { + it('should return Vec4(a, a, g, g)', () => expect(v.aagg).toBeVec(v[3], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.aagg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aagb', () => { + it('should return Vec4(a, a, g, b)', () => expect(v.aagb).toBeVec(v[3], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.aagb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaga', () => { + it('should return Vec4(a, a, g, a)', () => expect(v.aaga).toBeVec(v[3], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.aaga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aabr', () => { + it('should return Vec4(a, a, b, r)', () => expect(v.aabr).toBeVec(v[3], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.aabr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aabg', () => { + it('should return Vec4(a, a, b, g)', () => expect(v.aabg).toBeVec(v[3], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.aabg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aabb', () => { + it('should return Vec4(a, a, b, b)', () => expect(v.aabb).toBeVec(v[3], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.aabb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaba', () => { + it('should return Vec4(a, a, b, a)', () => expect(v.aaba).toBeVec(v[3], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.aaba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaar', () => { + it('should return Vec4(a, a, a, r)', () => expect(v.aaar).toBeVec(v[3], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.aaar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaag', () => { + it('should return Vec4(a, a, a, g)', () => expect(v.aaag).toBeVec(v[3], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.aaag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaab', () => { + it('should return Vec4(a, a, a, b)', () => expect(v.aaab).toBeVec(v[3], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.aaab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaaa', () => { + it('should return Vec4(a, a, a, a)', () => expect(v.aaaa).toBeVec(v[3], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.aaaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + // [/Swizzle Autogen] +}); diff --git a/tests/f32/Vec4.spec.ts b/tests/f32/Vec4.spec.ts new file mode 100644 index 00000000..6d32c142 --- /dev/null +++ b/tests/f32/Vec4.spec.ts @@ -0,0 +1,700 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec4 } from '#gl-matrix'; + +import type { Vec4Like } from '#gl-matrix/types'; + +describe('Vec4', () => { + describe('constructor', () => { + it('should return Vec4(0, 0, 0, 0) if called with no arguments', () => expect(new Vec4()).toBeVec(0, 0, 0, 0)); + + it('should return Vec4(x, y, z, w) if called with (x, y, z, w)', () => { + expect(new Vec4(1, 2, 3, 4)).toBeVec(1, 2, 3, 4); + expect(new Vec4(-3, 4.4, -5.6, 7.8)).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Vec4(x, x, x) if called with (x)', () => { + expect(new Vec4(1)).toBeVec(1, 1, 1, 1); + expect(new Vec4(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3); + }); + + it('should return Vec4(x, y, z, w) if called with ([x, y, z, w])', () => { + expect(new Vec4([1, 2, 3, 4])).toBeVec(1, 2, 3, 4); + expect(new Vec4([-3, 4.4, -5.6, 7.8])).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Vec4(x, y, z, w) if called with (Vec4(x, y, z, w))', () => { + let v = new Vec4(3.4, 5.6, 7.8, 9); + expect(new Vec4(v)).toBeVec(v); + }); + + it('should return Vec4(x, y, z, w) if called with (Float32Array([x, y, z, w]))', () => { + let arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); + expect(new Vec4(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Vec4Like; + let vecA: Vec4Like; + let vecB: Vec4Like; + let result: any; + + beforeEach(() => { + vecA = new Vec4(1, 2, 3, 4); + vecB = new Vec4(5, 6, 7, 8); + out = new Vec4(0, 0, 0, 0); + }); + + describe('create', () => { + beforeEach(() => { result = Vec4.create(); }); + + it('should return a 4 element array initialized to 0s', () => expect(result).toBeVec(0, 0, 0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Vec4.clone(vecA); }); + + it('should return a 4 element array initialized to the values in vecA', () => expect(result).toBeVec(vecA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Vec4.fromValues(1, 2, 3, 4); }); + + it('should return a 4 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3, 4)); + }); + + describe('copy', () => { + beforeEach(() => { result = Vec4.copy(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Vec4.set(out, 1, 2, 3, 4); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(6, 8, 10, 12)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(6, 8, 10, 12)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Vec4.sub).toEqual(Vec4.subtract)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.subtract(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-4, -4, -4, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.subtract(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-4, -4, -4, -4)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.subtract(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-4, -4, -4, -4)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Vec4.mul).toEqual(Vec4.multiply)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.multiply(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(5, 12, 21, 32)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.multiply(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(5, 12, 21, 32)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.multiply(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(5, 12, 21, 32)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('divide', () => { + it('should have an alias called `div`', () => expect(Vec4.div).toEqual(Vec4.divide)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.divide(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(0.2, 0.333333, 0.428571, 0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.divide(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0.2, 0.333333, 0.428571, 0.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.divide(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0.2, 0.333333, 0.428571, 0.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('ceil', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.ceil(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 2, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.ceil(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4, 2, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('floor', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.floor(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3, 1, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.floor(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3, 1, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('min', () => { + beforeEach(() => { + vecA = [1, 3, 1, 3]; + vecB = [3, 1, 3, 1]; + }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.min(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1, 1, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.min(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1, 1, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.min(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(1, 1, 1, 1)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + }); + }); + + describe('max', () => { + beforeEach(() => { + vecA = [1, 3, 1, 3]; + vecB = [3, 1, 3, 1]; + }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.max(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 3, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.max(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 3, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.max(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 3, 3, 3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + }); + }); + + describe('round', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.round(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 1, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.round(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 1, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scale', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.scale(out, vecA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.scale(vecA, vecA, 2); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 4, 6, 8)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scaleAndAdd', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3.5, 5, 6.5, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3.5, 5, 6.5, 8)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3.5, 5, 6.5, 8)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('distance', () => { + beforeEach(() => { result = Vec4.distance(vecA, vecB); }); + + it('should have an alias called `dist`', () => expect(Vec4.dist).toEqual(Vec4.distance)); + it('should return the distance', () => expect(result).toBeCloseTo(8)); + }); + + describe('squaredDistance', () => { + beforeEach(() => { result = Vec4.squaredDistance(vecA, vecB); }); + + it('should have an alias called `sqrDist`', () => expect(Vec4.sqrDist).toEqual(Vec4.squaredDistance)); + it('should return the squared distance', () => expect(result).toEqual(64)); + }); + + describe('length', () => { + beforeEach(() => { result = Vec4.len(vecA); }); + + it('should have an alias called `len`', () => expect(Vec4.len).toEqual(Vec4.length)); + it('should return the length', () => expect(result).toBeCloseTo(5.477225)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Vec4.squaredLength(vecA); }); + + it('should have an alias called `sqrLen`', () => expect(Vec4.sqrLen).toEqual(Vec4.squaredLength)); + it('should return the squared length', () => expect(result).toEqual(30)); + }); + + describe('negate', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.negate(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2, -3, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.negate(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-1, -2, -3, -4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('inverse', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.inverse(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3, 1/4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.inverse(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3, 1/4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('abs', () => { + beforeEach(() => { vecA = [-1, -2, -3, -4]; }); + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.abs(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(-1, -2, -3, -4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.abs(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('normalize', () => { + beforeEach(() => { vecA = [5, 0, 0, 0]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.normalize(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(5, 0, 0, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.normalize(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('dot', () => { + beforeEach(() => { result = Vec4.dot(vecA, vecB); }); + + it('should return the dot product', () => expect(result).toEqual(70)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('lerp', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.lerp(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.lerp(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4, 5, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.lerp(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 4, 5, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + /*describe('random', () => { + describe('with no scale', () => { + beforeEach(() => { result = Vec4.random(out); }); + + it('should result in a unit length vector', () => expect(Vec4.len(out)).toBeCloseTo(1.0)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a scale', () => { + beforeEach(() => { result = Vec4.random(out, 5.0); }); + + it('should result in a unit length vector', () => expect(Vec4.len(out)).toBeCloseTo(5.0)); + it('should return out', () => expect(result).toBe(out)); + }); + });*/ + + describe('cross', () => { + let vecC: Vec4Like; + + beforeEach(() => { + vecA = new Vec4(1, 0, 0, 0); + vecB = new Vec4(0, 1, 0, 0); + vecC = [0, 0, 1, 0]; + }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.cross(out, vecA,vecB,vecC); }); + + it('should place values into out', () => expect(out).toBeVec(0, 0, 0, -1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); + it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.cross(vecA, vecA,vecB,vecC); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0, 0, 0,-1)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); + it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); + }); + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.cross(vecB, vecA,vecB,vecC); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0, 0, 0,-1)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); + }); + describe('when vecC is the output vector', () => { + beforeEach(() => { result = Vec4.cross(vecC, vecA,vecB,vecC); }); + + it('should place values into vecC', () => expect(vecC).toBeVec(0, 0, 0,-1)); + it('should return vecC', () => expect(result).toBe(vecC)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); + }); + }); + + /*describe('forEach', () => { + let vecArray; + + beforeEach(() => { + vecArray = [ + 1, 2, 3, 4, + 5, 6, 7, 8, + 0, 0, 0, 0 + ]; + }); + + describe('when performing operations that take no extra arguments', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 0, Vec4.normalize); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 0.182574, 0.365148, 0.547722, 0.730296, + 0.379049, 0.454858, 0.530668, 0.606478, + 0, 0, 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + + describe('when performing operations that takes one extra arguments', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 0, Vec4.add, vecA); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 6, 8, 10, 12, + 1, 2, 3, 4 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when specifying an offset', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 4, 0, Vec4.add, vecA); }); + + it('should update all values except the first vector', () => { + expect(vecArray).toBeEqualish([ + 1, 2, 3, 4, + 6, 8, 10, 12, + 1, 2, 3, 4 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when specifying a count', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 2, Vec4.add, vecA); }); + + it('should update all values except the last vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 6, 8, 10, 12, + 0, 0, 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when specifying a stride', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 8, 0, 0, Vec4.add, vecA); }); + + it('should update all values except the second vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 5, 6, 7, 8, + 1, 2, 3, 4 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when calling a function that does not modify the out variable', () => { + beforeEach(() => { result = vec3.forEach(vecArray, 0, 0, 0, function(out, vec) {}); }); + + it('values should remain unchanged', () => { + expect(vecArray).toBeEqualish([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 0, 0, 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + });*/ + + describe('str', () => { + it('should return a string representation of the vector', + () => expect(Vec4.str(vecA)).toEqual('Vec4(1, 2, 3, 4)')); + }); + + describe('exactEquals', () => { + let vecC: Vec4Like, r0: boolean, r1: boolean; + + beforeEach(() => { + vecA = [0, 1, 2, 3]; + vecB = [0, 1, 2, 3]; + vecC = [1, 2, 3, 4]; + r0 = Vec4.exactEquals(vecA, vecB); + r1 = Vec4.exactEquals(vecA, vecC); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2, 3)); + }); + + describe('equals', () => { + let vecC: Vec4Like, vecD: Vec4Like, r0: boolean, r1: boolean, r2: boolean; + + beforeEach(() => { + vecA = [0, 1, 2, 3]; + vecB = [0, 1, 2, 3]; + vecC = [1, 2, 3, 4]; + vecD = [1e-16, 1, 2, 3]; + r0 = Vec4.equals(vecA, vecB); + r1 = Vec4.equals(vecA, vecC); + r2 = Vec4.equals(vecA, vecD); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should return true for close but not identical vectors', () => expect(r2).toBe(true)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2, 3)); + }); + + describe('zero', () => { + beforeEach(() => { + vecA = [1, 2, 3, 4]; + result = Vec4.zero(vecA); + }); + + it('should result in a 4 element vector with zeros', () => expect(result).toBeVec(0, 0, 0, 0)); + }); + }); +}); diff --git a/tests/f32/util.spec.ts b/tests/f32/util.spec.ts new file mode 100644 index 00000000..534dc745 --- /dev/null +++ b/tests/f32/util.spec.ts @@ -0,0 +1,19 @@ +import { expect, describe, it } from 'vitest'; + +import { toDegree, toRadian } from '#gl-matrix/util'; + +describe('Common', () => { + describe('toRadian', () => { + it('should return a value of 0 when passed 0', () => expect(toRadian(0)).toBeCloseTo(0)); + it('should return a value of Math.PI/2 when passed 90', () => expect(toRadian(90)).toBeCloseTo(Math.PI/2)); + it('should return a value of Math.PI when passed 180', () => expect(toRadian(180)).toBeCloseTo(Math.PI)); + it('should return a value of Math.PI*2 when passed 360', () => expect(toRadian(360)).toBeCloseTo(Math.PI*2)); + }); + + describe('toDegree', () => { + it('should return a value of 0 when passed 0', () => expect(toDegree(0)).toBeCloseTo(0)); + it('should return a value of 90 when passed Math.PI/2', () => expect(toDegree(Math.PI/2)).toBeCloseTo(90)); + it('should return a value of 180 when passed Math.PI', () => expect(toDegree(Math.PI)).toBeCloseTo(180)); + it('should return a value of 360 when passed Math.PI*2', () => expect(toDegree(Math.PI*2)).toBeCloseTo(360)); + }); +}); diff --git a/tests/f64/Mat2.spec.ts b/tests/f64/Mat2.spec.ts new file mode 100644 index 00000000..f058d4db --- /dev/null +++ b/tests/f64/Mat2.spec.ts @@ -0,0 +1,394 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat2 } from '#gl-matrix/f64'; + +describe('Mat2', () => { + describe('constructor', () => { + it('should return an identity Mat2 if called with no arguments', () => { + expect(new Mat2()).toBeVec( + 1, 0, + 0, 1) + }); + + it('should return Mat2(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { + expect(new Mat2( + 1, 2, + 3, 4)).toBeVec( + 1, 2, + 3, 4); + }); + + it('should return Mat2(x, x, x, ...) if called with (x)', () => { + expect(new Mat2(1)).toBeVec( + 1, 1, + 1, 1); + }); + + it('should return Mat2(m0, m1, ...m8) if called with ([m0, m1, ...m8])', () => { + expect(new Mat2([ + 1, 2, + 3, 4])).toBeVec( + 1, 2, + 3, 4); + }); + + it('should return Mat2(m0, m1, ...m8) if called with (Mat4(m0, m1, ...m9))', () => { + let v = new Mat2( + 1, 2, + 3, 4); + expect(new Mat2(v)).toBeVec(v); + }); + + it('should return Mat2(m0, m1, ...m8) if called with (Float64Array([m0, m1, ...m8]))', () => { + let arr = new Float64Array([ + 1, 2, + 3, 4]); + expect(new Mat2(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, identity, result; + + beforeEach(() => { + matA = new Float64Array([1, 2, 3, 4]); + matB = new Float64Array([5, 6, 7, 8]); + out = new Float64Array([0, 0, 0, 0]); + identity = new Float64Array([1, 0, 0, 1]); + }); + + describe('create', () => { + beforeEach(() => { result = Mat2.create(); }); + + it('should return a 4 element array initialized to a 2x2 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat2.clone(matA); }); + + it('should return a 4 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat2.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat2.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('transpose', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.transpose(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 3, 2, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.transpose(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec(1, 3, 2, 4)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.invert(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(-2, 1, 1.5, -0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.invert(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec(-2, 1, 1.5, -0.5)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('adjoint', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.adjoint(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(4, -2, -3, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.adjoint(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec(4, -2, -3, 1)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat2.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(-2)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat2.mul).toEqual(Mat2.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.multiply(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(23, 34, 31, 46)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.multiply(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(23, 34, 31, 46)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.multiply(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(23, 34, 31, 46)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('rotate', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.rotate(out, matA, Math.PI * 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, -1, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.rotate(matA, matA, Math.PI * 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(3, 4, -1, -2)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('scale', () => { + let vecA; + + beforeEach(() => { vecA = [2, 3]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.scale(out, matA, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 9, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.scale(matA, matA, vecA); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 9, 12)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat2.str(matA); }); + + it('should return a string representation of the matrix', () => expect(result).toEqual('Mat2(1, 2, 3, 4)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat2.frob(matA); }); + it('should return the Frobenius Norm of the matrix', + () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2)))); + }); + + describe('LDU', () => { + let L, D, U, L_result, D_result, U_result; + + beforeEach(() => { + L = Mat2.create(); + D = Mat2.create(); + U = Mat2.create(); + result = Mat2.LDU(L, D, U, [4,3,6,3]); + L_result = Mat2.create(); L_result[2] = 1.5; + D_result = Mat2.create(); + U_result = Mat2.create(); + U_result[0] = 4; U_result[1] = 3; U_result[3] = -1.5; + }); + + it('should return a lower triangular, a diagonal and an upper triangular matrix', () => { + expect(result[0]).toBeVec(L_result); + expect(result[1]).toBeVec(D_result); + expect(result[2]).toBeVec(U_result); + }); + }); + + describe('add', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.add(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.add(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(6, 8, 10, 12)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.add(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(6, 8, 10, 12)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Mat2.sub).toEqual(Mat2.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.subtract(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(-4, -4, -4, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.subtract(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(-4, -4, -4, -4)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.subtract(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(-4, -4, -4, -4)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat2.fromValues(1, 2, 3, 4); }); + + it('should return a 4 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3, 4)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat2.set(out, 1, 2, 3, 4); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalar(out, matA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 6, 8)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3.5, 5, 6.5, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(3.5, 5, 6.5, 8)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', () => expect(matB).toBeVec(3.5, 5, 6.5, 8)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3]; + matB = [0, 1, 2, 3]; + matC = [1, 2, 3, 4]; + r0 = Mat2.exactEquals(matA, matB); + r1 = Mat2.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3]; + matB = [0, 1, 2, 3]; + matC = [1, 2, 3, 4]; + matD = [1e-16, 1, 2, 3]; + r0 = Mat2.equals(matA, matB); + r1 = Mat2.equals(matA, matC); + r2 = Mat2.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3)); + }); + }); +}); diff --git a/tests/f64/Mat2d.spec.ts b/tests/f64/Mat2d.spec.ts new file mode 100644 index 00000000..f8702e20 --- /dev/null +++ b/tests/f64/Mat2d.spec.ts @@ -0,0 +1,387 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat2d } from '#gl-matrix/f64'; + +describe('Mat2d', () => { + describe('constructor', () => { + it('should return an identity Mat2d if called with no arguments', () => { + expect(new Mat2d()).toBeVec( + 1, 0, + 0, 1, + 0, 0) + }); + + it('should return Mat2d(m0, m1, ...m5) if called with (m0, m1, ...m5)', () => { + expect(new Mat2d( + 1, 2, + 3, 4, + 5, 6)).toBeVec( + 1, 2, + 3, 4, + 5, 6); + }); + + it('should return Mat2d(x, x, x, ...) if called with (x)', () => { + expect(new Mat2d(1)).toBeVec( + 1, 1, + 1, 1, + 1, 1); + }); + + it('should return Mat2d(m0, m1, ...m8) if called with ([m0, m1, ...m8])', () => { + expect(new Mat2d([ + 1, 2, + 3, 4, + 5, 6])).toBeVec( + 1, 2, + 3, 4, + 5, 6); + }); + + it('should return Mat2d(m0, m1, ...m8) if called with (Mat2d(m0, m1, ...m9))', () => { + let v = new Mat2d( + 1, 2, + 3, 4, + 5, 6); + expect(new Mat2d(v)).toBeVec(v); + }); + + it('should return Mat2d(m0, m1, ...m8) if called with (Float64Array([m0, m1, ...m8]))', () => { + let arr = new Float64Array([ + 1, 2, + 3, 4, + 5, 6]); + expect(new Mat2d(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, oldA, oldB, identity, result; + + beforeEach(() => { + matA = new Float64Array([1, 2, + 3, 4, + 5, 6]); + + oldA = new Float64Array([1, 2, + 3, 4, + 5, 6]); + + matB = new Float64Array([7, 8, + 9, 10, + 11, 12]); + + oldB = new Float64Array([7, 8, + 9, 10, + 11, 12]); + + out = new Float64Array([0, 0, + 0, 0, + 0, 0]); + + identity = new Float64Array([1, 0, + 0, 1, + 0, 0]); + }); + + describe('create', () => { + beforeEach(() => { result = Mat2d.create(); }); + + it('should return a 6 element array initialized to a 2x3 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat2d.clone(matA); }); + + it('should return a 6 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat2d.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat2d.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.invert(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.invert(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat2d.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(-2)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat2d.mul).toEqual(Mat2d.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.multiply(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(31, 46, 39, 58, 52, 76)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiply(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(31, 46, 39, 58, 52, 76)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiply(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(31, 46, 39, 58, 52, 76)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + }); + + describe('rotate', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.rotate(out, matA, Math.PI * 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, -1, -2, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.rotate(matA, matA, Math.PI * 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(3, 4, -1, -2, 5, 6)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('scale', () => { + let vecA; + beforeEach(() => { vecA = [2, 3]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.scale(out, matA, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 9, 12, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.scale(matA, matA, vecA); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 9, 12, 5, 6)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('translate', () => { + let vecA; + beforeEach(() => { vecA = [2, 3]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.translate(out, matA, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4, 16, 22)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.translate(matA, matA, vecA); }); + + it('should place values into matA', () => expect(matA).toBeVec(1, 2, 3, 4, 16, 22)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat2d.str(matA); }); + + it('should return a string representation of the matrix', + () => expect(result).toEqual('Mat2d(1, 2, 3, 4, 5, 6)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat2d.frob(matA); }); + + it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual(Math.sqrt(Math.pow(1, 2) + + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2) + Math.pow(5, 2) + Math.pow(6, 2) + 1))); + }); + + describe('add', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.add(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(8, 10, 12, 14, 16, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.add(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(8, 10, 12, 14, 16, 18)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.add(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(8, 10, 12, 14, 16, 18)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Mat2d.sub).toEqual(Mat2d.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.subtract(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(-6, -6, -6, -6, -6, -6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.subtract(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(-6, -6, -6, -6, -6, -6)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(oldB)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.subtract(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(-6, -6, -6, -6, -6, -6)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(oldA)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat2d.fromValues(1, 2, 3, 4, 5, 6); }); + + it('should return a 6 element array initialized to the values passed', + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat2d.set(out, 1, 2, 3, 4, 5, 6); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalar(out, matA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(4.5, 6, 7.5, 9, 10.5, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + it('should not modify matB', () => expect(matB).toBeVec(7, 8, 9, 10, 11, 12)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(4.5, 6, 7.5, 9, 10.5, 12)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(7, 8, 9, 10, 11, 12)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat2d.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', () => expect(matB).toBeVec(4.5, 6, 7.5, 9, 10.5, 12)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1; + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5]; + matB = [0, 1, 2, 3, 4, 5]; + matC = [1, 2, 3, 4, 5, 6]; + r0 = Mat2d.exactEquals(matA, matB); + r1 = Mat2d.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5]; + matB = [0, 1, 2, 3, 4, 5]; + matC = [1, 2, 3, 4, 5, 6]; + matD = [1e-16, 1, 2, 3, 4, 5]; + r0 = Mat2d.equals(matA, matB); + r1 = Mat2d.equals(matA, matC); + r2 = Mat2d.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5)); + }); + }); +}); diff --git a/tests/f64/Mat3.spec.ts b/tests/f64/Mat3.spec.ts new file mode 100644 index 00000000..f67e01ad --- /dev/null +++ b/tests/f64/Mat3.spec.ts @@ -0,0 +1,572 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat3, Mat4, Vec3 } from '#gl-matrix/f64'; + +describe('Mat3', () => { + describe('constructor', () => { + it('should return an identity Mat3 if called with no arguments', () => { + expect(new Mat3()).toBeVec( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1) + }); + + it('should return Mat3(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { + expect(new Mat3( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9)).toBeVec( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + }); + + it('should return Mat3(x, x, x, ...) if called with (x)', () => { + expect(new Mat3(1)).toBeVec( + 1, 1, 1, + 1, 1, 1, + 1, 1, 1); + }); + + it('should return Mat3(m0, m1, ...m8) if called with ([m0, m1, ...m8])', () => { + expect(new Mat3([ + 1, 2, 3, + 4, 5, 6, + 7, 8, 9])).toBeVec( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + }); + + it('should return Mat3(m0, m1, ...m8) if called with (Mat3(m0, m1, ...m9))', () => { + let v = new Mat3( + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + expect(new Mat3(v)).toBeVec(v); + }); + + it('should return Mat3(m0, m1, ...m8) if called with (Float64Array([m0, m1, ...m8]))', () => { + let arr = new Float64Array([ + 1, 2, 3, + 4, 5, 6, + 7, 8, 9]); + expect(new Mat3(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, identity, result; + + beforeEach(() => { + matA = new Float64Array([1, 0, 0, + 0, 1, 0, + 1, 2, 1]); + + matB = new Float64Array([1, 0, 0, + 0, 1, 0, + 3, 4, 1]); + + out = new Float64Array([0, 0, 0, + 0, 0, 0, + 0, 0, 0]); + + identity = new Float64Array([1, 0, 0, + 0, 1, 0, + 0, 0, 1]); + }); + + describe('normalFromMat4', () => { + beforeEach(() => { + matA = new Float64Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); + result = Mat3.normalFromMat4(out, matA); + }); + + it('should return out', () => expect(result).toBe(out)); + + describe('with translation and rotation', () => { + beforeEach(() => { + Mat4.translate(matA, matA, [2, 4, 6]); + Mat4.rotateX(matA, matA, Math.PI / 2); + + result = Mat3.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => { + expect(result).toBeVec(1, 0, 0, + 0, 0, 1, + 0,-1, 0); + }); + + describe('and scale', () => { + beforeEach(() => { + Mat4.scale(matA, matA, [2, 3, 4]); + + result = Mat3.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => { + expect(result).toBeVec(0.5, 0, 0, + 0, 0, 0.333333, + 0, -0.25, 0); + }); + }); + }); + }); + + describe('fromQuat', () => { + let q; + + beforeEach(() => { + q = [ 0, -0.7071067811865475, 0, 0.7071067811865475 ]; + result = Mat3.fromQuat(out, q); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should rotate a vector the same as the original quat', () => { + let vecOut = new Vec3(); + Vec3.transformQuat(vecOut, [0,0,-1], q); + expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(vecOut); + }); + + it('should rotate a vector by PI/2 radians', + () => expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(1,0,0)); + }); + + describe('fromMat4', () => { + beforeEach(() => { + result = Mat3.fromMat4(out, [ 1, 2, 3, 4, + 5, 6, 7, 8, + 9,10,11,12, + 13,14,15,16]); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should calculate proper Mat3', () => { + expect(out).toBeVec( 1, 2, 3, + 5, 6, 7, + 9,10,11); + }); + }); + + describe('scale', () => { + beforeEach(() => { result = Mat3.scale(out, matA, [2,2]); }); + + it('should return out', () => expect(result).toBe(out)); + it('should place proper values in out', () => { + expect(out).toBeVec( 2, 0, 0, + 0, 2, 0, + 1, 2, 1); + }); + }); + + describe('create', () => { + beforeEach(() => { result = Mat3.create(); }); + + it('should return a 9 element array initialized to a 3x3 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat3.clone(matA); }); + + it('should return a 9 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat3.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat3.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('transpose', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.transpose(out, matA); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 1, + 0, 1, 2, + 0, 0, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.transpose(matA, matA); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 1, + 0, 1, 2, + 0, 0, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.invert(out, matA); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.invert(matA, matA); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('adjoint', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.adjoint(out, matA); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.adjoint(matA, matA); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat3.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(1)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat3.mul).toEqual(Mat3.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.multiply(out, matA, matB); }); + + it('should place values into out', () => { + expect(out).toBeVec( + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ); + }); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + it('should not modify matB', () => { + expect(matB).toBeVec( + 1, 0, 0, + 0, 1, 0, + 3, 4, 1 + ); + }); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.multiply(matA, matA, matB); }); + + it('should place values into matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ); + }); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => { + expect(matB).toBeVec( + 1, 0, 0, + 0, 1, 0, + 3, 4, 1 + ); + }); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.multiply(matB, matA, matB); }); + + it('should place values into matB', () => { + expect(matB).toBeVec( + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ); + }); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => { + expect(matA).toBeVec( + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ); + }); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat3.str(matA); }); + + it('should return a string representation of the matrix', + () => expect(result).toEqual('Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat3.frob(matA); }); + + it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(1, 2) + + Math.pow(2, 2) + Math.pow(1, 2)))); + }); + + describe('add', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.add(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.add(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.add(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + }); + + describe('subtract', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + + it('should have an alias called `sub`', () => expect(Mat3.sub).toEqual(Mat3.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.subtract(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.subtract(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.subtract(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); }); + + it('should return a 9 element array initialized to the values passed', + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat3.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + beforeEach(() => { matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalar(out, matA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', () => expect(matA).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat3.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', () => expect(matB).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + }); + }); + + describe('projection', () => { + beforeEach(() => { result = Mat3.projection(out, 100.0, 200.0); }); + + it('should return out', () => expect(result).toBe(out)); + + it('should give projection matrix', () => { + expect(result).toBeVec(0.02, 0, 0, + 0, -0.01, 0, + -1, 1, 1); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + r0 = Mat3.exactEquals(matA, matB); + r1 = Mat3.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8]; + r0 = Mat3.equals(matA, matB); + r1 = Mat3.equals(matA, matC); + r2 = Mat3.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8)); + }); + }); +}); diff --git a/tests/f64/Mat4.spec.ts b/tests/f64/Mat4.spec.ts new file mode 100644 index 00000000..52f91b8c --- /dev/null +++ b/tests/f64/Mat4.spec.ts @@ -0,0 +1,1165 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat4, Quat, Vec3 } from '#gl-matrix/f64'; + +import type { Vec3Like } from '#gl-matrix/types'; + +describe('Mat4', () => { + describe('constructor', () => { + it('should return an identity Mat4 if called with no arguments', () => { + expect(new Mat4()).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + }); + + it('should return Mat4(m0, m1, ...m15) if called with (m0, m1, ...m15)', () => { + expect(new Mat4( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16)).toBeVec( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + }); + + it('should return Mat4(x, x, x) if called with (x)', () => { + expect(new Mat4(1)).toBeVec( + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1); + }); + + it('should return Mat4(m0, m1, ...m15) if called with ([m0, m1, ...m15])', () => { + expect(new Mat4([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16])).toBeVec( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + }); + + it('should return Mat4(m0, m1, ...m15) if called with (Mat4(m0, m1, ...m15))', () => { + let v = new Mat4( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + expect(new Mat4(v)).toBeVec(v); + }); + + it('should return Mat4(m0, m1, ...m15) if called with (Float64Array([m0, m1, ...m15]))', () => { + let arr = new Float64Array([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16]); + expect(new Mat4(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out, matA, matB, identity, result; + + beforeEach(() => { + // Attempting to portray a semi-realistic transform matrix + matA = new Float64Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + + matB = new Float64Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + ]); + + out = new Float64Array([ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 + ]); + + identity = new Float64Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]); + }); + + describe('create', () => { + beforeEach(() => { result = Mat4.create(); }); + + it('should return a 16 element array initialized to a 4x4 identity matrix', + () => expect(result).toBeVec(identity)); + }); + + describe('clone', () => { + beforeEach(() => { result = Mat4.clone(matA); }); + + it('should return a 16 element array initialized to the values in matA', () => expect(result).toBeVec(matA)); + }); + + describe('copy', () => { + beforeEach(() => { result = Mat4.copy(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec(matA)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Mat4.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(identity)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('transpose', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.transpose(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3, + 0, 0, 0, 1 + )); + + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.transpose(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3, + 0, 0, 0, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('invert', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.invert(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.invert(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('adjoint', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.adjoint(out, matA); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.adjoint(matA, matA); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('determinant', () => { + beforeEach(() => { result = Mat4.determinant(matA); }); + + it('should return the determinant', () => expect(result).toEqual(1)); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Mat4.mul).toEqual(Mat4.multiply)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.multiply(out, matA, matB); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + it('should not modify matB', () => expect(matB).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.multiply(matA, matA, matB); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', () => expect(matB).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + )); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.multiply(matB, matA, matB); }); + + it('should place values into matB', () => expect(matB).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + }); + + describe('translate', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.translate(out, matA, [4, 5, 6]); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.translate(matA, matA, [4, 5, 6]); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('scale', () => { + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.scale(out, matA, [4, 5, 6]); }); + + it('should place values into out', () => expect(out).toBeVec( + 4, 0, 0, 0, + 0, 5, 0, 0, + 0, 0, 6, 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.scale(matA, matA, [4, 5, 6]); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 4, 0, 0, 0, + 0, 5, 0, 0, + 0, 0, 6, 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotate', () => { + let rad = Math.PI * 0.5; + let axis: Vec3Like = [1, 0, 0]; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotate(out, matA, rad, axis); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotate(matA, matA, rad, axis); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotateX', () => { + let rad = Math.PI * 0.5; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotateX(out, matA, rad); }); + + it('should place values into out', () => expect(out).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotateX(matA, matA, rad); }); + + it('should place values into matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotateY', () => { + let rad = Math.PI * 0.5; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotateY(out, matA, rad); }); + + it('should place values into out', () => expect(out).toBeVec( + Math.cos(rad), 0, -Math.sin(rad), 0, + 0, 1, 0, 0, + Math.sin(rad), 0, Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotateY(matA, matA, rad); }); + + it('should place values into matA', () => expect(matA).toBeVec( + Math.cos(rad), 0, -Math.sin(rad), 0, + 0, 1, 0, 0, + Math.sin(rad), 0, Math.cos(rad), 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('rotateZ', () => { + let rad = Math.PI * 0.5; + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.rotateZ(out, matA, rad); }); + + it('should place values into out', () => expect(out).toBeVec( + Math.cos(rad), Math.sin(rad), 0, 0, + -Math.sin(rad), Math.cos(rad), 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.rotateZ(matA, matA, rad); }); + + it('should place values into matA', () => expect(matA).toBeVec( + Math.cos(rad), Math.sin(rad), 0, 0, + -Math.sin(rad), Math.cos(rad), 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + )); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + // TODO: fromRotationTranslation + + describe('normalFromMat4', () => { + beforeEach(() => { + matA = new Float64Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); + result = Mat4.normalFromMat4(out, matA); + }); + + it('should return out', () => expect(result).toBe(out)); + + describe('with translation and rotation', () => { + beforeEach(() => { + Mat4.translate(matA, matA, [2, 4, 6]); + Mat4.rotateX(matA, matA, Math.PI / 2); + + result = Mat4.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 0, 1, 0, + 0,-1, 0, 0, + 0, 0, 0, 1 + )); + + describe('and scale', () => { + beforeEach(() => { + Mat4.scale(matA, matA, [2, 3, 4]); + + result = Mat4.normalFromMat4(out, matA); + }); + + it('should give rotated matrix', () => expect(result).toBeVec( + 0.5, 0, 0, 0, + 0, 0, 0.333333, 0, + 0, -0.25, 0, 0, + 0, 0, 0, 1 + )); + }); + }); + }); + + describe('getTranslation', () => { + describe('from the identity matrix', () => { + beforeEach(() => { + result = Vec3.fromValues(1, 2, 3); + out = Vec3.fromValues(1, 2, 3); + result = Mat4.getTranslation(out, identity); + }); + + it('should place result both in result and out', () => expect(result).toBe(out)); + it('should return the zero vector', () => expect(result).toBeVec(0, 0, 0)); + }); + + describe('from a translation-only matrix', () => { + beforeEach(() => { + result = new Vec3(1, 2, 3); + out = new Vec3(1, 2, 3); + result = Mat4.getTranslation(out, matB); + }); + + it('should return translation vector', () => expect(out).toBeVec(4, 5, 6)); + }); + + describe('from a translation and rotation matrix', () => { + beforeEach(() => { + let q = new Quat(); + let v = new Vec3(5, 6, 7); + Quat.setAxisAngle(q, [0.26726124, 0.534522474, 0.8017837], 0.55); + Mat4.fromRotationTranslation(out, q, v); + + result = new Vec3(); + Mat4.getTranslation(result, out); + }); + + it('should keep the same translation vector, regardless of rotation', () => expect(result).toBeVec(5, 6, 7)); + }); + }); + + describe('getScaling', () => { + describe('from the identity matrix', () => { + beforeEach(() => { + result = new Vec3(1, 2, 3); + out = new Vec3(1, 2, 3); + result = Mat4.getScaling(out, identity); + }); + + it('should place result both in result and out', () => expect(result).toBe(out)); + it('should return the identity vector', () => expect(result).toBeVec(1, 1, 1)); + }); + + describe('from a scale-only matrix', () => { + beforeEach(() => { + let v = new Vec3(4, 5, 6); + result = new Vec3(1, 2, 3) + out = new Vec3(1, 2, 3); + Mat4.fromScaling(matA, v); + result = Mat4.getScaling(out, matA); + }); + + it('should return translation vector', () => expect(out).toBeVec(4, 5, 6)); + }); + + describe('from a translation and rotation matrix', () => { + beforeEach(() => { + let q = Quat.create(); + let v = Vec3.fromValues(5, 6, 7); + q = Quat.setAxisAngle(q, [1, 0, 0], 0.5) as Quat; + Mat4.fromRotationTranslation(out, q, v); + + result = Vec3.fromValues(1, 2, 3); + Mat4.getScaling(result, out); + }); + + it('should return the identity vector', () => expect(result).toBeVec(1, 1, 1)); + }); + + describe('from a translation, rotation and scale matrix', () => { + beforeEach(() => { + let q = Quat.create(); + let t = Vec3.fromValues(1, 2, 3); + let s = Vec3.fromValues(5, 6, 7); + q = Quat.setAxisAngle(q, [0, 1, 0], 0.7) as Quat; + Mat4.fromRotationTranslationScale(out, q, t, s); + result = Vec3.fromValues(5, 6, 7); + Mat4.getScaling(result, out); + }); + + it('should return the same scaling factor when created', () => expect(result).toBeVec(5, 6, 7)); + }); + }); + + describe('getRotation', () => { + describe('from the identity matrix', () => { + beforeEach(() => { + result = Quat.fromValues(1, 2, 3, 4); + out = Quat.fromValues(1, 2, 3, 4); + result = Mat4.getRotation(out, identity); + }); + + it('should place result both in result and out', () => expect(result).toBe(out)); + it('should return the unit quaternion', () => { + let unitQuat = Quat.create(); + Quat.identity(unitQuat); + expect(result).toBeVec(unitQuat); + }); + }); + + describe('from a translation-only matrix', () => { + beforeEach(() => { + result = Quat.fromValues(1, 2, 3, 4); + out = Quat.fromValues(1, 2, 3, 4); + result = Mat4.getRotation(out, matB); + }); + + it('should return the unit quaternion', () => { + let unitQuat = Quat.create(); + Quat.identity(unitQuat); + expect(result).toBeVec(unitQuat); + }); + }); + + describe('from a translation and rotation matrix', () => { + it('should keep the same rotation as when created', () => { + let q = Quat.create(); + let outVec = Vec3.fromValues(5, 6, 7); + let testVec = Vec3.fromValues(1, 5, 2); + let ang = 0.78972; + + Vec3.normalize(testVec, testVec); + q = Quat.setAxisAngle(q, testVec, ang) as Quat; + Mat4.fromRotationTranslation(out, q, outVec); + + result = Quat.fromValues(2, 3, 4, 6); + Mat4.getRotation(result, out); + let outaxis = Vec3.create(); + let outangle = Quat.getAxisAngle(outaxis, result); + + expect(outaxis).toBeVec(testVec); + expect(outangle).toBeCloseTo(ang); + }); + }); + }); + + describe('frustumNO', () => { + it('should have an alias called `frustum`', () => expect(Mat4.frustumNO).toEqual(Mat4.frustum)); + + beforeEach(() => { result = Mat4.frustumNO(out, -1, 1, -1, 1, -1, 1); }); + + it('should place values into out', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 0, -1, + 0, 0, 1, 0 + )); + it('should return out', () => expect(result).toBe(out)); + + describe('with an Infinite far plane', () => { + beforeEach(() => { result = Mat4.frustumNO(out, -1, 1, -1, 1, -1, Infinity); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, -1, + 0, 0, 2, 0 + )); + }); + }); + + describe('frustumZO', () => { + beforeEach(() => { result = Mat4.frustumZO(out, -1, 1, -1, 1, -1, 1); }); + + it('should place values into out', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -0.5, -1, + 0, 0, 0.5, 0 + )); + it('should return out', () => expect(result).toBe(out)); + + describe('with an Infinite far plane', () => { + beforeEach(() => { result = Mat4.frustumZO(out, -1, 1, -1, 1, -1, Infinity); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, -1, -1, + 0, 0, 1, 0 + )); + }); + }); + + describe('perspectiveNO', () => { + it('should have an alias called `perspective`', () => expect(Mat4.perspectiveNO).toEqual(Mat4.perspective)); + + let fovy = Math.PI * 0.5; + beforeEach(() => { result = Mat4.perspectiveNO(out, fovy, 1, 0, 1); }); + + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, -1, + 0, 0, 0, 0 + )); + it('should return out', () => expect(result).toBe(out)); + + describe('with nonzero near, 45deg fovy, and realistic aspect ratio', () => { + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, 200); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1.001, -1, + 0, 0, -0.2001, 0 + )); + }); + + describe('with no far plane, 45deg fovy, and realistic aspect ratio', () => { + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1, -1, + 0, 0, -0.2, 0 + )); + }); + + describe('with infinite far plane, 45deg fovy, and realistic aspect ratio', () => { + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, Infinity); }); + + it('should calculate correct matrix', () => expect(result).toBeVec( + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1, -1, + 0, 0, -0.2, 0 + )); + }); + }); + + describe('orthoNO', () => { + beforeEach(() => { result = Mat4.orthoNO(out, -1, 1, -1, 1, -1, 1); }); + + it('should have an alias called `ortho`', () => expect(Mat4.orthoNO).toEqual(Mat4.ortho)); + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1 + )); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('lookAt', () => { + let eye = new Float64Array([0, 0, 1]); + let center = new Float64Array([0, 0, -1]); + let up = new Float64Array([0, 1, 0]); + let view, right; + + beforeEach(() => { + eye = new Float64Array([0, 0, 1]); + center = new Float64Array([0, 0, -1]); + up = new Float64Array([0, 1, 0]); + result = Mat4.lookAt(out, eye, center, up); + }); + + describe('looking down', () => { + beforeEach(() => { + view = new Float64Array([0, -1, 0]); + up = new Float64Array([0, 0, -1]); + right= new Float64Array([1, 0, 0]); + result = Mat4.lookAt(out, [0, 0, 0], view, up); + }); + + it('should transform view into local -Z', () => { + result = Vec3.transformMat4(new Float64Array(3), view, out); + expect(result).toBeVec(0, 0, -1); + }); + + it('should transform up into local +Y', () => { + result = Vec3.transformMat4(new Float64Array(3), up, out); + expect(result).toBeVec(0, 1, 0); + }); + + it('should transform right into local +X', () => { + result = Vec3.transformMat4(new Float64Array(3), right, out); + expect(result).toBeVec(1, 0, 0); + }); + + it('should return out', () => expect(result).toBe(out)); + }); + + describe('#74', () => { + beforeEach(() => { + Mat4.lookAt(out, + new Float64Array([0,2,0]), + new Float64Array([0,0.6,0]), + new Float64Array([0,0,-1])); + }); + + it('should transform a point `above` into local +Y', () => { + result = Vec3.transformMat4(new Float64Array(3), [0, 2, -1], out); + expect(result).toBeVec(0, 1, 0); + }); + + it('should transform a point `right of` into local +X', () => { + result = Vec3.transformMat4(new Float64Array(3), [1, 2, 0], out); + expect(result).toBeVec(1, 0, 0); + }); + + it('should transform a point `in front of` into local -Z', () => { + result = Vec3.transformMat4(new Float64Array(3), [0, 1, 0], out); + expect(result).toBeVec(0, 0, -1); + }); + }); + + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, -1, 1 + )); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('targetTo', () => { + let eye = new Float64Array([0, 0, 1]); + let center = new Float64Array([0, 0, -1]); + let up = new Float64Array([0, 1, 0]); + let view: Float64Array, right: Float64Array; + + beforeEach(() => { + eye = new Float64Array([0, 0, 1]); + center = new Float64Array([0, 0, -1]); + up = new Float64Array([0, 1, 0]); + result = Mat4.targetTo(out, eye, center, up); + }); + + describe('looking down', () => { + beforeEach(() => { + view = new Float64Array([0, -1, 0]); + up = new Float64Array([0, 0, -1]); + right= new Float64Array([1, 0, 0]); + result = Mat4.targetTo(out, [0, 0, 0], view, up); + }); + + it('should transform view into local Z', () => { + result = Vec3.transformMat4(new Float64Array(3), view, out); + expect(result).toBeVec(0, 0, 1); + }); + + it('should transform up into local -Y', () => { + result = Vec3.transformMat4(new Float64Array(3), up, out); + expect(result).toBeVec(0, -1, 0); + }); + + it('should transform right into local +X', () => { + result = Vec3.transformMat4(new Float64Array(3), right, out); + expect(result).toBeVec(1, 0, 0); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float64Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + describe('#74', () => { + beforeEach(() => { + Mat4.targetTo(out, + new Float64Array([0,2,0]), + new Float64Array([0,0.6,0]), + new Float64Array([0,0,-1])); + }); + + it('should transform a point `above` into local +Y', () => { + result = Vec3.transformMat4(new Float64Array(3), [0, 2, -1], out); + expect(result).toBeVec(0, 1, -2); + }); + + it('should transform a point `right of` into local +X', () => { + result = Vec3.transformMat4(new Float64Array(3), [1, 2, 0], out); + expect(result).toBeVec(1, 2, -2); + }); + + it('should transform a point `in front of` into local -Z', () => { + result = Vec3.transformMat4(new Float64Array(3), [0, 1, 0], out); + expect(result).toBeVec(0, 2, -1); + }); + + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float64Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + describe('scaling test', () => { + beforeEach(() => { + Mat4.targetTo(out, + new Float64Array([0,1,0]), + new Float64Array([0,0,1]), + new Float64Array([0,0,-1])); + }); + + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float64Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + it('should place values into out', () => expect(result).toBeVec( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 1 + )); + it('should return out', () => expect(result).toBe(out)); + it('scaling should be [1, 1, 1]', () => { + let scaling = Mat4.getScaling(new Float64Array(3), out); + expect(scaling).toBeVec(1, 1, 1); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Mat4.str(matA); }); + + it('should return a string representation of the matrix', + () => expect(result).toEqual('Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)')); + }); + + describe('frob', () => { + beforeEach(() => { result = Mat4.frob(matA); }); + + it('should return the Frobenius Norm of the matrix', () => expect(result).toBeCloseTo( Math.sqrt(Math.pow(1, 2) + + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) ))); + }); + + describe('add', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.add(out, matA, matB); }); + + it('should place values into out', + () => expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.add(matA, matA, matB); }); + + it('should place values into matA', + () => expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.add(matB, matA, matB); }); + + it('should place values into matB', + () => expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + }); + + describe('subtract', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + + it('should have an alias called `sub`', () => expect(Mat4.sub).toEqual(Mat4.subtract)); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.subtract(out, matA, matB); }); + + it('should place values into out', + () => expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.subtract(matA, matA, matB); }); + + it('should place values into matA', + () => expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.subtract(matB, matA, matB); }); + + it('should place values into matB', + () => expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); + + it('should return a 16 element array initialized to the values passed', + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + + describe('set', () => { + beforeEach(() => { result = Mat4.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); + + it('should place values into out', + () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('multiplyScalar', () => { + beforeEach(() => { matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalar(out, matA, 2); }); + + it('should place values into out', + () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalar(matA, matA, 2); }); + + it('should place values into matA', + () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + it('should return matA', () => expect(result).toBe(matA)); + }); + }); + + describe('multiplyScalarAndAdd', () => { + beforeEach(() => { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + + describe('with a separate output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it('should place values into out', + () => expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matA is the output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it('should place values into matA', + () => expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + it('should return matA', () => expect(result).toBe(matA)); + it('should not modify matB', + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + }); + + describe('when matB is the output matrix', () => { + beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it('should place values into matB', + () => expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + it('should return matB', () => expect(result).toBe(matB)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + }); + }); + + describe('exactEquals', () => { + let matC, r0, r1; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + r0 = Mat4.exactEquals(matA, matB); + r1 = Mat4.exactEquals(matA, matC); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + }); + + describe('equals', () => { + let matC, matD, r0, r1, r2; + + beforeEach(() => { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + r0 = Mat4.equals(matA, matB); + r1 = Mat4.equals(matA, matC); + r2 = Mat4.equals(matA, matD); + }); + + it('should return true for identical matrices', () => expect(r0).toBe(true)); + it('should return false for different matrices', () => expect(r1).toBe(false)); + it('should return true for close but not identical matrices', () => expect(r2).toBe(true)); + it('should not modify matA', () => expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + it('should not modify matB', () => expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + }); + }); +}); diff --git a/tests/f64/Quat.spec.ts b/tests/f64/Quat.spec.ts new file mode 100644 index 00000000..5c0d0473 --- /dev/null +++ b/tests/f64/Quat.spec.ts @@ -0,0 +1,750 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Quat, Vec3 } from '#gl-matrix/f64'; + +import type { Vec3Like, QuatLike } from '#gl-matrix/types'; + +describe('Quat', () => { + describe('constructor', () => { + it('should return Quat(0, 0, 0, 1) if called with no arguments', () => expect(new Quat()).toBeVec(0, 0, 0, 1)); + + it('should return Quat(x, y, z, w) if called with (x, y, z, w)', () => { + expect(new Quat(1, 2, 3, 4)).toBeVec(1, 2, 3, 4); + expect(new Quat(-3, 4.4, -5.6, 7.8)).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Quat(x, x, x, x) if called with (x)', () => { + expect(new Quat(1)).toBeVec(1, 1, 1, 1); + expect(new Quat(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3); + }); + + it('should return Quat(x, y, z, w) if called with ([x, y, z, w])', () => { + expect(new Quat([1, 2, 3, 4])).toBeVec(1, 2, 3, 4); + expect(new Quat([-3, 4.4, -5.6, 7.8])).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Quat(x, y, z, w) if called with (Quat(x, y, z, w))', () => { + let v = new Quat(3.4, 5.6, 7.8, 9); + expect(new Quat(v)).toBeVec(v); + }); + + it('should return Quat(x, y, z, w) if called with (Float64Array([x, y, z, w]))', () => { + let arr = new Float64Array([1.2, 3.4, 5.6, 7.8]); + expect(new Quat(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Quat + let quatA: QuatLike; + let quatB: QuatLike; + let result: any; + let vec: Vec3Like; + + const id = new Quat(0, 0, 0, 1); + const deg90 = Math.PI / 2; + + beforeEach(() => { + quatA = new Quat(1, 2, 3, 4); + quatB = new Quat(5, 6, 7, 8); + out = new Quat(0, 0, 0, 0); + vec = [1, 1, -1]; + }); + + describe('slerp', () => { + describe('the normal case', () => { + beforeEach(() => { result = Quat.slerp(out, [0, 0, 0, 1], [0, 1, 0, 0], 0.5); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quat', () => expect(result).toBeVec(0, 0.707106, 0, 0.707106)); + }); + + describe('where a == b', () => { + beforeEach(() => { result = Quat.slerp(out, [0, 0, 0, 1], [0, 0, 0, 1], 0.5); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quat', () => expect(result).toBeVec(0, 0, 0, 1)); + }); + + describe('where theta == 180deg', () => { + beforeEach(() => { + Quat.rotateX(quatA, [1,0,0,0], Math.PI); // 180 deg + result = Quat.slerp(out, [1,0,0,0], quatA, 1); + }); + + it('should calculate proper quat', () => expect(result).toBeVec(0,0,0,-1)); + }); + + describe('where a == -b', () => { + beforeEach(() => { result = Quat.slerp(out, [1, 0, 0, 0], [-1, 0, 0, 0], 0.5); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quat', () => expect(result).toBeVec(1, 0, 0, 0)); + }); + }); + + describe('pow', () => { + describe('identity quat', () => { + beforeEach(() => { result = Quat.pow(out, id, 2.1 /* random number */); }); + + it('should return out', () => expect(result).toBe(out)); + it('should be the identity', () => expect(result).toBeVec(id)); + }); + + describe('power of one', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + result = Quat.pow(out, quatA, 1); + }); + + it('should be the identity', () => expect(result).toBeVec(quatA)); + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + + describe('squared', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + result = Quat.pow(out, quatA, 2); + }); + + it('should be the square', () => { + let reference = Quat.multiply(Quat.create(), quatA, quatA); + expect(result).toBeVec(reference); + }); + + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + + describe('conjugate', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + result = Quat.pow(out, quatA, -1); + }); + + it('should be the conjugate', () => { + let reference = Quat.conjugate(Quat.create(), quatA); + expect(result).toBeVec(reference); + }); + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + + describe('reversible', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + + let b = 2.1; // random number + result = Quat.pow(out, quatA, b); + result = Quat.pow(out, result, 1/b); + }); + + it('should be reverted', () => expect(result).toBeVec(quatA)); + it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + }); + }); + + describe('rotateX', () => { + beforeEach(() => { result = Quat.rotateX(out, id, deg90); }); + + it('should return out', () => expect(result).toBe(out)); + it('should transform vec accordingly', () => { + Vec3.transformQuat(vec, [0,0,-1], out); + expect(vec).toBeVec(0, 1, 0); + }); + }); + + describe('rotateY', () => { + beforeEach(() => { result = Quat.rotateY(out, id, deg90); }); + + it('should return out', () => expect(result).toBe(out)); + it('should transform vec accordingly', () => { + Vec3.transformQuat(vec, [0,0,-1], out); + expect(vec).toBeVec(-1, 0, 0); + }); + }); + + describe('rotateZ', () => { + beforeEach(() => { result = Quat.rotateZ(out, id, deg90); }); + + it('should return out', () => expect(result).toBe(out)); + it('should transform vec accordingly', () => { + Vec3.transformQuat(vec, [0,1,0], out); + expect(vec).toBeVec(-1, 0, 0); + }); + }); + + /*describe('fromMat3', () => { + let matr; + + describe('legacy', () => { + beforeEach(() => { + matr = [ 1, 0, 0, + 0, 0, -1, + 0, 1, 0 ]; + result = Quat.fromMat3(out, matr); + }); + + it('should set dest to the correct value', () => expect(result).toBeVec(-0.707106, 0, 0, 0.707106)); + }); + + describe('where trace > 0', () => { + beforeEach(() => { + matr = [ 1, 0, 0, + 0, 0, -1, + 0, 1, 0 ]; + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the correct transformation', + () => expect(Vec3.transformQuat([], [0,1,0], out)).toBeVec(0,0,-1)); + }); + + describe('from a normal matrix looking `backward`', () => { + beforeEach(() => { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt( + mat4.create(), [0, 0, 0], [0, 0, 1], [0, 1, 0])))); + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the same transformation as the given matrix', () => expect(Vec3.transformQuat([], [3,2,-1], + Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr))); + }); + + describe('from a normal matrix looking `left` and `upside down`', () => { + beforeEach(() => { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt( + mat4.create(), [0, 0, 0], [-1, 0, 0], [0, -1, 0])))); + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the same transformation as the given matrix', () => expect(Vec3.transformQuat([], [3,2,-1], + Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr))); + }); + + describe('from a normal matrix looking `upside down`', () => { + beforeEach(() => { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt( + mat4.create(), [0, 0, 0], [0, 0, -1], [0, -1, 0])))); + result = Quat.fromMat3(out, matr); + }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the same transformation as the given matrix', () => expect(Vec3.transformQuat([], [3,2,-1], + Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr))); + }); + });*/ + + describe('fromEuler', () => { + describe('legacy', () => { + beforeEach(() => { result = Quat.fromEuler(out, -90, 0, 0); }); + + it('should set dest to the correct value', () => expect(result).toBeVec(-0.707106, 0, 0, 0.707106)); + }); + + describe('where trace > 0', () => { + beforeEach(() => { result = Quat.fromEuler(out, -90, 0, 0); }); + + it('should return out', () => expect(result).toBe(out)); + + it('should produce the correct transformation', + () => expect(Vec3.transformQuat([0, 0, 0], [0,1,0], out)).toBeVec(0,0,-1)); + }); + }); + + /*describe('setAxes', () => { + let r; + beforeEach(() => { r = Vec3.create(); }); + + describe('looking left', () => { + let view, up, right; + + beforeEach(() => { + view = [-1, 0, 0]; + up = [ 0, 1, 0]; + right= [ 0, 0,-1]; + result = Quat.setAxes([], view, right, up); + }); + + it('should transform local view into world left', () => { + r = Vec3.transformQuat([], [0,0,-1], result); + expect(r).toBeVec(1, 0, 0); + }); + + it('should transform local right into world front', () => { + r = Vec3.transformQuat([], [1,0,0], result); + expect(r).toBeVec(0, 0, 1); + }); + }); + + describe('given opengl defaults', () => { + let view, up, right; + + beforeEach(() => { + view = [0, 0, -1]; + up = [0, 1, 0]; + right= [1, 0, 0]; + result = Quat.setAxes(out, view, right, up); + }); + + it('should return out', () => expect(result).toBe(out)); + it('should produce identity', () => expect(out).toBeVec(0, 0, 0, 1)); + }); + + describe('legacy example', () => { + let view, up, right; + + beforeEach(() => { + right= [1, 0, 0]; + up = [0, 0, 1]; + view = [0, -1, 0]; + result = Quat.setAxes(out, view, right, up); + }); + + it('should set correct quat4 values', () => expect(result).toBeVec(0.707106, 0, 0, 0.707106)); + }); + });*/ + + describe('rotationTo', () => { + let r; + + beforeEach(() => { r = Vec3.create(); }); + + describe('at right angle', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 1, 0], [1, 0, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('should calculate proper quaternion', () => expect(out).toBeVec(0, 0, -0.707106, 0.707106)); + }); + + describe('when vectors are parallel', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 1, 0], [0, 1, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [0, 1, 0], out)).toBeVec(0, 1, 0)); + }); + + describe('when vectors are opposed X', () => { + beforeEach(() => { result = Quat.rotationTo(out, [1, 0, 0], [-1, 0, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [1, 0, 0], out)).toBeVec(-1, 0, 0)); + }); + + describe('when vectors are opposed Y', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 1, 0], [0, -1, 0]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [0, 1, 0], out)).toBeVec(0, -1, 0)); + }); + + describe('when vectors are opposed Z', () => { + beforeEach(() => { result = Quat.rotationTo(out, [0, 0, 1], [0, 0, -1]); }); + + it('should return out', () => expect(result).toBe(out)); + it('multiplying A should produce B', () => expect(Vec3.transformQuat(r, [0, 0, 1], out)).toBeVec(0, 0, -1)); + }); + }); + + describe('create', () => { + beforeEach(() => { result = Quat.create(); }); + + it('should return a 4 element array initialized to an identity quaternion', + () => expect(result).toBeVec(0, 0, 0, 1)); + }); + + describe('clone', () => { + beforeEach(() => { result = Quat.clone(quatA); }); + + it('should return a 4 element array initialized to the values in quatA', () => expect(result).toBeVec(quatA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Quat.fromValues(1, 2, 3, 4); }); + + it('should return a 4 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3, 4)); + }); + + describe('copy', () => { + beforeEach(() => { result = Quat.copy(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Quat.set(out, 1, 2, 3, 4); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Quat.identity(out); }); + + it('should place values into out', () => expect(result).toBeVec(0, 0, 0, 1)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('setAxisAngle', () => { + beforeEach(() => { result = Quat.setAxisAngle(out, [1, 0, 0], Math.PI * 0.5); }); + + it('should place values into out', () => expect(result).toBeVec(0.707106, 0, 0, 0.707106)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('getAxisAngle', () => { + let angle: number; + + describe('for a quaternion representing no rotation', () => { + beforeEach(() => { result = Quat.setAxisAngle(out, [0, 1, 0], 0.0); angle = Quat.getAxisAngle(vec, out); }); + + it('should return a multiple of 2*PI as the angle component', + () => expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0)); + }); + + describe('for a simple rotation about X axis', () => { + beforeEach(() => { result = Quat.setAxisAngle(out, [1, 0, 0], 0.7778); angle = Quat.getAxisAngle(vec, out); }); + + it('should return the same provided angle', () => expect(angle).toBeCloseTo(0.7778)); + it('should return the X axis as the angle', () => expect(vec).toBeVec(1, 0, 0)); + }); + + describe('for a simple rotation about Y axis', () => { + beforeEach(() => { + result = Quat.setAxisAngle(out, [0, 1, 0], 0.879546); + angle = Quat.getAxisAngle(vec, out); + }); + + it('should return the same provided angle', () => expect(angle).toBeCloseTo(0.879546)); + it('should return the X axis as the angle', () => expect(vec).toBeVec(0, 1, 0)); + }); + + describe('for a simple rotation about Z axis', () => { + beforeEach(() => { + result = Quat.setAxisAngle(out, [0, 0, 1], 0.123456); + angle = Quat.getAxisAngle(vec, out); + }); + + it('should return the same provided angle', () => expect(angle).toBeCloseTo(0.123456)); + it('should return the X axis as the angle', () => expect(vec).toBeVec(0, 0, 1)); + }); + + describe('for a slightly irregular axis and right angle', () => { + beforeEach(() => { + result = Quat.setAxisAngle(out, [0.707106, 0, 0.707106], Math.PI * 0.5); + angle = Quat.getAxisAngle(vec, out); + }); + + it('should place values into vec', () => expect(vec).toBeVec(0.707106, 0, 0.707106)); + it('should return a numeric angle', () => expect(angle).toBeCloseTo(Math.PI * 0.5)); + }); + + describe('for a very irregular axis and negative input angle', () => { + beforeEach(() => { + quatA = Quat.setAxisAngle(quatA, [0.65538555, 0.49153915, 0.57346237], 8.8888) as Quat; + angle = Quat.getAxisAngle(vec, quatA); + quatB = Quat.setAxisAngle(quatB, vec, angle) as Quat; + }); + + it('should return an angle between 0 and 2*PI', () => { + expect(angle).toBeGreaterThan(0.0); + expect(angle).toBeLessThan(Math.PI * 2.0); + }); + it('should create the same quaternion from axis and angle extracted', () => expect(quatA).toBeVec(quatB)); + }); + }); + + describe('getAngle', () => { + describe('from itself', () => { + beforeEach(() => { Quat.normalize(quatA, quatA); }); + + it('should be zero', () => expect(Quat.getAngle(quatA, quatA)).toBeCloseTo(0)); + }); + + describe('from rotated', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + Quat.rotateX(quatB, quatA, Math.PI / 4); + }); + + it('should be 45 degrees', () => expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(Math.PI / 4)); + }); + + describe('compare with axisAngle', () => { + beforeEach(() => { + Quat.normalize(quatA, quatA); + Quat.normalize(quatB, quatB); + }); + + it('should be equalish', () => { + // compute reference value as axisAngle of quatA^{-1} * quatB + let quatAInv = Quat.conjugate(Quat.create(), quatA); + let quatAB = Quat.multiply(quatAInv, quatAInv, quatB); + let dummy = Vec3.create(); + let reference = Quat.getAxisAngle(dummy, quatAB); + + expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(reference); + }); + }); + }); + + describe('add', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.add(out, quatA, quatB); }); + + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.add(quatA, quatA, quatB); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(6, 8, 10, 12)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.add(quatB, quatA, quatB); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(6, 8, 10, 12)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Quat.mul).toEqual(Quat.multiply)); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.multiply(out, quatA, quatB); }); + + it('should place values into out', () => expect(out).toBeVec(24, 48, 48, -6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.multiply(quatA, quatA, quatB); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(24, 48, 48, -6)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.multiply(quatB, quatA, quatB); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(24, 48, 48, -6)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('scale', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.scale(out, quatA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.scale(quatA, quatA, 2); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(2, 4, 6, 8)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('length', () => { + beforeEach(() => { result = Quat.len(quatA); }); + + it('should have an alias called `len`', () => expect(Quat.len).toEqual(Quat.length)); + it('should return the length', () => expect(result).toBeCloseTo(5.477225)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Quat.squaredLength(quatA); }); + + it('should have an alias called `sqrLen``', () => expect(Quat.sqrLen).toEqual(Quat.squaredLength)); + it('should return the squared length', () => expect(result).toEqual(30)); + }); + + describe('normalize', () => { + beforeEach(() => { quatA = [5, 0, 0, 0]; }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.normalize(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(5, 0, 0, 0)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.normalize(quatA, quatA); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(1, 0, 0, 0)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('lerp', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.lerp(out, quatA, quatB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.lerp(quatA, quatA, quatB, 0.5); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(3, 4, 5, 6)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.lerp(quatB, quatA, quatB, 0.5); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(3, 4, 5, 6)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('slerp', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.slerp(out, quatA, quatB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.slerp(quatA, quatA, quatB, 0.5); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(3, 4, 5, 6)); + it('should return quatA', () => expect(result).toBe(quatA)); + it('should not modify quatB', () => expect(quatB).toBeVec(5, 6, 7, 8)); + }); + + describe('when quatB is the output quaternion', () => { + beforeEach(() => { result = Quat.slerp(quatB, quatA, quatB, 0.5); }); + + it('should place values into quatB', () => expect(quatB).toBeVec(3, 4, 5, 6)); + it('should return quatB', () => expect(result).toBe(quatB)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + }); + + /*describe('random', () => { + beforeEach(() => { result = Quat.random(out); }); + + it('should result in a normalized quaternion', () => { + let copy = Quat.clone(out); + expect(Quat.normalize(out, out)).toBeVec(copy); + }); + it('should return out', () => expect(result).toBe(out)); + });*/ + + describe('invert', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.invert(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(-0.033333, -0.066666, -0.1, 0.133333)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.invert(quatA, quatA); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(-0.033333, -0.066666, -0.1, 0.133333)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('conjugate', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat.conjugate(out, quatA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2, -3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quatA', () => expect(quatA).toBeVec(1, 2, 3, 4)); + }); + + describe('when quatA is the output quaternion', () => { + beforeEach(() => { result = Quat.conjugate(quatA, quatA); }); + + it('should place values into quatA', () => expect(quatA).toBeVec(-1, -2, -3, 4)); + it('should return quatA', () => expect(result).toBe(quatA)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Quat.str(quatA); }); + + it('should return a string representation of the quaternion', () => expect(result).toEqual('Quat(1, 2, 3, 4)')); + }); + + describe('exactEquals', () => { + let quatC, r0, r1; + + beforeEach(() => { + quatA = [0, 1, 2, 3]; + quatB = [0, 1, 2, 3]; + quatC = [1, 2, 3, 4]; + r0 = Quat.exactEquals(quatA, quatB); + r1 = Quat.exactEquals(quatA, quatC); + }); + + it('should return true for identical quaternions', () => expect(r0).toBe(true)); + it('should return false for different quaternions', () => expect(r1).toBe(false)); + it('should not modify quatA', () => expect(quatA).toBeVec(0, 1, 2, 3)); + it('should not modify quatB', () => expect(quatB).toBeVec(0, 1, 2, 3)); + }); + + describe('equals', () => { + let quatC, quatD, r0, r1, r2; + + beforeEach(() => { + quatA = [0, 1, 2, 3]; + quatB = [0, 1, 2, 3]; + quatC = [1, 2, 3, 4]; + quatD = [1e-16, 1, 2, 3]; + r0 = Quat.equals(quatA, quatB); + r1 = Quat.equals(quatA, quatC); + r2 = Quat.equals(quatA, quatD); + }); + + it('should return true for identical quaternions', () => expect(r0).toBe(true)); + it('should return false for different quaternions', () => expect(r1).toBe(false)); + it('should return true for close but not identical quaternions', () => expect(r2).toBe(true)); + it('should not modify quatA', () => expect(quatA).toBeVec(0, 1, 2, 3)); + it('should not modify quatB', () => expect(quatB).toBeVec(0, 1, 2, 3)); + }); + }); +}); diff --git a/tests/f64/Quat2.spec.ts b/tests/f64/Quat2.spec.ts new file mode 100644 index 00000000..a818af2c --- /dev/null +++ b/tests/f64/Quat2.spec.ts @@ -0,0 +1,787 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat4, Quat, Quat2, Vec3 } from '#gl-matrix/f64'; + +import type { QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; + +describe('Quat2', () => { + describe('constructor', () => { + it('should return Quat2(0, 0, 0, 1, 0, 0, 0, 0) if called with no arguments', () => { + expect(new Quat2()).toBeVec(0, 0, 0, 1, 0, 0, 0, 0); + }); + + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (x, y, z, w, x2, y2, z2, w2)', () => { + expect(new Quat2(1, 2, 3, 4, 5, 6, 7, 8)).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); + expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + }); + + it('should return Quat(x, x, x, x, x, x, x, x) if called with (x)', () => { + expect(new Quat2(1)).toBeVec(1, 1, 1, 1, 1, 1, 1, 1); + expect(new Quat2(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3, -2.3, -2.3, -2.3, -2.3); + }); + + it('should return Quat(x, y, z, w) if called with ([x, y, z, w])', () => { + expect(new Quat2([1, 2, 3, 4, 5, 6, 7, 8])).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); + expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + }); + + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Quat(x, y, z, w, x2, y2, z2, w2))', () => { + let v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); + expect(new Quat2(v)).toBeVec(v); + }); + + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float64Array([x, y, z, w, x2, y2, z2, w2]))', () => { + let arr = new Float64Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); + expect(new Quat2(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Quat2; + let outVec: Vec3; + let quat2A: Quat2Like; + let quat2B: Quat2Like; + let result: any; + let resultVec: Vec3Like; + let outQuat: QuatLike; + let vec: Vec3Like; + + beforeEach(() => { + quat2A = new Quat2(1, 2, 3, 4, 2, 5, 6, -2); + quat2B = new Quat2(5, 6, 7, 8, 9, 8, 6, -4); + out = new Quat2(); + outVec = new Vec3(); + outQuat = new Quat(); + vec = new Vec3(1, 1, -1); + }); + + describe('translate', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.translate(out, quat2A, vec); + //Same thing with a matrix + Mat4.translate(matOut, matrixA, vec); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + it('should not modify vec', () => expect(vec).toBeVec(1,1,-1)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.translate(quat2A, quat2A, vec); + //Same thing with a matrix + Mat4.translate(matOut, matrixA, vec); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('rotateAroundAxis', () => { + let matrixA = new Mat4(); + let matOut = new Mat4(); + let ax: Vec3Like = [1,4,2]; + + beforeEach(() => { + //quat2A only seems to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateAroundAxis(out, quat2A, ax, 5); + + //Same thing with a matrix + Mat4.rotate(matOut, matrixA, 5, ax); + Quat2.fromMat4(quat2B, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quat2B)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2( + 0.18257418583505536, 0.3651483716701107, 0.5477225575051661, 0.7302967433402214, + -2.556038601690775, 3.742770809618635, 2.37346441585572, -3.0124740662784135 + )); + it('should not modify ax', () => expect(ax).toBeVec(1, 4, 2)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateAroundAxis(quat2A, quat2A, ax, 5); + //Same thing with a matrix + + Mat4.rotate(matOut, matrixA, 5, ax); + Quat2.fromMat4(quat2B, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify ax', () => expect(ax).toBeVec(1, 4, 2)); + }); + }); + + describe('rotateByQuatAppend', () => { + let correctResult = Quat2.create(); + let rotationQuat = Quat2.create(); + + beforeEach(() => { + rotationQuat[0] = 2; + rotationQuat[1] = 5; + rotationQuat[2] = 2; + rotationQuat[3] = -10; + Quat2.multiply(correctResult, quat2A, rotationQuat); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatAppend(out, quat2A, [2, 5, 2, -10]); }); + + it('should place values into out', () => expect(out).toBeQuat2(correctResult)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatAppend(quat2A, quat2A, [2, 5, 2, -10]); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + }); + + describe('rotateByQuatPrepend', () => { + let correctResult = Quat2.create(); + let rotationQuat = Quat2.create(); + + beforeEach(() => { + rotationQuat[0] = 2; + rotationQuat[1] = 5; + rotationQuat[2] = 2; + rotationQuat[3] = -10; + Quat2.multiply(correctResult, rotationQuat, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatPrepend(out, Quat2.getReal(outQuat, rotationQuat), quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(correctResult)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.rotateByQuatPrepend(quat2A, Quat2.getReal(outQuat, rotationQuat), quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + }); + }); + + describe('rotateX', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]) as Quat2; + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateX(out, quat2A, 5); + //Same thing with a matrix + Mat4.rotateX(matOut, matrixA, 5); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateX(quat2A, quat2A, 5); + //Same thing with a matrix + Mat4.rotateX(matOut, matrixA, 5); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('rotateY', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [5, 4, -10]) as Quat2; + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateY(out, quat2A, -2); + //Same thing with a matrix + Mat4.rotateY(matOut, matrixA, -2); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateY(quat2A, quat2A, -2); + //Same thing with a matrix + Mat4.rotateY(matOut, matrixA, -2); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('rotateZ', () => { + let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1,0,3,-4], [0, -4, -10]) as Quat2; + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateZ(out, quat2A, 1); + //Same thing with a matrix + Mat4.rotateZ(matOut, matrixA, 1); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into out', () => expect(out).toBeQuat2(quatOut)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { + result = Quat2.rotateZ(quat2A, quat2A, 1); + //Same thing with a matrix + Mat4.rotateZ(matOut, matrixA, 1); + Quat2.fromMat4(quatOut, matOut); + }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(quatOut)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('from/toMat4', () => { + let matRes = Mat4.create(), matOut = Mat4.create(); + let rotationQuat = Quat.create(); + + describe('quat to matrix and back', () => { + beforeEach(() => { + Quat.normalize(rotationQuat, [1,2,3,4]); + + Quat2.fromRotationTranslation(quat2A, rotationQuat, [1,-5,3]); + matRes = Mat4.fromQuat2(matOut, quat2A) as Mat4; + + result = Quat2.fromMat4(out, matRes); + }); + + it('should return out', () => expect(result).toBe(out)); + it('should return matOut', () => expect(matRes).toBe(matOut)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(0.18257418, 0.36514836, 0.54772257, 0.73029673, + -1.5518806, -1.82574184, 1.73445473, 0 )); + it('should be equal to the starting dual quat', () => expect(quat2A).toBeQuat2(result)); + }); + }); + + describe('create', () => { + beforeEach(() => { result = Quat2.create(); }); + + it('should return 2 4 element arrays initialized to an identity dual quaternion', + () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Quat2.clone(quat2A); }); + + it('should return 2 4 element arrays initialized to the values in quat2A', + () => expect(result).toBeQuat2(quat2A)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Quat2.fromValues(1, 2, 3, 4, 5, 7, 8, -2); }); + + it('should return 2 4 element arrays initialized to the values passedd to the values passed', + () => expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2)); + }); + + describe('copy', () => { + beforeEach(() => { result = Quat2.copy(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Quat2.set(out, 1, 2, 3, 4, 2, 5, 6, -2); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('identity', () => { + beforeEach(() => { result = Quat2.identity(out); }); + + it('should place values into out', () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.add(out, quat2A, quat2B); }); + + it('should place values into out', () => expect(out).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2A is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.add(quat2A, quat2A, quat2B); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2B is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.add(quat2B, quat2A, quat2B); }); + + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6)); + it('should return quat2B', () => expect(result).toBe(quat2B)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Quat2.mul).toEqual(Quat2.multiply)); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.multiply(out, quat2A, quat2B); }); + + it('should place values into out', () => expect(out).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.multiply(quat2A, quat2A, quat2B); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157 )); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2B is the output quaternion', () => { + beforeEach(() => { result = Quat2.multiply(quat2B, quat2A, quat2B); }); + + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157)); + it('should return quat2B', () => expect(result).toBe(quat2B)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('same as matrix multiplication', () => { + let matrixA = Mat4.create(), matrixB = Mat4.create(); + let matOut = Mat4.create(), quatOut = Quat2.create(); + + beforeEach(() => { + //quat2A and quat2B only seem to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + Quat2.normalize(quat2A, quat2A); + Mat4.fromQuat2(matrixA, quat2A); + + Quat2.fromRotationTranslation(quat2B, [5, 6, 7, 8], [9, 8, 6]); + Quat2.normalize(quat2B, quat2B); + Mat4.fromQuat2(matrixB, quat2B); + }); + + it('the matrices should be equal to the dual quaternions', () => { + let testQuat = Quat2.create(); + Quat2.fromMat4(testQuat, matrixA); + expect(testQuat).toBeQuat2(...quat2A); + + Quat2.fromMat4(testQuat, matrixB); + expect(testQuat).toBeQuat2(...quat2B); + }); + + it('should be equal to the matrix multiplication', () => { + Quat2.multiply(out, quat2A, quat2B); + Mat4.mul(matOut, matrixA, matrixB); + Quat2.fromMat4(quatOut, matOut); + expect(out).toBeQuat2(quatOut); + }); + }); + }); + + describe('scale', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.scale(out, quat2A, 2); }); + + it('should place values into out', () => expect(out).toBeQuat2(2, 4, 6, 8, 4, 10, 12, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('when quat2A is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.scale(quat2A, quat2A, 2); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(2, 4, 6, 8, 4, 10, 12, -4)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('length', () => { + beforeEach(() => { result = Quat2.length(quat2A); }); + + it('should have an alias called `len`', () => expect(Quat2.len).toEqual(Quat2.length)); + it('should return the length', () => expect(result).toBeCloseTo(5.477225)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Quat2.squaredLength(quat2A); }); + + it('should have an alias called `sqrLen`', () => expect(Quat2.sqrLen).toEqual(Quat2.squaredLength)); + it('should return the squared length', () => expect(result).toBeCloseTo(30)); + }); + + describe('fromRotation', () => { + beforeEach(() => { result = Quat2.fromRotation(out, [1, 2, 3, 4]); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 0, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify the quaternion', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('fromTranslation', () => { + beforeEach(() => { vec = [1, 2, 3]; result = Quat2.fromTranslation(out, vec); }); + + it('should place values into out', () => expect(out).toBeQuat2(0, 0, 0, 1, 0.5, 1, 1.5, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify the vector', () => expect(vec).toBeVec(1, 2, 3)); + }); + + describe('fromRotationTranslation', () => { + beforeEach(() => { + vec = [1, 2, 3]; + result = Quat2.fromRotationTranslation(out, [1, 2, 3, 4], vec); + }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify the quaternion', () => expect(Quat2.getReal(outQuat, quat2A)).toBeVec(1, 2, 3, 4)); + it('should not modify the vector', () => expect(vec).toBeVec(1, 2, 3)); + it('should have a translation that can be retrieved with getTranslation', () => { + let t: Vec3Like = [0, 0, 0]; + Quat2.normalize(out, out); + Quat2.getTranslation(t, out); + + expect(t).toBeVec(1, 2, 3); + }); + }); + + describe('fromRotationTranslationValues', () => { + beforeEach(() => { result = Quat2.fromRotationTranslationValues(1,2,3,4, 1,2,3); }); + + it('should return the correct result', () => expect(result).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7)); + it('should have a translation that can be retrieved with getTranslation', () => { + let t: Vec3Like = [0, 0, 0]; + + Quat2.normalize(result, result); + Quat2.getTranslation(t, result); + expect(t).toBeVec(1, 2, 3); + }); + }); + + describe('getTranslation', () => { + describe('without a real part', () => { + beforeEach(() => { + Quat2.fromTranslation(out, [1,2,3]); + resultVec = Quat2.getTranslation(outVec, out); + }); + + describe('not normalized', () => { + it('should return the same translation value', () => expect(outVec).toBeVec(1, 2, 3)); + it('should return out', () => expect(outVec).toBe(resultVec)); + }); + + describe('normalized', () => { + it('should return the same translation value', () => { + Quat2.normalize(outVec, outVec); + expect(outVec).toBeVec(1, 2, 3); + }); + }); + }); + + describe('with a real part', () => { + beforeEach(() => { + Quat2.fromRotationTranslation(out, [2, 4, 6, 2], [1, 2, 3]); + resultVec = Quat2.getTranslation(outVec, out); + }); + + describe('not normalized', () => { + it('should not return the same translation value', () => expect(outVec).not.toBeVec(1, 2, 3)); + it('should return out', () => expect(outVec).toBe(resultVec)); + }); + + describe('normalized', () => { + it('should return the same translation value', () => { + Quat2.normalize(out, out); + Quat2.getTranslation(outVec, out); + expect(outVec).toBeVec(1, 2, 3); + }); + }); + }); + }); + + describe('normalize', () => { + describe('when it is normalizing quat2A', () => { + beforeEach(() => { + quat2A = [1, 2, 3, 4, 2, 5, 6, -2]; + Quat2.normalize(out, quat2A); + }); + + it('both parts should have been normalized', () => expect(out).toBeQuat2(1/5.4772255, 2/5.4772255, + 3/5.4772255, 4/5.4772255, 0.231260, 0.6450954, 0.693781,-0.9006993)); + }); + + beforeEach(() => { quat2A = [5, 0, 0, 0, 0, 0, 0, 0]; }); + + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.normalize(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(1, 0, 0, 0, 0, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(5, 0, 0, 0, 0, 0, 0, 0)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.normalize(quat2A, quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(1, 0, 0, 0, 0, 0, 0, 0)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + + describe('when it contains a translation', () => { + beforeEach(() => { + Quat2.set(out, 5, 0, 0, 0, 1, 2, 3, 5); + Quat2.normalize(out, out); + }); + + it('both parts should have been normalized', () => expect(out).toBeQuat2(1, 0, 0, 0, 0, 0.4, 0.6, 1)); + }); + }); + + describe('lerp', () => { + describe('with a separate output quaternion', () => { + beforeEach(() => { result = Quat2.lerp(out, quat2A, quat2B, 0.7); }); + + it('should place values into out', () => expect(out).toBeQuat2(3.8, 4.8, 5.8, 6.8, 6.9, 7.1, 6.0, -3.4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.lerp(quat2A, quat2A, quat2B, 0.5); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + + describe('when quat2B is the output quaternion', () => { + beforeEach(() => { result = Quat2.lerp(quat2B, quat2A, quat2B, 0.5); }); + + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should return quat2B', () => expect(result).toBe(quat2B)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('shortest path', () => { + beforeEach(() => { result = Quat2.lerp(out, [1, 2, 3, -4, 2, 5, 6, -2], [5, -6, 7, 8, 9, 8, 6, -4], 0.4); }); + + it('should pick the shorter path', () => expect(out).toBeQuat2( -1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4 )); + }); + }); + + describe('dot', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.dot(quat2A, quat2B); }); + + it('should return the dot product', () => expect(result).toBe(70)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); + }); + }); + + describe('invert', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.invert(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2( + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + it('the real part should be equal to a inverted quaternion', () => { + Quat.invert(outQuat, [1, 2, 3, 4]); + expect(Quat2.getReal(outQuat, out)).toBeVec(...outQuat); + }); + }); + + describe('when quat2A is the output quaternion', () => { + beforeEach(() => { result = Quat2.invert(quat2A, quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeVec( + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('get real/dual', () => { + describe('get real', () => { + beforeEach(() => { result = Quat2.getReal(outQuat, quat2A); }); + + it('should place values into out', () => expect(outQuat).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(outQuat)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('get dual', () => { + beforeEach(() => { result = Quat2.getDual(outQuat, quat2A); }); + + it('should place values into out', () => expect(outQuat).toBeVec(2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(outQuat)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + }); + + describe('set real/dual', () => { + describe('set real', () => { + beforeEach(() => { + outQuat = [4, 6, 8, -100]; + result = Quat2.setReal(quat2A, outQuat); + }); + + it('should place values into out', () => expect(quat2A).toBeQuat2(4, 6, 8, -100, 2, 5, 6, -2)); + it('should return out', () => expect(result).toBe(quat2A)); + it('should not modify outQuat', () => expect(outQuat).toBeVec(4, 6, 8, -100)); + }); + + describe('set dual', () => { + beforeEach(() => { + outQuat = [4.3, 6, 8, -100]; + result = Quat2.setDual(quat2A, outQuat); + }); + + it('should place values into out', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 4.3, 6, 8, -100)); + it('should return out', () => expect(result).toBe(quat2A)); + it('should not modify outQuat', () => expect(outQuat).toBeVec(4.3, 6, 8, -100)); + }); + }); + + describe('conjugate', () => { + describe('with a separate output dual quaternion', () => { + beforeEach(() => { result = Quat2.conjugate(out, quat2A); }); + + it('should place values into out', () => expect(out).toBeQuat2(-1, -2, -3, 4, -2, -5, -6, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); + }); + + describe('when quat2A is the output dual quaternion', () => { + beforeEach(() => { result = Quat2.conjugate(quat2A, quat2A); }); + + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(-1, -2, -3, 4, -2, -5, -6, -2)); + it('should return quat2A', () => expect(result).toBe(quat2A)); + }); + }); + + describe('str', () => { + beforeEach(() => { result = Quat2.str(quat2A); }); + + it('should return a string representation of the quaternion', + () => expect(result).toEqual('Quat2(1, 2, 3, 4, 2, 5, 6, -2)')); + }); + + describe('exactEquals', () => { + let quat2C, r0, r1; + + beforeEach(() => { + quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2B = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2C = [1, 2, 3, 4, 5, 6, 7, 8]; + r0 = Quat2.exactEquals(quat2A, quat2B); + r1 = Quat2.exactEquals(quat2A, quat2C); + }); + + it('should return true for identical quaternions', () => expect(r0).toBe(true)); + it('should return false for different quaternions', () => expect(r1).toBe(false)); + it('should not modify quat2A', () => expect(quat2A).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + it('should not modify quat2B', () => expect(quat2B).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + }); + + describe('equals', () => { + let quat2C, quat2D, r0, r1, r2; + + beforeEach(() => { + quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2B = [0, 1, 2, 3, 4, 5, 6, 7]; + quat2C = [1, 2, 3, 4, 5, 6, 7, 8]; + quat2D = [1e-16, 1, 2, 3, 4, 5, 6, 7]; + r0 = Quat2.equals(quat2A, quat2B); + r1 = Quat2.equals(quat2A, quat2C); + r2 = Quat2.equals(quat2A, quat2D); + }); + + it('should return true for identical dual quaternions', () => expect(r0).toBe(true)); + it('should return false for different dual quaternions', () => expect(r1).toBe(false)); + it('should return true for close but not identical quaternions', () => expect(r2).toBe(true)); + it('should not modify quat2A', () => expect(quat2A).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + it('should not modify quat2B', () => expect(quat2B).toBeVec(0, 1, 2, 3, 4, 5, 6, 7)); + }); + }); +}); diff --git a/tests/f64/Vec2-swizzle.spec.ts b/tests/f64/Vec2-swizzle.spec.ts new file mode 100644 index 00000000..34b810ea --- /dev/null +++ b/tests/f64/Vec2-swizzle.spec.ts @@ -0,0 +1,521 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec2 } from '#gl-matrix/f64'; +import { EnableSwizzlesF64 } from '#gl-matrix/swizzle/f64'; + +describe('Vec2 Swizzles', () => { + EnableSwizzlesF64(); + + let v: Vec2; + beforeEach(() => { v = new Vec2(1, 2); }); + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + describe('Vec2().xx', () => { + it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xy', () => { + it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yx', () => { + it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yy', () => { + it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxx', () => { + it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxy', () => { + it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyx', () => { + it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyy', () => { + it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxx', () => { + it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxy', () => { + it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyx', () => { + it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyy', () => { + it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxxx', () => { + it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxxy', () => { + it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxyx', () => { + it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xxyy', () => { + it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyxx', () => { + it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyxy', () => { + it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyyx', () => { + it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().xyyy', () => { + it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxxx', () => { + it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxxy', () => { + it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxyx', () => { + it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yxyy', () => { + it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyxx', () => { + it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyxy', () => { + it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyyx', () => { + it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().yyyy', () => { + it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rr', () => { + it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rg', () => { + it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gr', () => { + it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gg', () => { + it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrr', () => { + it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrg', () => { + it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgr', () => { + it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgg', () => { + it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grr', () => { + it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grg', () => { + it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggr', () => { + it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggg', () => { + it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrrr', () => { + it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrrg', () => { + it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrgr', () => { + it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rrgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rrgg', () => { + it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rrgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgrr', () => { + it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rgrg', () => { + it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rggr', () => { + it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().rggg', () => { + it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grrr', () => { + it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grrg', () => { + it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grgr', () => { + it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.grgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().grgg', () => { + it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.grgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggrr', () => { + it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ggrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().ggrg', () => { + it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ggrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gggr', () => { + it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec2().gggg', () => { + it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + // [/Swizzle Autogen] +}); diff --git a/tests/f64/Vec2.spec.ts b/tests/f64/Vec2.spec.ts new file mode 100644 index 00000000..11d4270d --- /dev/null +++ b/tests/f64/Vec2.spec.ts @@ -0,0 +1,799 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec2 } from '#gl-matrix/f64'; + +import type { Vec2Like } from '#gl-matrix/types'; + +describe('Vec2', () => { + let vecA: Vec2; + let vecB: Vec2; + let out: Vec2; + + beforeEach(() => { + vecA = new Vec2(1, 2); + vecB = new Vec2([3, 4]); + out = new Vec2(); + }); + + describe('constructor', () => { + it('should return Vec2(0, 0) if called with no arguments', () => expect(new Vec2()).toBeVec(0, 0)); + + it('should return Vec2(x, y) if called with (x, y)', () => { + expect(new Vec2(1, 2)).toBeVec(1, 2); + expect(new Vec2(-3, 4.4)).toBeVec(-3, 4.4); + }); + + it('should return Vec2(x, x) if called with (x)', () => { + expect(new Vec2(1)).toBeVec(1, 1); + expect(new Vec2(-2.3)).toBeVec(-2.3, -2.3); + }); + + it('should return Vec2(x, y) if called with ([x, y])', () => { + expect(new Vec2([1, 2])).toBeVec(1, 2); + expect(new Vec2([-3, 4.4])).toBeVec(-3, 4.4); + }); + + it('should return Vec2(x, y) if called with (Vec2(x, y))', () => { + let v = new Vec2(3.4, 5.6); + expect(new Vec2(v)).toBeVec(v); + }); + + it('should return Vec2(x, y) if called with (Float64Array([x, y]))', () => { + let arr = new Float64Array([1.2, 3.4]); + expect(new Vec2(arr)).toBeVec(arr); + }); + }); + + describe('static methods', () => { + describe('create', () => { + it('should return Vec2(0, 0)', () => expect(Vec2.create()).toBeVec(0, 0)); + }); + + describe('add', () => { + let result: Vec2Like; + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(4, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(4, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('with raw array as the output', () => { + let outArray: Vec2Like = [0, 0]; + beforeEach(() => { result = Vec2.add(outArray, vecA, vecB); }); + + it('should place values into out', () => expect(outArray).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(outArray)); + }); + + describe('with raw arrays as the inputs', () => { + beforeEach(() => { result = Vec2.add(out, [1, 2], [3, 4]); }); + + it('should place values into out', () => expect(out).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(out)); + }); + }); + }); + + describe('static', () => { + let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: any; + + beforeEach(() => { + vecA = new Vec2(1, 2); + vecB = new Vec2(3, 4); + out = new Vec2(0, 0); + }); + + describe('create', () => { + beforeEach(() => { result = Vec2.create(); }); + + it('should return a 2 element array initialized to 0s', () => expect(result).toBeVec(0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Vec2.clone(vecA); }); + + it('should return a 2 element array initialized to the values in vecA', () => expect(result).toBeVec(vecA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Vec2.fromValues(1, 2); }); + + it('should return a 2 element array initialized to the values passed', () => expect(result).toBeVec(1, 2)); + }); + + describe('copy', () => { + beforeEach(() => { result = Vec2.copy(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Vec2.set(out, 1, 2); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(4, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(4, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(4, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Vec2.sub).toEqual(Vec2.subtract)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.subtract(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-2, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.subtract(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-2, -2)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.subtract(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-2, -2)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Vec2.mul).toEqual(Vec2.multiply)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.multiply(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.multiply(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 8)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.multiply(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 8)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('divide', () => { + it('should have an alias called `div`', () => expect(Vec2.div).toEqual(Vec2.divide)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.divide(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(0.3333333, 0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.divide(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0.3333333, 0.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.divide(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0.3333333, 0.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('ceil', () => { + beforeEach(() => { vecA = [Math.E, Math.PI]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.ceil(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.ceil(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('floor', () => { + beforeEach(() => { vecA = [Math.E, Math.PI]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.floor(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.floor(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('min', () => { + beforeEach(() => { vecA = [1, 4]; vecB = [3, 2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.min(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.min(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.min(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(1, 2)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + }); + }); + + describe('max', () => { + beforeEach(() => { vecA = [1, 4]; vecB = [3, 2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.max(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.max(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 2)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.max(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 4)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 4)); + }); + }); + + describe('round', () => { + beforeEach(() => { vecA = [Math.E, Math.PI]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.round(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.round(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scale', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.scale(out, vecA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.scale(vecA, vecA, 2); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scaleAndAdd', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(2.5, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2.5, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(2.5, 4)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + describe('distance', () => { + beforeEach(() => { result = Vec2.distance(vecA, vecB); }); + + it('should have an alias called `dist`', () => expect(Vec2.dist).toEqual(Vec2.distance)); + it('should return the distance', () => expect(result).toBeCloseTo(2.828427)); + }); + + describe('squaredDistance', () => { + beforeEach(() => { result = Vec2.squaredDistance(vecA, vecB); }); + + it('should have an alias called `sqrDist`', () => expect(Vec2.sqrDist).toEqual(Vec2.squaredDistance)); + it('should return the squared distance', () => expect(result).toEqual(8)); + }); + + describe('length', () => { + beforeEach(() => { result = Vec2.len(vecA); }); + + it('should have an alias called `len`', () => expect(Vec2.len).toEqual(Vec2.length)); + it('should return the length', () => expect(result).toBeCloseTo(2.236067)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Vec2.squaredLength(vecA); }); + + it('should have an alias called `sqrLen`', () => expect(Vec2.sqrLen).toEqual(Vec2.squaredLength)); + it('should return the squared length', () => expect(result).toEqual(5)); + }); + + describe('negate', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.negate(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.negate(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-1, -2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('inverse', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.inverse(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1/2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.inverse(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('abs', () => { + beforeEach(() => { vecA = [-1, -2]; }); + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.abs(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(-1, -2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.abs(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('normalize', () => { + beforeEach(() => { vecA = [5, 0]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.normalize(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(5, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.normalize(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('dot', () => { + beforeEach(() => { result = Vec2.dot(vecA, vecB); }); + + it('should return the dot product', () => expect(result).toEqual(11)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('cross', () => { + let out3; + + beforeEach(() => { + out3 = [0, 0, 0]; + result = Vec2.cross(out3, vecA, vecB); + }); + + it('should place values into out', () => expect(out3).toBeVec(0, 0, -2)); + it('should return out', () => expect(result).toBe(out3)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('lerp', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.lerp(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.lerp(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 4)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec2.lerp(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(2, 3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + }); + + /*describe('random', () => { + describe('with no scale', () => { + beforeEach(() => { result = Vec2.random(out); }); + + it('should result in a unit length vector', () => expect(Vec2.len(out)).toBeCloseTo(1.0)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a scale', () => { + beforeEach(() => { result = Vec2.random(out, 5.0); }); + + it('should result in a unit length vector', () => expect(Vec2.len(out)).toBeCloseTo(5.0)); + it('should return out', () => expect(result).toBe(out)); + }); + });*/ + + describe('transformMat2', () => { + let matA; + + beforeEach(() => { matA = [1, 2, 3, 4]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.transformMat2(out, vecA, matA); }); + + it('should place values into out', () => expect(out).toBeVec(7, 10)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.transformMat2(vecA, vecA, matA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(7, 10)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('transformMat2d', () => { + let matA; + + beforeEach(() => { matA = [1, 2, 3, 4, 5, 6]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec2.transformMat2d(out, vecA, matA); }); + + it('should place values into out', () => expect(out).toBeVec(12, 16)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec2.transformMat2d(vecA, vecA, matA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(12, 16)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6)); + }); + }); + + /*describe('forEach', () => { + let vecArray; + + beforeEach(() => { + vecArray = [ + 1, 2, + 3, 4, + 0, 0 + ]; + }); + + describe('when performing operations that take no extra arguments', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, Vec2.normalize); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 0.447214, 0.894427, + 0.6, 0.8, + 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + + describe('when performing operations that takes one extra arguments', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, Vec2.add, vecA); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 2, 4, + 4, 6, + 1, 2 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when specifying an offset', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 2, 0, Vec2.add, vecA); }); + + it('should update all values except the first vector', () => { + expect(vecArray).toBeEqualish([ + 1, 2, + 4, 6, + 1, 2 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when specifying a count', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 2, Vec2.add, vecA); }); + + it('should update all values except the last vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, + 4, 6, + 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when specifying a stride', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 4, 0, 0, Vec2.add, vecA); }); + + it('should update all values except the second vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, + 3, 4, + 1, 2 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); + }); + + describe('when calling a function that does not modify the out variable', () => { + beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, function(out, vec) {}); }); + + it('values should remain unchanged', () => { + expect(vecArray).toBeEqualish([ + 1, 2, + 3, 4, + 0, 0, + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + });*/ + + describe('rotate', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [0, 1]; + vecB = [0, 0]; + result = Vec2.rotate(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -1)); + }); + + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [6, -5]; + vecB = [0, -5]; + result = Vec2.rotate(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(-6, -5)); + }); + }); + + describe('angle', () => { + beforeEach(() => { + vecA = [1,0]; + vecB = [1,2]; + result = Vec2.angle(vecA, vecB); + }); + + it('should return the angle', () => expect(result).toBeCloseTo(1.10714)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0)); + it('should not modify vecB', () => expect(vecB).toBeVec(1, 2)); + }); + + describe('str', () => { + it('should return a string representation of the vector', () => expect(Vec2.str(vecA)).toEqual('Vec2(1, 2)')); + }); + + describe('exactEquals', () => { + let vecC, r0, r1; + + beforeEach(() => { + vecA = [0, 1]; + vecB = [0, 1]; + vecC = [1, 2]; + r0 = Vec2.exactEquals(vecA, vecB); + r1 = Vec2.exactEquals(vecA, vecC); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1)); + }); + + describe('equals', () => { + let vecC, vecD, r0, r1, r2; + + beforeEach(() => { + vecA = [0, 1]; + vecB = [0, 1]; + vecC = [1, 2]; + vecD = [1e-16, 1]; + r0 = Vec2.equals(vecA, vecB); + r1 = Vec2.equals(vecA, vecC); + r2 = Vec2.equals(vecA, vecD); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should return true for close but not identical vectors', () => expect(r2).toBe(true)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1)); + }); + + describe('zero', () => { + beforeEach(() => { + vecA = [1, 2]; + result = Vec2.zero(vecA); + }); + + it('should result in a 2 element vector with zeros', () => expect(result).toBeVec(0, 0)); + }); + }); +}); diff --git a/tests/f64/Vec3-swizzle.spec.ts b/tests/f64/Vec3-swizzle.spec.ts new file mode 100644 index 00000000..e6b388a2 --- /dev/null +++ b/tests/f64/Vec3-swizzle.spec.ts @@ -0,0 +1,2123 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec3 } from '#gl-matrix/f64'; +import { EnableSwizzlesF64 } from '#gl-matrix/swizzle/f64'; + +describe('Vec3 Swizzles', () => { + EnableSwizzlesF64(); + + let v: Vec3; + beforeEach(() => { v = new Vec3(1, 2, 3); }); + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + describe('Vec3().xx', () => { + it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xy', () => { + it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xz', () => { + it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yx', () => { + it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yy', () => { + it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yz', () => { + it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zx', () => { + it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zy', () => { + it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zz', () => { + it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxx', () => { + it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxy', () => { + it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxz', () => { + it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyx', () => { + it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyy', () => { + it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyz', () => { + it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzx', () => { + it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzy', () => { + it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzz', () => { + it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxx', () => { + it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxy', () => { + it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxz', () => { + it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyx', () => { + it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyy', () => { + it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyz', () => { + it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzx', () => { + it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzy', () => { + it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzz', () => { + it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxx', () => { + it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxy', () => { + it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxz', () => { + it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyx', () => { + it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyy', () => { + it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyz', () => { + it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzx', () => { + it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzy', () => { + it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzz', () => { + it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxxx', () => { + it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxxy', () => { + it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxxz', () => { + it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxyx', () => { + it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxyy', () => { + it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxyz', () => { + it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxzx', () => { + it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxzy', () => { + it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xxzz', () => { + it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyxx', () => { + it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyxy', () => { + it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyxz', () => { + it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyyx', () => { + it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyyy', () => { + it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyyz', () => { + it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyzx', () => { + it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyzy', () => { + it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xyzz', () => { + it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzxx', () => { + it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzxy', () => { + it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzxz', () => { + it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzyx', () => { + it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzyy', () => { + it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzyz', () => { + it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzzx', () => { + it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzzy', () => { + it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().xzzz', () => { + it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxxx', () => { + it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxxy', () => { + it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxxz', () => { + it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxyx', () => { + it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxyy', () => { + it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxyz', () => { + it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxzx', () => { + it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxzy', () => { + it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yxzz', () => { + it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyxx', () => { + it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyxy', () => { + it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyxz', () => { + it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyyx', () => { + it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyyy', () => { + it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyyz', () => { + it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyzx', () => { + it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyzy', () => { + it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yyzz', () => { + it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzxx', () => { + it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzxy', () => { + it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzxz', () => { + it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzyx', () => { + it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzyy', () => { + it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzyz', () => { + it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzzx', () => { + it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzzy', () => { + it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().yzzz', () => { + it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxxx', () => { + it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxxy', () => { + it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxxz', () => { + it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxyx', () => { + it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxyy', () => { + it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxyz', () => { + it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxzx', () => { + it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxzy', () => { + it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zxzz', () => { + it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyxx', () => { + it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyxy', () => { + it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyxz', () => { + it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyyx', () => { + it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyyy', () => { + it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyyz', () => { + it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyzx', () => { + it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyzy', () => { + it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zyzz', () => { + it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzxx', () => { + it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzxy', () => { + it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzxz', () => { + it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzyx', () => { + it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzyy', () => { + it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzyz', () => { + it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzzx', () => { + it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzzy', () => { + it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().zzzz', () => { + it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rr', () => { + it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rg', () => { + it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rb', () => { + it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gr', () => { + it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gg', () => { + it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gb', () => { + it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().br', () => { + it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.br; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bg', () => { + it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bb', () => { + it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrr', () => { + it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrg', () => { + it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrb', () => { + it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgr', () => { + it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgg', () => { + it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgb', () => { + it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbr', () => { + it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbg', () => { + it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbb', () => { + it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grr', () => { + it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grg', () => { + it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grb', () => { + it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggr', () => { + it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggg', () => { + it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggb', () => { + it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbr', () => { + it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbg', () => { + it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbb', () => { + it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brr', () => { + it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brg', () => { + it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brb', () => { + it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgr', () => { + it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgg', () => { + it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgb', () => { + it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbr', () => { + it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbg', () => { + it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbb', () => { + it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrrr', () => { + it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrrg', () => { + it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrrb', () => { + it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrgr', () => { + it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rrgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrgg', () => { + it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rrgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrgb', () => { + it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rrgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrbr', () => { + it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rrbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrbg', () => { + it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rrbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rrbb', () => { + it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rrbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgrr', () => { + it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgrg', () => { + it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgrb', () => { + it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rggr', () => { + it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rggg', () => { + it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rggb', () => { + it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgbr', () => { + it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgbg', () => { + it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rgbb', () => { + it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbrr', () => { + it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbrg', () => { + it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbrb', () => { + it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbgr', () => { + it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbgg', () => { + it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbgb', () => { + it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbbr', () => { + it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbbg', () => { + it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().rbbb', () => { + it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grrr', () => { + it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grrg', () => { + it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grrb', () => { + it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grgr', () => { + it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.grgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grgg', () => { + it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.grgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grgb', () => { + it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.grgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grbr', () => { + it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.grbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grbg', () => { + it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.grbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().grbb', () => { + it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.grbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggrr', () => { + it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ggrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggrg', () => { + it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ggrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggrb', () => { + it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.ggrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gggr', () => { + it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gggg', () => { + it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gggb', () => { + it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggbr', () => { + it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.ggbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggbg', () => { + it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.ggbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().ggbb', () => { + it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.ggbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbrr', () => { + it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.gbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbrg', () => { + it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.gbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbrb', () => { + it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.gbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbgr', () => { + it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbgg', () => { + it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbgb', () => { + it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbbr', () => { + it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbbg', () => { + it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().gbbb', () => { + it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brrr', () => { + it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brrg', () => { + it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brrb', () => { + it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brgr', () => { + it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.brgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brgg', () => { + it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.brgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brgb', () => { + it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.brgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brbr', () => { + it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.brbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brbg', () => { + it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.brbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().brbb', () => { + it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.brbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgrr', () => { + it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgrg', () => { + it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgrb', () => { + it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bggr', () => { + it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bggg', () => { + it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bggb', () => { + it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgbr', () => { + it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgbg', () => { + it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bgbb', () => { + it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbrr', () => { + it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbrg', () => { + it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbrb', () => { + it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbgr', () => { + it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbgg', () => { + it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbgb', () => { + it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbbr', () => { + it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbbg', () => { + it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec3().bbbb', () => { + it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + // [/Swizzle Autogen] +}); diff --git a/tests/f64/Vec3.spec.ts b/tests/f64/Vec3.spec.ts new file mode 100644 index 00000000..f707da47 --- /dev/null +++ b/tests/f64/Vec3.spec.ts @@ -0,0 +1,727 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Mat4, Vec3 } from '#gl-matrix/f64'; + +import type { Mat4Like, Vec3Like } from '#gl-matrix/types'; + +describe('Vec3', () => { + describe('constructor', () => { + it('should return Vec3(0, 0, 0) if called with no arguments', () => expect(new Vec3()).toBeVec(0, 0, 0)); + + it('should return Vec3(x, y, z) if called with (x, y, z)', () => { + expect(new Vec3(1, 2, 3)).toBeVec(1, 2, 3); + expect(new Vec3(-3, 4.4, -5.6)).toBeVec(-3, 4.4, -5.6); + }); + + it('should return Vec3(x, x, x) if called with (x)', () => { + expect(new Vec3(1)).toBeVec(1, 1, 1); + expect(new Vec3(-2.3)).toBeVec(-2.3, -2.3, -2.3); + }); + + it('should return Vec3(x, y, z) if called with ([x, y, z])', () => { + expect(new Vec3([1, 2, 3])).toBeVec(1, 2, 3); + expect(new Vec3([-3, 4.4, -5.6])).toBeVec(-3, 4.4, -5.6); + }); + + it('should return Vec3(x, y, z) if called with (Vec3(x, y, z))', () => { + let v = new Vec3(3.4, 5.6, 7.8); + expect(new Vec3(v)).toBeVec(v); + }); + + it('should return Vec3(x, y, z) if called with (Float64Array([x, y, z]))', () => { + let arr = new Float64Array([1.2, 3.4, 5.6]); + expect(new Vec3(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Vec3Like; + let vecA: Vec3Like; + let vecB: Vec3Like; + let result: Vec3Like; + + beforeEach(() => { + vecA = new Vec3(1, 2, 3); + vecB = new Vec3(4, 5, 6); + out = new Vec3(0, 0, 0); + }); + + describe('rotateX', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [0, 1, 0]; + vecB = [0, 0, 0]; + result = Vec3.rotateX(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -1, 0)); + }); + + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [2, 7, 0]; + vecB = [2, 5, 0]; + result = Vec3.rotateX(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(2, 3, 0)); + }); + }); + + describe('rotateY', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [1, 0, 0]; + vecB = [0, 0, 0]; + result = Vec3.rotateY(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(-1, 0, 0)); + }); + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [-2, 3, 10]; + vecB = [-4, 3, 10]; + result = Vec3.rotateY(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(-6, 3, 10)); + }); + }); + + describe('rotateZ', () => { + describe('rotation around world origin [0, 0, 0]', () => { + beforeEach(() => { + vecA = [0, 1, 0]; + vecB = [0, 0, 0]; + result = Vec3.rotateZ(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -1, 0)); + }); + describe('rotation around an arbitrary origin', () => { + beforeEach(() => { + vecA = [0, 6, -5]; + vecB = [0, 0, -5]; + result = Vec3.rotateZ(out, vecA, vecB, Math.PI); + }); + + it('should return the rotated vector', () => expect(result).toBeVec(0, -6, -5)); + }); + }); + + describe('transformMat4', () => { + let matr : Mat4Like; + + describe('with an identity', () => { + beforeEach(() => { + matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; + result = Vec3.transformMat4(out, vecA, matr); + }); + + it('should produce the input', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a lookAt', () => { + beforeEach(() => { + matr = Mat4.lookAt(new Mat4(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); + result = Vec3.transformMat4(out, vecA, matr); + }); + + it('should rotate and translate the input', () => expect(out).toBeVec( 4, -4, -4 )); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a perspective matrix (#92)', () => { + it('should transform a point from perspective(pi/2, 4/3, 1, 100)', () => { + matr = [0.750, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1.02, -1, + 0, 0, -2.02, 0]; + result = Vec3.transformMat4([0, 0, 0], [10, 20, 30], matr); + expect(result).toBeVec(-0.25, -0.666666, 1.087333); + }); + }); + }); + + /*describe('transformMat3', () => { + let matr; + + describe('with an identity', () => { + beforeEach(() => { + matr = [1, 0, 0, 0, 1, 0, 0, 0, 1 ]; + result = Vec3.transformMat3(out, vecA, matr); + }); + + it('should produce the input', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with 90deg about X', () => { + beforeEach(() => { result = Vec3.transformMat3(out, [0,1,0], [1,0,0,0,0,1,0,-1,0]); }); + + it('should produce correct output', () => expect(out).toBeVec(0,0,1)); + }); + + describe('with 90deg about Y', () => { + beforeEach(() => { result = Vec3.transformMat3(out, [1,0,0], [0,0,-1,0,1,0,1,0,0]); }); + + it('should produce correct output', () => expect(out).toBeVec(0,0,-1)); + }); + + describe('with 90deg about Z', () => { + beforeEach(() => { result = Vec3.transformMat3(out, [1,0,0], [0,1,0,-1,0,0,0,0,1]); }); + + it('should produce correct output', () => expect(out).toBeVec(0,1,0)); + }); + + describe('with a lookAt normal matrix', () => { + beforeEach(() => { + matr = mat4.lookAt(mat4.create(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); + let n = mat3.create(); + matr = mat3.transpose(n, mat3.invert(n, mat3.fromMat4(n, matr))); + + result = Vec3.transformMat3(out, [1,0,0], matr); + }); + + it('should rotate the input', () => expect(out).toBeVec( 0,0,1 )); + it('should return out', () => expect(result).toBe(out)); + }); + });*/ + + describe('transformQuat', () => { + beforeEach(() => { + result = Vec3.transformQuat(out, vecA, + [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); + }); + + it('should rotate the input vector', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).not.toBe([1,2,3,4])); + }); + + describe('create', () => { + beforeEach(() => { result = Vec3.create(); }); + + it('should return a 3 element array initialized to 0s', () => expect(result).toBeVec(0, 0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Vec3.clone(vecA); }); + + it('should return a 3 element array initialized to the values in vecA', () => expect(result).toBeVec(vecA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Vec3.fromValues(1, 2, 3); }); + + it('should return a 3 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3)); + }); + + describe('copy', () => { + beforeEach(() => { result = Vec3.copy(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Vec3.set(out, 1, 2, 3); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(5, 7, 9)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(5, 7, 9)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(5, 7, 9)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Vec3.sub).toEqual(Vec3.subtract)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.subtract(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-3, -3, -3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.subtract(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-3, -3, -3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.subtract(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-3, -3, -3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Vec3.mul).toEqual(Vec3.multiply)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.multiply(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(4, 10, 18)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.multiply(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(4, 10, 18)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.multiply(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(4, 10, 18)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('divide', () => { + it('should have an alias called `div`', () => expect(Vec3.div).toEqual(Vec3.divide)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.divide(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(0.25, 0.4, 0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.divide(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0.25, 0.4, 0.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.divide(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0.25, 0.4, 0.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('ceil', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.ceil(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 2)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.ceil(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4, 2)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('floor', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.floor(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.floor(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('min', () => { + beforeEach(() => { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.min(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.min(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.min(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(1, 1, 1)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + }); + }); + + describe('max', () => { + beforeEach(() => { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.max(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.max(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.max(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 3, 3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1)); + }); + }); + + /*describe('round', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.round(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.round(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + });*/ + + describe('scale', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.scale(out, vecA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.scale(vecA, vecA, 2); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 4, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scaleAndAdd', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4.5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4.5, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 4.5, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('distance', () => { + it('should have an alias called `dist`', () => expect(Vec3.dist).toEqual(Vec3.distance)); + it('should return the distance', () => expect(Vec3.distance(vecA, vecB)).toBeCloseTo(5.196152)); + }); + + describe('squaredDistance', () => { + it('should have an alias called `sqrDist`', () => expect(Vec3.sqrDist).toEqual(Vec3.squaredDistance)); + it('should return the squared distance', () => expect(Vec3.squaredDistance(vecA, vecB)).toEqual(27)); + }); + + describe('length', () => { + it('should have an alias called `len`', () => expect(Vec3.len).toEqual(Vec3.length)); + it('should return the length', () => expect(Vec3.len(vecA)).toBeCloseTo(3.741657)); + }); + + describe('squaredLength', () => { + it('should have an alias called `sqrLen`', () => expect(Vec3.sqrLen).toEqual(Vec3.squaredLength)); + it('should return the squared length', () => expect(Vec3.squaredLength(vecA)).toEqual(14)); + }); + + describe('negate', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.negate(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2, -3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.negate(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-1, -2, -3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('inverse', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.inverse(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.inverse(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('abs', () => { + beforeEach(() => { vecA = [-1, -2, -3]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.abs(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(-1, -2, -3)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.abs(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('normalize', () => { + beforeEach(() => { vecA = [5, 0, 0]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.normalize(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(5, 0, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.normalize(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 0, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('dot', () => { + let value: number; + beforeEach(() => { value = Vec3.dot(vecA, vecB); }); + + it('should return the dot product', () => expect(value).toEqual(32)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('cross', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.cross(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-3, 6, -3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.cross(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-3, 6, -3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.cross(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-3, 6, -3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('lerp', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec3.lerp(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(2.5, 3.5, 4.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec3.lerp(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2.5, 3.5, 4.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec3.lerp(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(2.5, 3.5, 4.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + }); + }); + + describe('angle', () => { + let value: number; + + beforeEach(() => { value = Vec3.angle(vecA, vecB); }); + + it('should return the angle', () => expect(value).toBeCloseTo(0.225726)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(4, 5, 6)); + }); + + describe('str', () => { + it('should return a string representation of the vector', () => expect(Vec3.str(vecA)).toEqual('Vec3(1, 2, 3)')); + }); + + describe('exactEquals', () => { + let vecC: Vec3Like, r0: boolean, r1: boolean; + + beforeEach(() => { + vecA = [0, 1, 2]; + vecB = [0, 1, 2]; + vecC = [1, 2, 3]; + r0 = Vec3.exactEquals(vecA, vecB); + r1 = Vec3.exactEquals(vecA, vecC); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2)); + }); + + describe('equals', () => { + let vecC: Vec3Like, + vecD: Vec3Like, + r0: boolean, + r1: boolean, + r2: boolean; + + beforeEach(() => { + vecA = [0, 1, 2]; + vecB = [0, 1, 2]; + vecC = [1, 2, 3]; + vecD = [1e-16, 1, 2]; + r0 = Vec3.equals(vecA, vecB); + r1 = Vec3.equals(vecA, vecC); + r2 = Vec3.equals(vecA, vecD); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should return true for close but not identical vectors', () => expect(r2).toBe(true)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2)); + }); + + describe('zero', () => { + beforeEach(() => { + vecA = [1, 2, 3]; + result = Vec3.zero(vecA); + }); + + it('should result in a 3 element vector with zeros', () => expect(result).toBeVec(0, 0, 0)); + }); + }); +}); diff --git a/tests/f64/Vec4-swizzle.spec.ts b/tests/f64/Vec4-swizzle.spec.ts new file mode 100644 index 00000000..94fac599 --- /dev/null +++ b/tests/f64/Vec4-swizzle.spec.ts @@ -0,0 +1,6065 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec4 } from '#gl-matrix/f64'; +import { EnableSwizzlesF64 } from '#gl-matrix/swizzle/f64'; + +describe('Vec4 Swizzles', () => { + EnableSwizzlesF64(); + + let v: Vec4; + beforeEach(() => { v = new Vec4(1, 2, 3); }); + + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should + // not be modified by hand. + // [Swizzle Autogen] + + describe('Vec4().xx', () => { + it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xy', () => { + it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xz', () => { + it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xw', () => { + it('should return Vec2(x, w)', () => expect(v.xw).toBeVec(v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yx', () => { + it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yy', () => { + it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yz', () => { + it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yw', () => { + it('should return Vec2(y, w)', () => expect(v.yw).toBeVec(v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zx', () => { + it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zy', () => { + it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zz', () => { + it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zw', () => { + it('should return Vec2(z, w)', () => expect(v.zw).toBeVec(v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wx', () => { + it('should return Vec2(w, x)', () => expect(v.wx).toBeVec(v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wy', () => { + it('should return Vec2(w, y)', () => expect(v.wy).toBeVec(v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wz', () => { + it('should return Vec2(w, z)', () => expect(v.wz).toBeVec(v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ww', () => { + it('should return Vec2(w, w)', () => expect(v.ww).toBeVec(v[3], v[3])); + it('should be return a copy', () => { + let sw = v.ww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxx', () => { + it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxy', () => { + it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxz', () => { + it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxw', () => { + it('should return Vec3(x, x, w)', () => expect(v.xxw).toBeVec(v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyx', () => { + it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyy', () => { + it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyz', () => { + it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyw', () => { + it('should return Vec3(x, y, w)', () => expect(v.xyw).toBeVec(v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzx', () => { + it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzy', () => { + it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzz', () => { + it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzw', () => { + it('should return Vec3(x, z, w)', () => expect(v.xzw).toBeVec(v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwx', () => { + it('should return Vec3(x, w, x)', () => expect(v.xwx).toBeVec(v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwy', () => { + it('should return Vec3(x, w, y)', () => expect(v.xwy).toBeVec(v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwz', () => { + it('should return Vec3(x, w, z)', () => expect(v.xwz).toBeVec(v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xww', () => { + it('should return Vec3(x, w, w)', () => expect(v.xww).toBeVec(v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxx', () => { + it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxy', () => { + it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxz', () => { + it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxw', () => { + it('should return Vec3(y, x, w)', () => expect(v.yxw).toBeVec(v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyx', () => { + it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyy', () => { + it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyz', () => { + it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyw', () => { + it('should return Vec3(y, y, w)', () => expect(v.yyw).toBeVec(v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzx', () => { + it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzy', () => { + it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzz', () => { + it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzw', () => { + it('should return Vec3(y, z, w)', () => expect(v.yzw).toBeVec(v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywx', () => { + it('should return Vec3(y, w, x)', () => expect(v.ywx).toBeVec(v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywy', () => { + it('should return Vec3(y, w, y)', () => expect(v.ywy).toBeVec(v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywz', () => { + it('should return Vec3(y, w, z)', () => expect(v.ywz).toBeVec(v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yww', () => { + it('should return Vec3(y, w, w)', () => expect(v.yww).toBeVec(v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxx', () => { + it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxy', () => { + it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxz', () => { + it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxw', () => { + it('should return Vec3(z, x, w)', () => expect(v.zxw).toBeVec(v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyx', () => { + it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyy', () => { + it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyz', () => { + it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyw', () => { + it('should return Vec3(z, y, w)', () => expect(v.zyw).toBeVec(v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzx', () => { + it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzy', () => { + it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzz', () => { + it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzw', () => { + it('should return Vec3(z, z, w)', () => expect(v.zzw).toBeVec(v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwx', () => { + it('should return Vec3(z, w, x)', () => expect(v.zwx).toBeVec(v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwy', () => { + it('should return Vec3(z, w, y)', () => expect(v.zwy).toBeVec(v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwz', () => { + it('should return Vec3(z, w, z)', () => expect(v.zwz).toBeVec(v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zww', () => { + it('should return Vec3(z, w, w)', () => expect(v.zww).toBeVec(v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxx', () => { + it('should return Vec3(w, x, x)', () => expect(v.wxx).toBeVec(v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxy', () => { + it('should return Vec3(w, x, y)', () => expect(v.wxy).toBeVec(v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxz', () => { + it('should return Vec3(w, x, z)', () => expect(v.wxz).toBeVec(v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxw', () => { + it('should return Vec3(w, x, w)', () => expect(v.wxw).toBeVec(v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyx', () => { + it('should return Vec3(w, y, x)', () => expect(v.wyx).toBeVec(v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyy', () => { + it('should return Vec3(w, y, y)', () => expect(v.wyy).toBeVec(v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyz', () => { + it('should return Vec3(w, y, z)', () => expect(v.wyz).toBeVec(v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyw', () => { + it('should return Vec3(w, y, w)', () => expect(v.wyw).toBeVec(v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzx', () => { + it('should return Vec3(w, z, x)', () => expect(v.wzx).toBeVec(v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzy', () => { + it('should return Vec3(w, z, y)', () => expect(v.wzy).toBeVec(v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzz', () => { + it('should return Vec3(w, z, z)', () => expect(v.wzz).toBeVec(v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzw', () => { + it('should return Vec3(w, z, w)', () => expect(v.wzw).toBeVec(v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwx', () => { + it('should return Vec3(w, w, x)', () => expect(v.wwx).toBeVec(v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwy', () => { + it('should return Vec3(w, w, y)', () => expect(v.wwy).toBeVec(v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwz', () => { + it('should return Vec3(w, w, z)', () => expect(v.wwz).toBeVec(v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().www', () => { + it('should return Vec3(w, w, w)', () => expect(v.www).toBeVec(v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.www; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxx', () => { + it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxy', () => { + it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxz', () => { + it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxxw', () => { + it('should return Vec4(x, x, x, w)', () => expect(v.xxxw).toBeVec(v[0], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyx', () => { + it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyy', () => { + it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyz', () => { + it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxyw', () => { + it('should return Vec4(x, x, y, w)', () => expect(v.xxyw).toBeVec(v[0], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzx', () => { + it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzy', () => { + it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzz', () => { + it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxzw', () => { + it('should return Vec4(x, x, z, w)', () => expect(v.xxzw).toBeVec(v[0], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxwx', () => { + it('should return Vec4(x, x, w, x)', () => expect(v.xxwx).toBeVec(v[0], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxwy', () => { + it('should return Vec4(x, x, w, y)', () => expect(v.xxwy).toBeVec(v[0], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxwz', () => { + it('should return Vec4(x, x, w, z)', () => expect(v.xxwz).toBeVec(v[0], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xxww', () => { + it('should return Vec4(x, x, w, w)', () => expect(v.xxww).toBeVec(v[0], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxx', () => { + it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxy', () => { + it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxz', () => { + it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyxw', () => { + it('should return Vec4(x, y, x, w)', () => expect(v.xyxw).toBeVec(v[0], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyx', () => { + it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyy', () => { + it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyz', () => { + it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyyw', () => { + it('should return Vec4(x, y, y, w)', () => expect(v.xyyw).toBeVec(v[0], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzx', () => { + it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzy', () => { + it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzz', () => { + it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyzw', () => { + it('should return Vec4(x, y, z, w)', () => expect(v.xyzw).toBeVec(v[0], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xywx', () => { + it('should return Vec4(x, y, w, x)', () => expect(v.xywx).toBeVec(v[0], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xywy', () => { + it('should return Vec4(x, y, w, y)', () => expect(v.xywy).toBeVec(v[0], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xywz', () => { + it('should return Vec4(x, y, w, z)', () => expect(v.xywz).toBeVec(v[0], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xyww', () => { + it('should return Vec4(x, y, w, w)', () => expect(v.xyww).toBeVec(v[0], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxx', () => { + it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxy', () => { + it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxz', () => { + it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzxw', () => { + it('should return Vec4(x, z, x, w)', () => expect(v.xzxw).toBeVec(v[0], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyx', () => { + it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyy', () => { + it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyz', () => { + it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzyw', () => { + it('should return Vec4(x, z, y, w)', () => expect(v.xzyw).toBeVec(v[0], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzx', () => { + it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzy', () => { + it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzz', () => { + it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzzw', () => { + it('should return Vec4(x, z, z, w)', () => expect(v.xzzw).toBeVec(v[0], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzwx', () => { + it('should return Vec4(x, z, w, x)', () => expect(v.xzwx).toBeVec(v[0], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzwy', () => { + it('should return Vec4(x, z, w, y)', () => expect(v.xzwy).toBeVec(v[0], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzwz', () => { + it('should return Vec4(x, z, w, z)', () => expect(v.xzwz).toBeVec(v[0], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xzww', () => { + it('should return Vec4(x, z, w, w)', () => expect(v.xzww).toBeVec(v[0], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxx', () => { + it('should return Vec4(x, w, x, x)', () => expect(v.xwxx).toBeVec(v[0], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.xwxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxy', () => { + it('should return Vec4(x, w, x, y)', () => expect(v.xwxy).toBeVec(v[0], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.xwxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxz', () => { + it('should return Vec4(x, w, x, z)', () => expect(v.xwxz).toBeVec(v[0], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.xwxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwxw', () => { + it('should return Vec4(x, w, x, w)', () => expect(v.xwxw).toBeVec(v[0], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.xwxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyx', () => { + it('should return Vec4(x, w, y, x)', () => expect(v.xwyx).toBeVec(v[0], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.xwyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyy', () => { + it('should return Vec4(x, w, y, y)', () => expect(v.xwyy).toBeVec(v[0], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.xwyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyz', () => { + it('should return Vec4(x, w, y, z)', () => expect(v.xwyz).toBeVec(v[0], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.xwyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwyw', () => { + it('should return Vec4(x, w, y, w)', () => expect(v.xwyw).toBeVec(v[0], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.xwyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzx', () => { + it('should return Vec4(x, w, z, x)', () => expect(v.xwzx).toBeVec(v[0], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.xwzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzy', () => { + it('should return Vec4(x, w, z, y)', () => expect(v.xwzy).toBeVec(v[0], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.xwzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzz', () => { + it('should return Vec4(x, w, z, z)', () => expect(v.xwzz).toBeVec(v[0], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.xwzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwzw', () => { + it('should return Vec4(x, w, z, w)', () => expect(v.xwzw).toBeVec(v[0], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.xwzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwwx', () => { + it('should return Vec4(x, w, w, x)', () => expect(v.xwwx).toBeVec(v[0], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.xwwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwwy', () => { + it('should return Vec4(x, w, w, y)', () => expect(v.xwwy).toBeVec(v[0], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.xwwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwwz', () => { + it('should return Vec4(x, w, w, z)', () => expect(v.xwwz).toBeVec(v[0], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.xwwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().xwww', () => { + it('should return Vec4(x, w, w, w)', () => expect(v.xwww).toBeVec(v[0], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.xwww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxx', () => { + it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxy', () => { + it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxz', () => { + it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxxw', () => { + it('should return Vec4(y, x, x, w)', () => expect(v.yxxw).toBeVec(v[1], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyx', () => { + it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyy', () => { + it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyz', () => { + it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxyw', () => { + it('should return Vec4(y, x, y, w)', () => expect(v.yxyw).toBeVec(v[1], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzx', () => { + it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzy', () => { + it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzz', () => { + it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxzw', () => { + it('should return Vec4(y, x, z, w)', () => expect(v.yxzw).toBeVec(v[1], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxwx', () => { + it('should return Vec4(y, x, w, x)', () => expect(v.yxwx).toBeVec(v[1], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.yxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxwy', () => { + it('should return Vec4(y, x, w, y)', () => expect(v.yxwy).toBeVec(v[1], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.yxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxwz', () => { + it('should return Vec4(y, x, w, z)', () => expect(v.yxwz).toBeVec(v[1], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.yxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yxww', () => { + it('should return Vec4(y, x, w, w)', () => expect(v.yxww).toBeVec(v[1], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxx', () => { + it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxy', () => { + it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxz', () => { + it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyxw', () => { + it('should return Vec4(y, y, x, w)', () => expect(v.yyxw).toBeVec(v[1], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyx', () => { + it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyy', () => { + it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyz', () => { + it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyyw', () => { + it('should return Vec4(y, y, y, w)', () => expect(v.yyyw).toBeVec(v[1], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzx', () => { + it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzy', () => { + it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzz', () => { + it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyzw', () => { + it('should return Vec4(y, y, z, w)', () => expect(v.yyzw).toBeVec(v[1], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yywx', () => { + it('should return Vec4(y, y, w, x)', () => expect(v.yywx).toBeVec(v[1], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.yywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yywy', () => { + it('should return Vec4(y, y, w, y)', () => expect(v.yywy).toBeVec(v[1], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.yywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yywz', () => { + it('should return Vec4(y, y, w, z)', () => expect(v.yywz).toBeVec(v[1], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.yywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yyww', () => { + it('should return Vec4(y, y, w, w)', () => expect(v.yyww).toBeVec(v[1], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxx', () => { + it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.yzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxy', () => { + it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.yzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxz', () => { + it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.yzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzxw', () => { + it('should return Vec4(y, z, x, w)', () => expect(v.yzxw).toBeVec(v[1], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.yzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyx', () => { + it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.yzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyy', () => { + it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.yzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyz', () => { + it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.yzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzyw', () => { + it('should return Vec4(y, z, y, w)', () => expect(v.yzyw).toBeVec(v[1], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.yzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzx', () => { + it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.yzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzy', () => { + it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.yzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzz', () => { + it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.yzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzzw', () => { + it('should return Vec4(y, z, z, w)', () => expect(v.yzzw).toBeVec(v[1], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.yzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzwx', () => { + it('should return Vec4(y, z, w, x)', () => expect(v.yzwx).toBeVec(v[1], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.yzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzwy', () => { + it('should return Vec4(y, z, w, y)', () => expect(v.yzwy).toBeVec(v[1], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.yzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzwz', () => { + it('should return Vec4(y, z, w, z)', () => expect(v.yzwz).toBeVec(v[1], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.yzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().yzww', () => { + it('should return Vec4(y, z, w, w)', () => expect(v.yzww).toBeVec(v[1], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.yzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxx', () => { + it('should return Vec4(y, w, x, x)', () => expect(v.ywxx).toBeVec(v[1], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ywxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxy', () => { + it('should return Vec4(y, w, x, y)', () => expect(v.ywxy).toBeVec(v[1], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ywxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxz', () => { + it('should return Vec4(y, w, x, z)', () => expect(v.ywxz).toBeVec(v[1], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.ywxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywxw', () => { + it('should return Vec4(y, w, x, w)', () => expect(v.ywxw).toBeVec(v[1], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ywxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyx', () => { + it('should return Vec4(y, w, y, x)', () => expect(v.ywyx).toBeVec(v[1], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ywyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyy', () => { + it('should return Vec4(y, w, y, y)', () => expect(v.ywyy).toBeVec(v[1], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ywyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyz', () => { + it('should return Vec4(y, w, y, z)', () => expect(v.ywyz).toBeVec(v[1], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ywyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywyw', () => { + it('should return Vec4(y, w, y, w)', () => expect(v.ywyw).toBeVec(v[1], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.ywyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzx', () => { + it('should return Vec4(y, w, z, x)', () => expect(v.ywzx).toBeVec(v[1], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.ywzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzy', () => { + it('should return Vec4(y, w, z, y)', () => expect(v.ywzy).toBeVec(v[1], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.ywzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzz', () => { + it('should return Vec4(y, w, z, z)', () => expect(v.ywzz).toBeVec(v[1], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.ywzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywzw', () => { + it('should return Vec4(y, w, z, w)', () => expect(v.ywzw).toBeVec(v[1], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.ywzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywwx', () => { + it('should return Vec4(y, w, w, x)', () => expect(v.ywwx).toBeVec(v[1], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ywwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywwy', () => { + it('should return Vec4(y, w, w, y)', () => expect(v.ywwy).toBeVec(v[1], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ywwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywwz', () => { + it('should return Vec4(y, w, w, z)', () => expect(v.ywwz).toBeVec(v[1], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ywwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ywww', () => { + it('should return Vec4(y, w, w, w)', () => expect(v.ywww).toBeVec(v[1], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.ywww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxx', () => { + it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxy', () => { + it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxz', () => { + it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxxw', () => { + it('should return Vec4(z, x, x, w)', () => expect(v.zxxw).toBeVec(v[2], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyx', () => { + it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyy', () => { + it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyz', () => { + it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxyw', () => { + it('should return Vec4(z, x, y, w)', () => expect(v.zxyw).toBeVec(v[2], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzx', () => { + it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzy', () => { + it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzz', () => { + it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxzw', () => { + it('should return Vec4(z, x, z, w)', () => expect(v.zxzw).toBeVec(v[2], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxwx', () => { + it('should return Vec4(z, x, w, x)', () => expect(v.zxwx).toBeVec(v[2], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxwy', () => { + it('should return Vec4(z, x, w, y)', () => expect(v.zxwy).toBeVec(v[2], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxwz', () => { + it('should return Vec4(z, x, w, z)', () => expect(v.zxwz).toBeVec(v[2], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zxww', () => { + it('should return Vec4(z, x, w, w)', () => expect(v.zxww).toBeVec(v[2], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxx', () => { + it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxy', () => { + it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxz', () => { + it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyxw', () => { + it('should return Vec4(z, y, x, w)', () => expect(v.zyxw).toBeVec(v[2], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyx', () => { + it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyy', () => { + it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyz', () => { + it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyyw', () => { + it('should return Vec4(z, y, y, w)', () => expect(v.zyyw).toBeVec(v[2], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzx', () => { + it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzy', () => { + it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzz', () => { + it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyzw', () => { + it('should return Vec4(z, y, z, w)', () => expect(v.zyzw).toBeVec(v[2], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zywx', () => { + it('should return Vec4(z, y, w, x)', () => expect(v.zywx).toBeVec(v[2], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zywy', () => { + it('should return Vec4(z, y, w, y)', () => expect(v.zywy).toBeVec(v[2], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zywz', () => { + it('should return Vec4(z, y, w, z)', () => expect(v.zywz).toBeVec(v[2], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zyww', () => { + it('should return Vec4(z, y, w, w)', () => expect(v.zyww).toBeVec(v[2], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxx', () => { + it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxy', () => { + it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxz', () => { + it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzxw', () => { + it('should return Vec4(z, z, x, w)', () => expect(v.zzxw).toBeVec(v[2], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyx', () => { + it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyy', () => { + it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyz', () => { + it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzyw', () => { + it('should return Vec4(z, z, y, w)', () => expect(v.zzyw).toBeVec(v[2], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzx', () => { + it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzy', () => { + it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzz', () => { + it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzzw', () => { + it('should return Vec4(z, z, z, w)', () => expect(v.zzzw).toBeVec(v[2], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzwx', () => { + it('should return Vec4(z, z, w, x)', () => expect(v.zzwx).toBeVec(v[2], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzwy', () => { + it('should return Vec4(z, z, w, y)', () => expect(v.zzwy).toBeVec(v[2], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzwz', () => { + it('should return Vec4(z, z, w, z)', () => expect(v.zzwz).toBeVec(v[2], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zzww', () => { + it('should return Vec4(z, z, w, w)', () => expect(v.zzww).toBeVec(v[2], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxx', () => { + it('should return Vec4(z, w, x, x)', () => expect(v.zwxx).toBeVec(v[2], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.zwxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxy', () => { + it('should return Vec4(z, w, x, y)', () => expect(v.zwxy).toBeVec(v[2], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.zwxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxz', () => { + it('should return Vec4(z, w, x, z)', () => expect(v.zwxz).toBeVec(v[2], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.zwxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwxw', () => { + it('should return Vec4(z, w, x, w)', () => expect(v.zwxw).toBeVec(v[2], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.zwxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyx', () => { + it('should return Vec4(z, w, y, x)', () => expect(v.zwyx).toBeVec(v[2], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.zwyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyy', () => { + it('should return Vec4(z, w, y, y)', () => expect(v.zwyy).toBeVec(v[2], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.zwyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyz', () => { + it('should return Vec4(z, w, y, z)', () => expect(v.zwyz).toBeVec(v[2], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.zwyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwyw', () => { + it('should return Vec4(z, w, y, w)', () => expect(v.zwyw).toBeVec(v[2], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.zwyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzx', () => { + it('should return Vec4(z, w, z, x)', () => expect(v.zwzx).toBeVec(v[2], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.zwzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzy', () => { + it('should return Vec4(z, w, z, y)', () => expect(v.zwzy).toBeVec(v[2], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.zwzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzz', () => { + it('should return Vec4(z, w, z, z)', () => expect(v.zwzz).toBeVec(v[2], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.zwzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwzw', () => { + it('should return Vec4(z, w, z, w)', () => expect(v.zwzw).toBeVec(v[2], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.zwzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwwx', () => { + it('should return Vec4(z, w, w, x)', () => expect(v.zwwx).toBeVec(v[2], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.zwwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwwy', () => { + it('should return Vec4(z, w, w, y)', () => expect(v.zwwy).toBeVec(v[2], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.zwwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwwz', () => { + it('should return Vec4(z, w, w, z)', () => expect(v.zwwz).toBeVec(v[2], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.zwwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().zwww', () => { + it('should return Vec4(z, w, w, w)', () => expect(v.zwww).toBeVec(v[2], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.zwww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxx', () => { + it('should return Vec4(w, x, x, x)', () => expect(v.wxxx).toBeVec(v[3], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wxxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxy', () => { + it('should return Vec4(w, x, x, y)', () => expect(v.wxxy).toBeVec(v[3], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wxxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxz', () => { + it('should return Vec4(w, x, x, z)', () => expect(v.wxxz).toBeVec(v[3], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wxxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxxw', () => { + it('should return Vec4(w, x, x, w)', () => expect(v.wxxw).toBeVec(v[3], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wxxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyx', () => { + it('should return Vec4(w, x, y, x)', () => expect(v.wxyx).toBeVec(v[3], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wxyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyy', () => { + it('should return Vec4(w, x, y, y)', () => expect(v.wxyy).toBeVec(v[3], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wxyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyz', () => { + it('should return Vec4(w, x, y, z)', () => expect(v.wxyz).toBeVec(v[3], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wxyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxyw', () => { + it('should return Vec4(w, x, y, w)', () => expect(v.wxyw).toBeVec(v[3], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wxyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzx', () => { + it('should return Vec4(w, x, z, x)', () => expect(v.wxzx).toBeVec(v[3], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wxzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzy', () => { + it('should return Vec4(w, x, z, y)', () => expect(v.wxzy).toBeVec(v[3], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wxzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzz', () => { + it('should return Vec4(w, x, z, z)', () => expect(v.wxzz).toBeVec(v[3], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wxzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxzw', () => { + it('should return Vec4(w, x, z, w)', () => expect(v.wxzw).toBeVec(v[3], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wxzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxwx', () => { + it('should return Vec4(w, x, w, x)', () => expect(v.wxwx).toBeVec(v[3], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wxwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxwy', () => { + it('should return Vec4(w, x, w, y)', () => expect(v.wxwy).toBeVec(v[3], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wxwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxwz', () => { + it('should return Vec4(w, x, w, z)', () => expect(v.wxwz).toBeVec(v[3], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wxwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wxww', () => { + it('should return Vec4(w, x, w, w)', () => expect(v.wxww).toBeVec(v[3], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wxww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxx', () => { + it('should return Vec4(w, y, x, x)', () => expect(v.wyxx).toBeVec(v[3], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wyxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxy', () => { + it('should return Vec4(w, y, x, y)', () => expect(v.wyxy).toBeVec(v[3], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wyxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxz', () => { + it('should return Vec4(w, y, x, z)', () => expect(v.wyxz).toBeVec(v[3], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wyxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyxw', () => { + it('should return Vec4(w, y, x, w)', () => expect(v.wyxw).toBeVec(v[3], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wyxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyx', () => { + it('should return Vec4(w, y, y, x)', () => expect(v.wyyx).toBeVec(v[3], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wyyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyy', () => { + it('should return Vec4(w, y, y, y)', () => expect(v.wyyy).toBeVec(v[3], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wyyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyz', () => { + it('should return Vec4(w, y, y, z)', () => expect(v.wyyz).toBeVec(v[3], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wyyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyyw', () => { + it('should return Vec4(w, y, y, w)', () => expect(v.wyyw).toBeVec(v[3], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wyyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzx', () => { + it('should return Vec4(w, y, z, x)', () => expect(v.wyzx).toBeVec(v[3], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wyzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzy', () => { + it('should return Vec4(w, y, z, y)', () => expect(v.wyzy).toBeVec(v[3], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wyzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzz', () => { + it('should return Vec4(w, y, z, z)', () => expect(v.wyzz).toBeVec(v[3], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wyzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyzw', () => { + it('should return Vec4(w, y, z, w)', () => expect(v.wyzw).toBeVec(v[3], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wyzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wywx', () => { + it('should return Vec4(w, y, w, x)', () => expect(v.wywx).toBeVec(v[3], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wywx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wywy', () => { + it('should return Vec4(w, y, w, y)', () => expect(v.wywy).toBeVec(v[3], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wywy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wywz', () => { + it('should return Vec4(w, y, w, z)', () => expect(v.wywz).toBeVec(v[3], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wywz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wyww', () => { + it('should return Vec4(w, y, w, w)', () => expect(v.wyww).toBeVec(v[3], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wyww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxx', () => { + it('should return Vec4(w, z, x, x)', () => expect(v.wzxx).toBeVec(v[3], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wzxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxy', () => { + it('should return Vec4(w, z, x, y)', () => expect(v.wzxy).toBeVec(v[3], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wzxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxz', () => { + it('should return Vec4(w, z, x, z)', () => expect(v.wzxz).toBeVec(v[3], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wzxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzxw', () => { + it('should return Vec4(w, z, x, w)', () => expect(v.wzxw).toBeVec(v[3], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wzxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyx', () => { + it('should return Vec4(w, z, y, x)', () => expect(v.wzyx).toBeVec(v[3], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wzyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyy', () => { + it('should return Vec4(w, z, y, y)', () => expect(v.wzyy).toBeVec(v[3], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wzyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyz', () => { + it('should return Vec4(w, z, y, z)', () => expect(v.wzyz).toBeVec(v[3], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wzyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzyw', () => { + it('should return Vec4(w, z, y, w)', () => expect(v.wzyw).toBeVec(v[3], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wzyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzx', () => { + it('should return Vec4(w, z, z, x)', () => expect(v.wzzx).toBeVec(v[3], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wzzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzy', () => { + it('should return Vec4(w, z, z, y)', () => expect(v.wzzy).toBeVec(v[3], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wzzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzz', () => { + it('should return Vec4(w, z, z, z)', () => expect(v.wzzz).toBeVec(v[3], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wzzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzzw', () => { + it('should return Vec4(w, z, z, w)', () => expect(v.wzzw).toBeVec(v[3], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wzzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzwx', () => { + it('should return Vec4(w, z, w, x)', () => expect(v.wzwx).toBeVec(v[3], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wzwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzwy', () => { + it('should return Vec4(w, z, w, y)', () => expect(v.wzwy).toBeVec(v[3], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wzwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzwz', () => { + it('should return Vec4(w, z, w, z)', () => expect(v.wzwz).toBeVec(v[3], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wzwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wzww', () => { + it('should return Vec4(w, z, w, w)', () => expect(v.wzww).toBeVec(v[3], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wzww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxx', () => { + it('should return Vec4(w, w, x, x)', () => expect(v.wwxx).toBeVec(v[3], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.wwxx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxy', () => { + it('should return Vec4(w, w, x, y)', () => expect(v.wwxy).toBeVec(v[3], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.wwxy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxz', () => { + it('should return Vec4(w, w, x, z)', () => expect(v.wwxz).toBeVec(v[3], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.wwxz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwxw', () => { + it('should return Vec4(w, w, x, w)', () => expect(v.wwxw).toBeVec(v[3], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.wwxw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyx', () => { + it('should return Vec4(w, w, y, x)', () => expect(v.wwyx).toBeVec(v[3], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.wwyx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyy', () => { + it('should return Vec4(w, w, y, y)', () => expect(v.wwyy).toBeVec(v[3], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.wwyy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyz', () => { + it('should return Vec4(w, w, y, z)', () => expect(v.wwyz).toBeVec(v[3], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.wwyz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwyw', () => { + it('should return Vec4(w, w, y, w)', () => expect(v.wwyw).toBeVec(v[3], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.wwyw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzx', () => { + it('should return Vec4(w, w, z, x)', () => expect(v.wwzx).toBeVec(v[3], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.wwzx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzy', () => { + it('should return Vec4(w, w, z, y)', () => expect(v.wwzy).toBeVec(v[3], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.wwzy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzz', () => { + it('should return Vec4(w, w, z, z)', () => expect(v.wwzz).toBeVec(v[3], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.wwzz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwzw', () => { + it('should return Vec4(w, w, z, w)', () => expect(v.wwzw).toBeVec(v[3], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.wwzw; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwwx', () => { + it('should return Vec4(w, w, w, x)', () => expect(v.wwwx).toBeVec(v[3], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.wwwx; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwwy', () => { + it('should return Vec4(w, w, w, y)', () => expect(v.wwwy).toBeVec(v[3], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.wwwy; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwwz', () => { + it('should return Vec4(w, w, w, z)', () => expect(v.wwwz).toBeVec(v[3], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.wwwz; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().wwww', () => { + it('should return Vec4(w, w, w, w)', () => expect(v.wwww).toBeVec(v[3], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.wwww; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rr', () => { + it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rg', () => { + it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rb', () => { + it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ra', () => { + it('should return Vec2(r, a)', () => expect(v.ra).toBeVec(v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gr', () => { + it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gg', () => { + it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gb', () => { + it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ga', () => { + it('should return Vec2(g, a)', () => expect(v.ga).toBeVec(v[1], v[3])); + it('should be return a copy', () => { + let sw = v.ga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().br', () => { + it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); + it('should be return a copy', () => { + let sw = v.br; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bg', () => { + it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bb', () => { + it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ba', () => { + it('should return Vec2(b, a)', () => expect(v.ba).toBeVec(v[2], v[3])); + it('should be return a copy', () => { + let sw = v.ba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ar', () => { + it('should return Vec2(a, r)', () => expect(v.ar).toBeVec(v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ag', () => { + it('should return Vec2(a, g)', () => expect(v.ag).toBeVec(v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ab', () => { + it('should return Vec2(a, b)', () => expect(v.ab).toBeVec(v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aa', () => { + it('should return Vec2(a, a)', () => expect(v.aa).toBeVec(v[3], v[3])); + it('should be return a copy', () => { + let sw = v.aa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrr', () => { + it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrg', () => { + it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrb', () => { + it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rra', () => { + it('should return Vec3(r, r, a)', () => expect(v.rra).toBeVec(v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgr', () => { + it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgg', () => { + it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgb', () => { + it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rga', () => { + it('should return Vec3(r, g, a)', () => expect(v.rga).toBeVec(v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbr', () => { + it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbg', () => { + it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbb', () => { + it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rba', () => { + it('should return Vec3(r, b, a)', () => expect(v.rba).toBeVec(v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rar', () => { + it('should return Vec3(r, a, r)', () => expect(v.rar).toBeVec(v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rag', () => { + it('should return Vec3(r, a, g)', () => expect(v.rag).toBeVec(v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rab', () => { + it('should return Vec3(r, a, b)', () => expect(v.rab).toBeVec(v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raa', () => { + it('should return Vec3(r, a, a)', () => expect(v.raa).toBeVec(v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.raa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grr', () => { + it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grg', () => { + it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grb', () => { + it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gra', () => { + it('should return Vec3(g, r, a)', () => expect(v.gra).toBeVec(v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.gra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggr', () => { + it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggg', () => { + it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggb', () => { + it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gga', () => { + it('should return Vec3(g, g, a)', () => expect(v.gga).toBeVec(v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.gga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbr', () => { + it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbg', () => { + it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbb', () => { + it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gba', () => { + it('should return Vec3(g, b, a)', () => expect(v.gba).toBeVec(v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.gba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gar', () => { + it('should return Vec3(g, a, r)', () => expect(v.gar).toBeVec(v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.gar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gag', () => { + it('should return Vec3(g, a, g)', () => expect(v.gag).toBeVec(v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.gag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gab', () => { + it('should return Vec3(g, a, b)', () => expect(v.gab).toBeVec(v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.gab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaa', () => { + it('should return Vec3(g, a, a)', () => expect(v.gaa).toBeVec(v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.gaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brr', () => { + it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brg', () => { + it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brb', () => { + it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bra', () => { + it('should return Vec3(b, r, a)', () => expect(v.bra).toBeVec(v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgr', () => { + it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgg', () => { + it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgb', () => { + it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bga', () => { + it('should return Vec3(b, g, a)', () => expect(v.bga).toBeVec(v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.bga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbr', () => { + it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbg', () => { + it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbb', () => { + it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bba', () => { + it('should return Vec3(b, b, a)', () => expect(v.bba).toBeVec(v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.bba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bar', () => { + it('should return Vec3(b, a, r)', () => expect(v.bar).toBeVec(v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.bar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bag', () => { + it('should return Vec3(b, a, g)', () => expect(v.bag).toBeVec(v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.bag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bab', () => { + it('should return Vec3(b, a, b)', () => expect(v.bab).toBeVec(v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.bab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baa', () => { + it('should return Vec3(b, a, a)', () => expect(v.baa).toBeVec(v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.baa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arr', () => { + it('should return Vec3(a, r, r)', () => expect(v.arr).toBeVec(v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.arr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arg', () => { + it('should return Vec3(a, r, g)', () => expect(v.arg).toBeVec(v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.arg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arb', () => { + it('should return Vec3(a, r, b)', () => expect(v.arb).toBeVec(v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.arb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ara', () => { + it('should return Vec3(a, r, a)', () => expect(v.ara).toBeVec(v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agr', () => { + it('should return Vec3(a, g, r)', () => expect(v.agr).toBeVec(v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.agr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agg', () => { + it('should return Vec3(a, g, g)', () => expect(v.agg).toBeVec(v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.agg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agb', () => { + it('should return Vec3(a, g, b)', () => expect(v.agb).toBeVec(v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.agb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aga', () => { + it('should return Vec3(a, g, a)', () => expect(v.aga).toBeVec(v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.aga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abr', () => { + it('should return Vec3(a, b, r)', () => expect(v.abr).toBeVec(v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.abr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abg', () => { + it('should return Vec3(a, b, g)', () => expect(v.abg).toBeVec(v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.abg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abb', () => { + it('should return Vec3(a, b, b)', () => expect(v.abb).toBeVec(v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.abb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aba', () => { + it('should return Vec3(a, b, a)', () => expect(v.aba).toBeVec(v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.aba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aar', () => { + it('should return Vec3(a, a, r)', () => expect(v.aar).toBeVec(v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.aar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aag', () => { + it('should return Vec3(a, a, g)', () => expect(v.aag).toBeVec(v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.aag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aab', () => { + it('should return Vec3(a, a, b)', () => expect(v.aab).toBeVec(v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.aab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaa', () => { + it('should return Vec3(a, a, a)', () => expect(v.aaa).toBeVec(v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.aaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrrr', () => { + it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rrrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrrg', () => { + it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rrrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrrb', () => { + it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rrrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrra', () => { + it('should return Vec4(r, r, r, a)', () => expect(v.rrra).toBeVec(v[0], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rrra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrgr', () => { + it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rrgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrgg', () => { + it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rrgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrgb', () => { + it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rrgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrga', () => { + it('should return Vec4(r, r, g, a)', () => expect(v.rrga).toBeVec(v[0], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rrga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrbr', () => { + it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rrbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrbg', () => { + it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rrbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrbb', () => { + it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rrbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrba', () => { + it('should return Vec4(r, r, b, a)', () => expect(v.rrba).toBeVec(v[0], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rrba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrar', () => { + it('should return Vec4(r, r, a, r)', () => expect(v.rrar).toBeVec(v[0], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rrar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrag', () => { + it('should return Vec4(r, r, a, g)', () => expect(v.rrag).toBeVec(v[0], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rrag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rrab', () => { + it('should return Vec4(r, r, a, b)', () => expect(v.rrab).toBeVec(v[0], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rrab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rraa', () => { + it('should return Vec4(r, r, a, a)', () => expect(v.rraa).toBeVec(v[0], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.rraa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgrr', () => { + it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgrg', () => { + it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgrb', () => { + it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgra', () => { + it('should return Vec4(r, g, r, a)', () => expect(v.rgra).toBeVec(v[0], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rgra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rggr', () => { + it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rggg', () => { + it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rggb', () => { + it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgga', () => { + it('should return Vec4(r, g, g, a)', () => expect(v.rgga).toBeVec(v[0], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rgga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgbr', () => { + it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgbg', () => { + it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgbb', () => { + it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgba', () => { + it('should return Vec4(r, g, b, a)', () => expect(v.rgba).toBeVec(v[0], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rgba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgar', () => { + it('should return Vec4(r, g, a, r)', () => expect(v.rgar).toBeVec(v[0], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rgar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgag', () => { + it('should return Vec4(r, g, a, g)', () => expect(v.rgag).toBeVec(v[0], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rgag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgab', () => { + it('should return Vec4(r, g, a, b)', () => expect(v.rgab).toBeVec(v[0], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rgab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rgaa', () => { + it('should return Vec4(r, g, a, a)', () => expect(v.rgaa).toBeVec(v[0], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.rgaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbrr', () => { + it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbrg', () => { + it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbrb', () => { + it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbra', () => { + it('should return Vec4(r, b, r, a)', () => expect(v.rbra).toBeVec(v[0], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rbra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbgr', () => { + it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.rbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbgg', () => { + it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.rbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbgb', () => { + it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.rbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbga', () => { + it('should return Vec4(r, b, g, a)', () => expect(v.rbga).toBeVec(v[0], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.rbga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbbr', () => { + it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbbg', () => { + it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbbb', () => { + it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbba', () => { + it('should return Vec4(r, b, b, a)', () => expect(v.rbba).toBeVec(v[0], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.rbba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbar', () => { + it('should return Vec4(r, b, a, r)', () => expect(v.rbar).toBeVec(v[0], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.rbar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbag', () => { + it('should return Vec4(r, b, a, g)', () => expect(v.rbag).toBeVec(v[0], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.rbag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbab', () => { + it('should return Vec4(r, b, a, b)', () => expect(v.rbab).toBeVec(v[0], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.rbab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rbaa', () => { + it('should return Vec4(r, b, a, a)', () => expect(v.rbaa).toBeVec(v[0], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.rbaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rarr', () => { + it('should return Vec4(r, a, r, r)', () => expect(v.rarr).toBeVec(v[0], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.rarr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rarg', () => { + it('should return Vec4(r, a, r, g)', () => expect(v.rarg).toBeVec(v[0], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.rarg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rarb', () => { + it('should return Vec4(r, a, r, b)', () => expect(v.rarb).toBeVec(v[0], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.rarb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rara', () => { + it('should return Vec4(r, a, r, a)', () => expect(v.rara).toBeVec(v[0], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.rara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ragr', () => { + it('should return Vec4(r, a, g, r)', () => expect(v.ragr).toBeVec(v[0], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.ragr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ragg', () => { + it('should return Vec4(r, a, g, g)', () => expect(v.ragg).toBeVec(v[0], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.ragg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ragb', () => { + it('should return Vec4(r, a, g, b)', () => expect(v.ragb).toBeVec(v[0], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.ragb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raga', () => { + it('should return Vec4(r, a, g, a)', () => expect(v.raga).toBeVec(v[0], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.raga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rabr', () => { + it('should return Vec4(r, a, b, r)', () => expect(v.rabr).toBeVec(v[0], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.rabr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rabg', () => { + it('should return Vec4(r, a, b, g)', () => expect(v.rabg).toBeVec(v[0], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.rabg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().rabb', () => { + it('should return Vec4(r, a, b, b)', () => expect(v.rabb).toBeVec(v[0], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.rabb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raba', () => { + it('should return Vec4(r, a, b, a)', () => expect(v.raba).toBeVec(v[0], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.raba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raar', () => { + it('should return Vec4(r, a, a, r)', () => expect(v.raar).toBeVec(v[0], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.raar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raag', () => { + it('should return Vec4(r, a, a, g)', () => expect(v.raag).toBeVec(v[0], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.raag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raab', () => { + it('should return Vec4(r, a, a, b)', () => expect(v.raab).toBeVec(v[0], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.raab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().raaa', () => { + it('should return Vec4(r, a, a, a)', () => expect(v.raaa).toBeVec(v[0], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.raaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grrr', () => { + it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.grrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grrg', () => { + it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.grrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grrb', () => { + it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.grrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grra', () => { + it('should return Vec4(g, r, r, a)', () => expect(v.grra).toBeVec(v[1], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.grra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grgr', () => { + it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.grgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grgg', () => { + it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.grgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grgb', () => { + it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.grgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grga', () => { + it('should return Vec4(g, r, g, a)', () => expect(v.grga).toBeVec(v[1], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.grga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grbr', () => { + it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.grbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grbg', () => { + it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.grbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grbb', () => { + it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.grbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grba', () => { + it('should return Vec4(g, r, b, a)', () => expect(v.grba).toBeVec(v[1], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.grba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grar', () => { + it('should return Vec4(g, r, a, r)', () => expect(v.grar).toBeVec(v[1], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.grar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grag', () => { + it('should return Vec4(g, r, a, g)', () => expect(v.grag).toBeVec(v[1], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.grag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().grab', () => { + it('should return Vec4(g, r, a, b)', () => expect(v.grab).toBeVec(v[1], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.grab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().graa', () => { + it('should return Vec4(g, r, a, a)', () => expect(v.graa).toBeVec(v[1], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.graa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggrr', () => { + it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.ggrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggrg', () => { + it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.ggrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggrb', () => { + it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.ggrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggra', () => { + it('should return Vec4(g, g, r, a)', () => expect(v.ggra).toBeVec(v[1], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.ggra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gggr', () => { + it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gggg', () => { + it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gggb', () => { + it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggga', () => { + it('should return Vec4(g, g, g, a)', () => expect(v.ggga).toBeVec(v[1], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.ggga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggbr', () => { + it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.ggbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggbg', () => { + it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.ggbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggbb', () => { + it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.ggbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggba', () => { + it('should return Vec4(g, g, b, a)', () => expect(v.ggba).toBeVec(v[1], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.ggba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggar', () => { + it('should return Vec4(g, g, a, r)', () => expect(v.ggar).toBeVec(v[1], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.ggar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggag', () => { + it('should return Vec4(g, g, a, g)', () => expect(v.ggag).toBeVec(v[1], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.ggag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggab', () => { + it('should return Vec4(g, g, a, b)', () => expect(v.ggab).toBeVec(v[1], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.ggab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().ggaa', () => { + it('should return Vec4(g, g, a, a)', () => expect(v.ggaa).toBeVec(v[1], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.ggaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbrr', () => { + it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.gbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbrg', () => { + it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.gbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbrb', () => { + it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.gbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbra', () => { + it('should return Vec4(g, b, r, a)', () => expect(v.gbra).toBeVec(v[1], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.gbra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbgr', () => { + it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbgg', () => { + it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbgb', () => { + it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbga', () => { + it('should return Vec4(g, b, g, a)', () => expect(v.gbga).toBeVec(v[1], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.gbga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbbr', () => { + it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbbg', () => { + it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbbb', () => { + it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbba', () => { + it('should return Vec4(g, b, b, a)', () => expect(v.gbba).toBeVec(v[1], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.gbba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbar', () => { + it('should return Vec4(g, b, a, r)', () => expect(v.gbar).toBeVec(v[1], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.gbar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbag', () => { + it('should return Vec4(g, b, a, g)', () => expect(v.gbag).toBeVec(v[1], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.gbag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbab', () => { + it('should return Vec4(g, b, a, b)', () => expect(v.gbab).toBeVec(v[1], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.gbab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gbaa', () => { + it('should return Vec4(g, b, a, a)', () => expect(v.gbaa).toBeVec(v[1], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.gbaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().garr', () => { + it('should return Vec4(g, a, r, r)', () => expect(v.garr).toBeVec(v[1], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.garr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().garg', () => { + it('should return Vec4(g, a, r, g)', () => expect(v.garg).toBeVec(v[1], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.garg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().garb', () => { + it('should return Vec4(g, a, r, b)', () => expect(v.garb).toBeVec(v[1], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.garb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gara', () => { + it('should return Vec4(g, a, r, a)', () => expect(v.gara).toBeVec(v[1], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.gara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gagr', () => { + it('should return Vec4(g, a, g, r)', () => expect(v.gagr).toBeVec(v[1], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.gagr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gagg', () => { + it('should return Vec4(g, a, g, g)', () => expect(v.gagg).toBeVec(v[1], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.gagg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gagb', () => { + it('should return Vec4(g, a, g, b)', () => expect(v.gagb).toBeVec(v[1], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.gagb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaga', () => { + it('should return Vec4(g, a, g, a)', () => expect(v.gaga).toBeVec(v[1], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.gaga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gabr', () => { + it('should return Vec4(g, a, b, r)', () => expect(v.gabr).toBeVec(v[1], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.gabr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gabg', () => { + it('should return Vec4(g, a, b, g)', () => expect(v.gabg).toBeVec(v[1], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.gabg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gabb', () => { + it('should return Vec4(g, a, b, b)', () => expect(v.gabb).toBeVec(v[1], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.gabb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaba', () => { + it('should return Vec4(g, a, b, a)', () => expect(v.gaba).toBeVec(v[1], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.gaba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaar', () => { + it('should return Vec4(g, a, a, r)', () => expect(v.gaar).toBeVec(v[1], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.gaar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaag', () => { + it('should return Vec4(g, a, a, g)', () => expect(v.gaag).toBeVec(v[1], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.gaag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaab', () => { + it('should return Vec4(g, a, a, b)', () => expect(v.gaab).toBeVec(v[1], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.gaab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().gaaa', () => { + it('should return Vec4(g, a, a, a)', () => expect(v.gaaa).toBeVec(v[1], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.gaaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brrr', () => { + it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.brrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brrg', () => { + it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.brrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brrb', () => { + it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.brrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brra', () => { + it('should return Vec4(b, r, r, a)', () => expect(v.brra).toBeVec(v[2], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.brra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brgr', () => { + it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.brgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brgg', () => { + it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.brgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brgb', () => { + it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.brgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brga', () => { + it('should return Vec4(b, r, g, a)', () => expect(v.brga).toBeVec(v[2], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.brga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brbr', () => { + it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.brbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brbg', () => { + it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.brbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brbb', () => { + it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.brbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brba', () => { + it('should return Vec4(b, r, b, a)', () => expect(v.brba).toBeVec(v[2], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.brba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brar', () => { + it('should return Vec4(b, r, a, r)', () => expect(v.brar).toBeVec(v[2], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.brar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brag', () => { + it('should return Vec4(b, r, a, g)', () => expect(v.brag).toBeVec(v[2], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.brag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().brab', () => { + it('should return Vec4(b, r, a, b)', () => expect(v.brab).toBeVec(v[2], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.brab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().braa', () => { + it('should return Vec4(b, r, a, a)', () => expect(v.braa).toBeVec(v[2], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.braa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgrr', () => { + it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bgrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgrg', () => { + it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bgrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgrb', () => { + it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bgrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgra', () => { + it('should return Vec4(b, g, r, a)', () => expect(v.bgra).toBeVec(v[2], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bgra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bggr', () => { + it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bggg', () => { + it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bggb', () => { + it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgga', () => { + it('should return Vec4(b, g, g, a)', () => expect(v.bgga).toBeVec(v[2], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.bgga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgbr', () => { + it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bgbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgbg', () => { + it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bgbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgbb', () => { + it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bgbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgba', () => { + it('should return Vec4(b, g, b, a)', () => expect(v.bgba).toBeVec(v[2], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.bgba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgar', () => { + it('should return Vec4(b, g, a, r)', () => expect(v.bgar).toBeVec(v[2], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.bgar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgag', () => { + it('should return Vec4(b, g, a, g)', () => expect(v.bgag).toBeVec(v[2], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.bgag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgab', () => { + it('should return Vec4(b, g, a, b)', () => expect(v.bgab).toBeVec(v[2], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.bgab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bgaa', () => { + it('should return Vec4(b, g, a, a)', () => expect(v.bgaa).toBeVec(v[2], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.bgaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbrr', () => { + it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.bbrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbrg', () => { + it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.bbrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbrb', () => { + it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.bbrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbra', () => { + it('should return Vec4(b, b, r, a)', () => expect(v.bbra).toBeVec(v[2], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bbra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbgr', () => { + it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bbgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbgg', () => { + it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bbgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbgb', () => { + it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bbgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbga', () => { + it('should return Vec4(b, b, g, a)', () => expect(v.bbga).toBeVec(v[2], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.bbga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbbr', () => { + it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.bbbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbbg', () => { + it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.bbbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbbb', () => { + it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.bbbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbba', () => { + it('should return Vec4(b, b, b, a)', () => expect(v.bbba).toBeVec(v[2], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.bbba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbar', () => { + it('should return Vec4(b, b, a, r)', () => expect(v.bbar).toBeVec(v[2], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.bbar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbag', () => { + it('should return Vec4(b, b, a, g)', () => expect(v.bbag).toBeVec(v[2], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.bbag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbab', () => { + it('should return Vec4(b, b, a, b)', () => expect(v.bbab).toBeVec(v[2], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.bbab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bbaa', () => { + it('should return Vec4(b, b, a, a)', () => expect(v.bbaa).toBeVec(v[2], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.bbaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().barr', () => { + it('should return Vec4(b, a, r, r)', () => expect(v.barr).toBeVec(v[2], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.barr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().barg', () => { + it('should return Vec4(b, a, r, g)', () => expect(v.barg).toBeVec(v[2], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.barg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().barb', () => { + it('should return Vec4(b, a, r, b)', () => expect(v.barb).toBeVec(v[2], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.barb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bara', () => { + it('should return Vec4(b, a, r, a)', () => expect(v.bara).toBeVec(v[2], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.bara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bagr', () => { + it('should return Vec4(b, a, g, r)', () => expect(v.bagr).toBeVec(v[2], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.bagr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bagg', () => { + it('should return Vec4(b, a, g, g)', () => expect(v.bagg).toBeVec(v[2], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.bagg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().bagb', () => { + it('should return Vec4(b, a, g, b)', () => expect(v.bagb).toBeVec(v[2], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.bagb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baga', () => { + it('should return Vec4(b, a, g, a)', () => expect(v.baga).toBeVec(v[2], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.baga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().babr', () => { + it('should return Vec4(b, a, b, r)', () => expect(v.babr).toBeVec(v[2], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.babr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().babg', () => { + it('should return Vec4(b, a, b, g)', () => expect(v.babg).toBeVec(v[2], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.babg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().babb', () => { + it('should return Vec4(b, a, b, b)', () => expect(v.babb).toBeVec(v[2], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.babb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baba', () => { + it('should return Vec4(b, a, b, a)', () => expect(v.baba).toBeVec(v[2], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.baba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baar', () => { + it('should return Vec4(b, a, a, r)', () => expect(v.baar).toBeVec(v[2], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.baar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baag', () => { + it('should return Vec4(b, a, a, g)', () => expect(v.baag).toBeVec(v[2], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.baag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baab', () => { + it('should return Vec4(b, a, a, b)', () => expect(v.baab).toBeVec(v[2], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.baab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().baaa', () => { + it('should return Vec4(b, a, a, a)', () => expect(v.baaa).toBeVec(v[2], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.baaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arrr', () => { + it('should return Vec4(a, r, r, r)', () => expect(v.arrr).toBeVec(v[3], v[0], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.arrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arrg', () => { + it('should return Vec4(a, r, r, g)', () => expect(v.arrg).toBeVec(v[3], v[0], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.arrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arrb', () => { + it('should return Vec4(a, r, r, b)', () => expect(v.arrb).toBeVec(v[3], v[0], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.arrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arra', () => { + it('should return Vec4(a, r, r, a)', () => expect(v.arra).toBeVec(v[3], v[0], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.arra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().argr', () => { + it('should return Vec4(a, r, g, r)', () => expect(v.argr).toBeVec(v[3], v[0], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.argr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().argg', () => { + it('should return Vec4(a, r, g, g)', () => expect(v.argg).toBeVec(v[3], v[0], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.argg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().argb', () => { + it('should return Vec4(a, r, g, b)', () => expect(v.argb).toBeVec(v[3], v[0], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.argb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arga', () => { + it('should return Vec4(a, r, g, a)', () => expect(v.arga).toBeVec(v[3], v[0], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.arga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arbr', () => { + it('should return Vec4(a, r, b, r)', () => expect(v.arbr).toBeVec(v[3], v[0], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.arbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arbg', () => { + it('should return Vec4(a, r, b, g)', () => expect(v.arbg).toBeVec(v[3], v[0], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.arbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arbb', () => { + it('should return Vec4(a, r, b, b)', () => expect(v.arbb).toBeVec(v[3], v[0], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.arbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arba', () => { + it('should return Vec4(a, r, b, a)', () => expect(v.arba).toBeVec(v[3], v[0], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.arba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arar', () => { + it('should return Vec4(a, r, a, r)', () => expect(v.arar).toBeVec(v[3], v[0], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.arar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arag', () => { + it('should return Vec4(a, r, a, g)', () => expect(v.arag).toBeVec(v[3], v[0], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.arag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().arab', () => { + it('should return Vec4(a, r, a, b)', () => expect(v.arab).toBeVec(v[3], v[0], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.arab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().araa', () => { + it('should return Vec4(a, r, a, a)', () => expect(v.araa).toBeVec(v[3], v[0], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.araa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agrr', () => { + it('should return Vec4(a, g, r, r)', () => expect(v.agrr).toBeVec(v[3], v[1], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.agrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agrg', () => { + it('should return Vec4(a, g, r, g)', () => expect(v.agrg).toBeVec(v[3], v[1], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.agrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agrb', () => { + it('should return Vec4(a, g, r, b)', () => expect(v.agrb).toBeVec(v[3], v[1], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.agrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agra', () => { + it('should return Vec4(a, g, r, a)', () => expect(v.agra).toBeVec(v[3], v[1], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.agra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aggr', () => { + it('should return Vec4(a, g, g, r)', () => expect(v.aggr).toBeVec(v[3], v[1], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.aggr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aggg', () => { + it('should return Vec4(a, g, g, g)', () => expect(v.aggg).toBeVec(v[3], v[1], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.aggg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aggb', () => { + it('should return Vec4(a, g, g, b)', () => expect(v.aggb).toBeVec(v[3], v[1], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.aggb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agga', () => { + it('should return Vec4(a, g, g, a)', () => expect(v.agga).toBeVec(v[3], v[1], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.agga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agbr', () => { + it('should return Vec4(a, g, b, r)', () => expect(v.agbr).toBeVec(v[3], v[1], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.agbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agbg', () => { + it('should return Vec4(a, g, b, g)', () => expect(v.agbg).toBeVec(v[3], v[1], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.agbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agbb', () => { + it('should return Vec4(a, g, b, b)', () => expect(v.agbb).toBeVec(v[3], v[1], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.agbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agba', () => { + it('should return Vec4(a, g, b, a)', () => expect(v.agba).toBeVec(v[3], v[1], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.agba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agar', () => { + it('should return Vec4(a, g, a, r)', () => expect(v.agar).toBeVec(v[3], v[1], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.agar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agag', () => { + it('should return Vec4(a, g, a, g)', () => expect(v.agag).toBeVec(v[3], v[1], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.agag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agab', () => { + it('should return Vec4(a, g, a, b)', () => expect(v.agab).toBeVec(v[3], v[1], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.agab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().agaa', () => { + it('should return Vec4(a, g, a, a)', () => expect(v.agaa).toBeVec(v[3], v[1], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.agaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abrr', () => { + it('should return Vec4(a, b, r, r)', () => expect(v.abrr).toBeVec(v[3], v[2], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.abrr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abrg', () => { + it('should return Vec4(a, b, r, g)', () => expect(v.abrg).toBeVec(v[3], v[2], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.abrg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abrb', () => { + it('should return Vec4(a, b, r, b)', () => expect(v.abrb).toBeVec(v[3], v[2], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.abrb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abra', () => { + it('should return Vec4(a, b, r, a)', () => expect(v.abra).toBeVec(v[3], v[2], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.abra; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abgr', () => { + it('should return Vec4(a, b, g, r)', () => expect(v.abgr).toBeVec(v[3], v[2], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.abgr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abgg', () => { + it('should return Vec4(a, b, g, g)', () => expect(v.abgg).toBeVec(v[3], v[2], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.abgg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abgb', () => { + it('should return Vec4(a, b, g, b)', () => expect(v.abgb).toBeVec(v[3], v[2], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.abgb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abga', () => { + it('should return Vec4(a, b, g, a)', () => expect(v.abga).toBeVec(v[3], v[2], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.abga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abbr', () => { + it('should return Vec4(a, b, b, r)', () => expect(v.abbr).toBeVec(v[3], v[2], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.abbr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abbg', () => { + it('should return Vec4(a, b, b, g)', () => expect(v.abbg).toBeVec(v[3], v[2], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.abbg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abbb', () => { + it('should return Vec4(a, b, b, b)', () => expect(v.abbb).toBeVec(v[3], v[2], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.abbb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abba', () => { + it('should return Vec4(a, b, b, a)', () => expect(v.abba).toBeVec(v[3], v[2], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.abba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abar', () => { + it('should return Vec4(a, b, a, r)', () => expect(v.abar).toBeVec(v[3], v[2], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.abar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abag', () => { + it('should return Vec4(a, b, a, g)', () => expect(v.abag).toBeVec(v[3], v[2], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.abag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abab', () => { + it('should return Vec4(a, b, a, b)', () => expect(v.abab).toBeVec(v[3], v[2], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.abab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().abaa', () => { + it('should return Vec4(a, b, a, a)', () => expect(v.abaa).toBeVec(v[3], v[2], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.abaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aarr', () => { + it('should return Vec4(a, a, r, r)', () => expect(v.aarr).toBeVec(v[3], v[3], v[0], v[0])); + it('should be return a copy', () => { + let sw = v.aarr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aarg', () => { + it('should return Vec4(a, a, r, g)', () => expect(v.aarg).toBeVec(v[3], v[3], v[0], v[1])); + it('should be return a copy', () => { + let sw = v.aarg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aarb', () => { + it('should return Vec4(a, a, r, b)', () => expect(v.aarb).toBeVec(v[3], v[3], v[0], v[2])); + it('should be return a copy', () => { + let sw = v.aarb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aara', () => { + it('should return Vec4(a, a, r, a)', () => expect(v.aara).toBeVec(v[3], v[3], v[0], v[3])); + it('should be return a copy', () => { + let sw = v.aara; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aagr', () => { + it('should return Vec4(a, a, g, r)', () => expect(v.aagr).toBeVec(v[3], v[3], v[1], v[0])); + it('should be return a copy', () => { + let sw = v.aagr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aagg', () => { + it('should return Vec4(a, a, g, g)', () => expect(v.aagg).toBeVec(v[3], v[3], v[1], v[1])); + it('should be return a copy', () => { + let sw = v.aagg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aagb', () => { + it('should return Vec4(a, a, g, b)', () => expect(v.aagb).toBeVec(v[3], v[3], v[1], v[2])); + it('should be return a copy', () => { + let sw = v.aagb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaga', () => { + it('should return Vec4(a, a, g, a)', () => expect(v.aaga).toBeVec(v[3], v[3], v[1], v[3])); + it('should be return a copy', () => { + let sw = v.aaga; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aabr', () => { + it('should return Vec4(a, a, b, r)', () => expect(v.aabr).toBeVec(v[3], v[3], v[2], v[0])); + it('should be return a copy', () => { + let sw = v.aabr; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aabg', () => { + it('should return Vec4(a, a, b, g)', () => expect(v.aabg).toBeVec(v[3], v[3], v[2], v[1])); + it('should be return a copy', () => { + let sw = v.aabg; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aabb', () => { + it('should return Vec4(a, a, b, b)', () => expect(v.aabb).toBeVec(v[3], v[3], v[2], v[2])); + it('should be return a copy', () => { + let sw = v.aabb; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaba', () => { + it('should return Vec4(a, a, b, a)', () => expect(v.aaba).toBeVec(v[3], v[3], v[2], v[3])); + it('should be return a copy', () => { + let sw = v.aaba; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaar', () => { + it('should return Vec4(a, a, a, r)', () => expect(v.aaar).toBeVec(v[3], v[3], v[3], v[0])); + it('should be return a copy', () => { + let sw = v.aaar; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaag', () => { + it('should return Vec4(a, a, a, g)', () => expect(v.aaag).toBeVec(v[3], v[3], v[3], v[1])); + it('should be return a copy', () => { + let sw = v.aaag; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaab', () => { + it('should return Vec4(a, a, a, b)', () => expect(v.aaab).toBeVec(v[3], v[3], v[3], v[2])); + it('should be return a copy', () => { + let sw = v.aaab; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + describe('Vec4().aaaa', () => { + it('should return Vec4(a, a, a, a)', () => expect(v.aaaa).toBeVec(v[3], v[3], v[3], v[3])); + it('should be return a copy', () => { + let sw = v.aaaa; + sw[0] += 1; + expect(v[0]).not.toEqual(sw[0]); + }); + }); + + // [/Swizzle Autogen] +}); diff --git a/tests/f64/Vec4.spec.ts b/tests/f64/Vec4.spec.ts new file mode 100644 index 00000000..3a94619b --- /dev/null +++ b/tests/f64/Vec4.spec.ts @@ -0,0 +1,700 @@ +import { expect, describe, it, beforeEach } from 'vitest'; + +import { Vec4 } from '#gl-matrix/f64'; + +import type { Vec4Like } from '#gl-matrix/types'; + +describe('Vec4', () => { + describe('constructor', () => { + it('should return Vec4(0, 0, 0, 0) if called with no arguments', () => expect(new Vec4()).toBeVec(0, 0, 0, 0)); + + it('should return Vec4(x, y, z, w) if called with (x, y, z, w)', () => { + expect(new Vec4(1, 2, 3, 4)).toBeVec(1, 2, 3, 4); + expect(new Vec4(-3, 4.4, -5.6, 7.8)).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Vec4(x, x, x) if called with (x)', () => { + expect(new Vec4(1)).toBeVec(1, 1, 1, 1); + expect(new Vec4(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3); + }); + + it('should return Vec4(x, y, z, w) if called with ([x, y, z, w])', () => { + expect(new Vec4([1, 2, 3, 4])).toBeVec(1, 2, 3, 4); + expect(new Vec4([-3, 4.4, -5.6, 7.8])).toBeVec(-3, 4.4, -5.6, 7.8); + }); + + it('should return Vec4(x, y, z, w) if called with (Vec4(x, y, z, w))', () => { + let v = new Vec4(3.4, 5.6, 7.8, 9); + expect(new Vec4(v)).toBeVec(v); + }); + + it('should return Vec4(x, y, z, w) if called with (Float64Array([x, y, z, w]))', () => { + let arr = new Float64Array([1.2, 3.4, 5.6, 7.8]); + expect(new Vec4(arr)).toBeVec(arr); + }); + }); + + describe('static', () => { + let out: Vec4Like; + let vecA: Vec4Like; + let vecB: Vec4Like; + let result: any; + + beforeEach(() => { + vecA = new Vec4(1, 2, 3, 4); + vecB = new Vec4(5, 6, 7, 8); + out = new Vec4(0, 0, 0, 0); + }); + + describe('create', () => { + beforeEach(() => { result = Vec4.create(); }); + + it('should return a 4 element array initialized to 0s', () => expect(result).toBeVec(0, 0, 0, 0)); + }); + + describe('clone', () => { + beforeEach(() => { result = Vec4.clone(vecA); }); + + it('should return a 4 element array initialized to the values in vecA', () => expect(result).toBeVec(vecA)); + }); + + describe('fromValues', () => { + beforeEach(() => { result = Vec4.fromValues(1, 2, 3, 4); }); + + it('should return a 4 element array initialized to the values passed', () => expect(result).toBeVec(1, 2, 3, 4)); + }); + + describe('copy', () => { + beforeEach(() => { result = Vec4.copy(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('set', () => { + beforeEach(() => { result = Vec4.set(out, 1, 2, 3, 4); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('add', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.add(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.add(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(6, 8, 10, 12)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.add(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(6, 8, 10, 12)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('subtract', () => { + it('should have an alias called `sub`', () => expect(Vec4.sub).toEqual(Vec4.subtract)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.subtract(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(-4, -4, -4, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.subtract(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-4, -4, -4, -4)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.subtract(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(-4, -4, -4, -4)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('multiply', () => { + it('should have an alias called `mul`', () => expect(Vec4.mul).toEqual(Vec4.multiply)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.multiply(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(5, 12, 21, 32)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.multiply(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(5, 12, 21, 32)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.multiply(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(5, 12, 21, 32)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('divide', () => { + it('should have an alias called `div`', () => expect(Vec4.div).toEqual(Vec4.divide)); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.divide(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(0.2, 0.333333, 0.428571, 0.5)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.divide(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0.2, 0.333333, 0.428571, 0.5)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.divide(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0.2, 0.333333, 0.428571, 0.5)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('ceil', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.ceil(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 2, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.ceil(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4, 2, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('floor', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.floor(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(2, 3, 1, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.floor(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 3, 1, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('min', () => { + beforeEach(() => { + vecA = [1, 3, 1, 3]; + vecB = [3, 1, 3, 1]; + }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.min(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1, 1, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.min(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1, 1, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.min(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(1, 1, 1, 1)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + }); + }); + + describe('max', () => { + beforeEach(() => { + vecA = [1, 3, 1, 3]; + vecB = [3, 1, 3, 1]; + }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.max(out, vecA, vecB); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 3, 3)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.max(vecA, vecA, vecB); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 3, 3)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(3, 1, 3, 1)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.max(vecB, vecA, vecB); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 3, 3, 3)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 3, 1, 3)); + }); + }); + + describe('round', () => { + beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.round(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(3, 3, 1, 1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.round(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 3, 1, 1)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scale', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.scale(out, vecA, 2); }); + + it('should place values into out', () => expect(out).toBeVec(2, 4, 6, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.scale(vecA, vecA, 2); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(2, 4, 6, 8)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('scaleAndAdd', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3.5, 5, 6.5, 8)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3.5, 5, 6.5, 8)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3.5, 5, 6.5, 8)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + describe('distance', () => { + beforeEach(() => { result = Vec4.distance(vecA, vecB); }); + + it('should have an alias called `dist`', () => expect(Vec4.dist).toEqual(Vec4.distance)); + it('should return the distance', () => expect(result).toBeCloseTo(8)); + }); + + describe('squaredDistance', () => { + beforeEach(() => { result = Vec4.squaredDistance(vecA, vecB); }); + + it('should have an alias called `sqrDist`', () => expect(Vec4.sqrDist).toEqual(Vec4.squaredDistance)); + it('should return the squared distance', () => expect(result).toEqual(64)); + }); + + describe('length', () => { + beforeEach(() => { result = Vec4.len(vecA); }); + + it('should have an alias called `len`', () => expect(Vec4.len).toEqual(Vec4.length)); + it('should return the length', () => expect(result).toBeCloseTo(5.477225)); + }); + + describe('squaredLength', () => { + beforeEach(() => { result = Vec4.squaredLength(vecA); }); + + it('should have an alias called `sqrLen`', () => expect(Vec4.sqrLen).toEqual(Vec4.squaredLength)); + it('should return the squared length', () => expect(result).toEqual(30)); + }); + + describe('negate', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.negate(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(-1, -2, -3, -4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.negate(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(-1, -2, -3, -4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('inverse', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.inverse(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3, 1/4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.inverse(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3, 1/4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('abs', () => { + beforeEach(() => { vecA = [-1, -2, -3, -4]; }); + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.abs(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 2, 3, 4)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(-1, -2, -3, -4)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.abs(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('normalize', () => { + beforeEach(() => { vecA = [5, 0, 0, 0]; }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.normalize(out, vecA); }); + + it('should place values into out', () => expect(out).toBeVec(1, 0, 0, 0)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(5, 0, 0, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.normalize(vecA, vecA); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should return vecA', () => expect(result).toBe(vecA)); + }); + }); + + describe('dot', () => { + beforeEach(() => { result = Vec4.dot(vecA, vecB); }); + + it('should return the dot product', () => expect(result).toEqual(70)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('lerp', () => { + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.lerp(out, vecA, vecB, 0.5); }); + + it('should place values into out', () => expect(out).toBeVec(3, 4, 5, 6)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.lerp(vecA, vecA, vecB, 0.5); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(3, 4, 5, 6)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(5, 6, 7, 8)); + }); + + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.lerp(vecB, vecA, vecB, 0.5); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(3, 4, 5, 6)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + }); + + /*describe('random', () => { + describe('with no scale', () => { + beforeEach(() => { result = Vec4.random(out); }); + + it('should result in a unit length vector', () => expect(Vec4.len(out)).toBeCloseTo(1.0)); + it('should return out', () => expect(result).toBe(out)); + }); + + describe('with a scale', () => { + beforeEach(() => { result = Vec4.random(out, 5.0); }); + + it('should result in a unit length vector', () => expect(Vec4.len(out)).toBeCloseTo(5.0)); + it('should return out', () => expect(result).toBe(out)); + }); + });*/ + + describe('cross', () => { + let vecC: Vec4Like; + + beforeEach(() => { + vecA = new Vec4(1, 0, 0, 0); + vecB = new Vec4(0, 1, 0, 0); + vecC = [0, 0, 1, 0]; + }); + + describe('with a separate output vector', () => { + beforeEach(() => { result = Vec4.cross(out, vecA,vecB,vecC); }); + + it('should place values into out', () => expect(out).toBeVec(0, 0, 0, -1)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); + it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); + }); + + describe('when vecA is the output vector', () => { + beforeEach(() => { result = Vec4.cross(vecA, vecA,vecB,vecC); }); + + it('should place values into vecA', () => expect(vecA).toBeVec(0, 0, 0,-1)); + it('should return vecA', () => expect(result).toBe(vecA)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); + it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); + }); + describe('when vecB is the output vector', () => { + beforeEach(() => { result = Vec4.cross(vecB, vecA,vecB,vecC); }); + + it('should place values into vecB', () => expect(vecB).toBeVec(0, 0, 0,-1)); + it('should return vecB', () => expect(result).toBe(vecB)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); + }); + describe('when vecC is the output vector', () => { + beforeEach(() => { result = Vec4.cross(vecC, vecA,vecB,vecC); }); + + it('should place values into vecC', () => expect(vecC).toBeVec(0, 0, 0,-1)); + it('should return vecC', () => expect(result).toBe(vecC)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); + }); + }); + + /*describe('forEach', () => { + let vecArray; + + beforeEach(() => { + vecArray = [ + 1, 2, 3, 4, + 5, 6, 7, 8, + 0, 0, 0, 0 + ]; + }); + + describe('when performing operations that take no extra arguments', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 0, Vec4.normalize); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 0.182574, 0.365148, 0.547722, 0.730296, + 0.379049, 0.454858, 0.530668, 0.606478, + 0, 0, 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + + describe('when performing operations that takes one extra arguments', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 0, Vec4.add, vecA); }); + + it('should update all values', () => { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 6, 8, 10, 12, + 1, 2, 3, 4 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when specifying an offset', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 4, 0, Vec4.add, vecA); }); + + it('should update all values except the first vector', () => { + expect(vecArray).toBeEqualish([ + 1, 2, 3, 4, + 6, 8, 10, 12, + 1, 2, 3, 4 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when specifying a count', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 2, Vec4.add, vecA); }); + + it('should update all values except the last vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 6, 8, 10, 12, + 0, 0, 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when specifying a stride', () => { + beforeEach(() => { result = Vec4.forEach(vecArray, 8, 0, 0, Vec4.add, vecA); }); + + it('should update all values except the second vector', () => { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 5, 6, 7, 8, + 1, 2, 3, 4 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); + }); + + describe('when calling a function that does not modify the out variable', () => { + beforeEach(() => { result = vec3.forEach(vecArray, 0, 0, 0, function(out, vec) {}); }); + + it('values should remain unchanged', () => { + expect(vecArray).toBeEqualish([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 0, 0, 0, 0 + ]); + }); + it('should return vecArray', () => expect(result).toBe(vecArray)); + }); + });*/ + + describe('str', () => { + it('should return a string representation of the vector', + () => expect(Vec4.str(vecA)).toEqual('Vec4(1, 2, 3, 4)')); + }); + + describe('exactEquals', () => { + let vecC: Vec4Like, r0: boolean, r1: boolean; + + beforeEach(() => { + vecA = [0, 1, 2, 3]; + vecB = [0, 1, 2, 3]; + vecC = [1, 2, 3, 4]; + r0 = Vec4.exactEquals(vecA, vecB); + r1 = Vec4.exactEquals(vecA, vecC); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2, 3)); + }); + + describe('equals', () => { + let vecC: Vec4Like, vecD: Vec4Like, r0: boolean, r1: boolean, r2: boolean; + + beforeEach(() => { + vecA = [0, 1, 2, 3]; + vecB = [0, 1, 2, 3]; + vecC = [1, 2, 3, 4]; + vecD = [1e-16, 1, 2, 3]; + r0 = Vec4.equals(vecA, vecB); + r1 = Vec4.equals(vecA, vecC); + r2 = Vec4.equals(vecA, vecD); + }); + + it('should return true for identical vectors', () => expect(r0).toBe(true)); + it('should return false for different vectors', () => expect(r1).toBe(false)); + it('should return true for close but not identical vectors', () => expect(r2).toBe(true)); + it('should not modify vecA', () => expect(vecA).toBeVec(0, 1, 2, 3)); + it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 2, 3)); + }); + + describe('zero', () => { + beforeEach(() => { + vecA = [1, 2, 3, 4]; + result = Vec4.zero(vecA); + }); + + it('should result in a 4 element vector with zeros', () => expect(result).toBeVec(0, 0, 0, 0)); + }); + }); +}); diff --git a/tests/f64/util.spec.ts b/tests/f64/util.spec.ts new file mode 100644 index 00000000..534dc745 --- /dev/null +++ b/tests/f64/util.spec.ts @@ -0,0 +1,19 @@ +import { expect, describe, it } from 'vitest'; + +import { toDegree, toRadian } from '#gl-matrix/util'; + +describe('Common', () => { + describe('toRadian', () => { + it('should return a value of 0 when passed 0', () => expect(toRadian(0)).toBeCloseTo(0)); + it('should return a value of Math.PI/2 when passed 90', () => expect(toRadian(90)).toBeCloseTo(Math.PI/2)); + it('should return a value of Math.PI when passed 180', () => expect(toRadian(180)).toBeCloseTo(Math.PI)); + it('should return a value of Math.PI*2 when passed 360', () => expect(toRadian(360)).toBeCloseTo(Math.PI*2)); + }); + + describe('toDegree', () => { + it('should return a value of 0 when passed 0', () => expect(toDegree(0)).toBeCloseTo(0)); + it('should return a value of 90 when passed Math.PI/2', () => expect(toDegree(Math.PI/2)).toBeCloseTo(90)); + it('should return a value of 180 when passed Math.PI', () => expect(toDegree(Math.PI)).toBeCloseTo(180)); + it('should return a value of 360 when passed Math.PI*2', () => expect(toDegree(Math.PI*2)).toBeCloseTo(360)); + }); +}); diff --git a/tests/mat2.spec.ts b/tests/mat2.spec.ts deleted file mode 100644 index 56ac1ee0..00000000 --- a/tests/mat2.spec.ts +++ /dev/null @@ -1,386 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import "./test-utils" -import { Mat2 } from "../src/mat2" - -describe("Mat2", function() { - describe("constructor", () => { - it("should return an identity Mat2 if called with no arguments", () => { - expect(new Mat2()).toBeVec( - 1, 0, - 0, 1) - }); - - it("should return Mat2(m0, m1, ...m8) if called with (m0, m1, ...m8)", () => { - expect(new Mat2( - 1, 2, - 3, 4)).toBeVec( - 1, 2, - 3, 4); - }); - - it("should return Mat2(x, x, x, ...) if called with (x)", () => { - expect(new Mat2(1)).toBeVec( - 1, 1, - 1, 1); - }); - - it("should return Mat2(m0, m1, ...m8) if called with ([m0, m1, ...m8])", () => { - expect(new Mat2([ - 1, 2, - 3, 4])).toBeVec( - 1, 2, - 3, 4); - }); - - it("should return Mat2(m0, m1, ...m8) if called with (Mat4(m0, m1, ...m9))", () => { - let v = new Mat2( - 1, 2, - 3, 4); - expect(new Mat2(v)).toBeVec(v); - }); - - it("should return Mat2(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))", () => { - let arr = new Float32Array([ - 1, 2, - 3, 4]); - expect(new Mat2(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out, matA, matB, identity, result; - - beforeEach(function() { - matA = new Float32Array([1, 2, - 3, 4]); - - matB = new Float32Array([5, 6, - 7, 8]); - - out = new Float32Array([0, 0, - 0, 0]); - - identity = new Float32Array([1, 0, - 0, 1]); - }); - - describe("create", function() { - beforeEach(function() { result = Mat2.create(); }); - it("should return a 4 element array initialized to a 2x2 identity matrix", function() { expect(result).toBeVec(identity); }); - }); - - describe("clone", function() { - beforeEach(function() { result = Mat2.clone(matA); }); - it("should return a 4 element array initialized to the values in matA", function() { expect(result).toBeVec(matA); }); - }); - - describe("copy", function() { - beforeEach(function() { result = Mat2.copy(out, matA); }); - it("should place values into out", function() { expect(out).toBeVec(matA); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("identity", function() { - beforeEach(function() { result = Mat2.identity(out); }); - it("should place values into out", function() { expect(result).toBeVec(identity); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("transpose", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.transpose(out, matA); }); - - it("should place values into out", function() { expect(out).toBeVec(1, 3, 2, 4); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.transpose(matA, matA); }); - - it("should place values into matA", function() { expect(matA).toBeVec(1, 3, 2, 4); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("invert", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.invert(out, matA); }); - - it("should place values into out", function() { expect(out).toBeVec(-2, 1, 1.5, -0.5); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.invert(matA, matA); }); - - it("should place values into matA", function() { expect(matA).toBeVec(-2, 1, 1.5, -0.5); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("adjoint", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.adjoint(out, matA); }); - - it("should place values into out", function() { expect(out).toBeVec(4, -2, -3, 1); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.adjoint(matA, matA); }); - - it("should place values into matA", function() { expect(matA).toBeVec(4, -2, -3, 1); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("determinant", function() { - beforeEach(function() { result = Mat2.determinant(matA); }); - - it("should return the determinant", function() { expect(result).toEqual(-2); }); - }); - - describe("multiply", function() { - it("should have an alias called 'mul'", function() { expect(Mat2.mul).toEqual(Mat2.multiply); }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.multiply(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(23, 34, 31, 46); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.multiply(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(23, 34, 31, 46); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2.multiply(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(23, 34, 31, 46); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("rotate", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.rotate(out, matA, Math.PI * 0.5); }); - - it("should place values into out", function() { expect(out).toBeVec(3, 4, -1, -2); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.rotate(matA, matA, Math.PI * 0.5); }); - - it("should place values into matA", function() { expect(matA).toBeVec(3, 4, -1, -2); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("scale", function() { - let vecA; - beforeEach(function() { vecA = [2, 3]; }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.scale(out, matA, vecA); }); - - it("should place values into out", function() { expect(out).toBeVec(2, 4, 9, 12); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.scale(matA, matA, vecA); }); - - it("should place values into matA", function() { expect(matA).toBeVec(2, 4, 9, 12); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("str", function() { - beforeEach(function() { result = Mat2.str(matA); }); - - it("should return a string representation of the matrix", function() { expect(result).toEqual("Mat2(1, 2, 3, 4)"); }); - }); - - describe("frob", function() { - beforeEach(function() { result = Mat2.frob(matA); }); - it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2))); }); - }); - - describe("LDU", function() { - let L, D, U, L_result, D_result, U_result; - beforeEach(function() { - L = Mat2.create(); - D = Mat2.create(); - U = Mat2.create(); - result = Mat2.LDU(L, D, U, [4,3,6,3]); - L_result = Mat2.create(); L_result[2] = 1.5; - D_result = Mat2.create(); - U_result = Mat2.create(); - U_result[0] = 4; U_result[1] = 3; U_result[3] = -1.5; - }); - it("should return a lower triangular, a diagonal and an upper triangular matrix", function() { - expect(result[0]).toBeVec(L_result); - expect(result[1]).toBeVec(D_result); - expect(result[2]).toBeVec(U_result); - }); - }); - - describe("add", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.add(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(6, 8, 10, 12); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.add(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(6, 8, 10, 12); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2.add(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(6, 8, 10, 12); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("subtract", function() { - it("should have an alias called 'sub'", function() { expect(Mat2.sub).toEqual(Mat2.subtract); }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.subtract(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(-4, -4, -4, -4); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.subtract(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(-4, -4, -4, -4); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2.subtract(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(-4, -4, -4, -4); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("fromValues", function() { - beforeEach(function() { result = Mat2.fromValues(1, 2, 3, 4); }); - it("should return a 4 element array initialized to the values passed", function() { expect(result).toBeVec(1, 2, 3, 4); }); - }); - - describe("set", function() { - beforeEach(function() { result = Mat2.set(out, 1, 2, 3, 4); }); - it("should place values into out", function() { expect(out).toBeVec(1, 2, 3, 4); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("multiplyScalar", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.multiplyScalar(out, matA, 2); }); - - it("should place values into out", function() { expect(out).toBeVec(2, 4, 6, 8); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.multiplyScalar(matA, matA, 2); }); - - it("should place values into matA", function() { expect(matA).toBeVec(2, 4, 6, 8); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("multiplyScalarAndAdd", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2.multiplyScalarAndAdd(out, matA, matB, 0.5); }); - - it("should place values into out", function() { expect(out).toBeVec(3.5, 5, 6.5, 8); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); - - it("should place values into matA", function() { expect(matA).toBeVec(3.5, 5, 6.5, 8); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); - - it("should place values into matB", function() { expect(matB).toBeVec(3.5, 5, 6.5, 8); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("exactEquals", function() { - let matC, r0, r1, r2; - beforeEach(function() { - matA = [0, 1, 2, 3]; - matB = [0, 1, 2, 3]; - matC = [1, 2, 3, 4]; - r0 = Mat2.exactEquals(matA, matB); - r1 = Mat2.exactEquals(matA, matC); - }); - it("should return true for identical matrices", function() { expect(r0).toBe(true); }); - it("should return false for different matrices", function() { expect(r1).toBe(false); }); - it("should not modify matA", function() { expect(matA).toBeVec(0, 1, 2, 3); }); - it("should not modify matB", function() { expect(matB).toBeVec(0, 1, 2, 3); }); - }); - - describe("equals", function() { - let matC, matD, r0, r1, r2; - beforeEach(function() { - matA = [0, 1, 2, 3]; - matB = [0, 1, 2, 3]; - matC = [1, 2, 3, 4]; - matD = [1e-16, 1, 2, 3]; - r0 = Mat2.equals(matA, matB); - r1 = Mat2.equals(matA, matC); - r2 = Mat2.equals(matA, matD); - }); - it("should return true for identical matrices", function() { expect(r0).toBe(true); }); - it("should return false for different matrices", function() { expect(r1).toBe(false); }); - it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); - it("should not modify matA", function() { expect(matA).toBeVec(0, 1, 2, 3); }); - it("should not modify matB", function() { expect(matB).toBeVec(0, 1, 2, 3); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/mat2d.spec.ts b/tests/mat2d.spec.ts deleted file mode 100644 index 781cf0a9..00000000 --- a/tests/mat2d.spec.ts +++ /dev/null @@ -1,374 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import "./test-utils" -import { Mat2d } from "../src/Mat2d" - -describe("Mat2d", function() { - describe("constructor", () => { - it("should return an identity Mat2d if called with no arguments", () => { - expect(new Mat2d()).toBeVec( - 1, 0, - 0, 1, - 0, 0) - }); - - it("should return Mat2d(m0, m1, ...m5) if called with (m0, m1, ...m5)", () => { - expect(new Mat2d( - 1, 2, - 3, 4, - 5, 6)).toBeVec( - 1, 2, - 3, 4, - 5, 6); - }); - - it("should return Mat2d(x, x, x, ...) if called with (x)", () => { - expect(new Mat2d(1)).toBeVec( - 1, 1, - 1, 1, - 1, 1); - }); - - it("should return Mat2d(m0, m1, ...m8) if called with ([m0, m1, ...m8])", () => { - expect(new Mat2d([ - 1, 2, - 3, 4, - 5, 6])).toBeVec( - 1, 2, - 3, 4, - 5, 6); - }); - - it("should return Mat2d(m0, m1, ...m8) if called with (Mat2d(m0, m1, ...m9))", () => { - let v = new Mat2d( - 1, 2, - 3, 4, - 5, 6); - expect(new Mat2d(v)).toBeVec(v); - }); - - it("should return Mat2d(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))", () => { - let arr = new Float32Array([ - 1, 2, - 3, 4, - 5, 6]); - expect(new Mat2d(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out, matA, matB, oldA, oldB, identity, result; - - beforeEach(function() { - matA = new Float32Array([1, 2, - 3, 4, - 5, 6]); - - oldA = new Float32Array([1, 2, - 3, 4, - 5, 6]); - - matB = new Float32Array([7, 8, - 9, 10, - 11, 12]); - - oldB = new Float32Array([7, 8, - 9, 10, - 11, 12]); - - out = new Float32Array([0, 0, - 0, 0, - 0, 0]); - - identity = new Float32Array([1, 0, - 0, 1, - 0, 0]); - }); - - describe("create", function() { - beforeEach(function() { result = Mat2d.create(); }); - it("should return a 6 element array initialized to a 2x3 identity matrix", function() { expect(result).toBeVec(identity); }); - }); - - describe("clone", function() { - beforeEach(function() { result = Mat2d.clone(matA); }); - it("should return a 6 element array initialized to the values in matA", function() { expect(result).toBeVec(matA); }); - }); - - describe("copy", function() { - beforeEach(function() { result = Mat2d.copy(out, matA); }); - it("should place values into out", function() { expect(out).toBeVec(matA); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("identity", function() { - beforeEach(function() { result = Mat2d.identity(out); }); - it("should place values into out", function() { expect(result).toBeVec(identity); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("invert", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.invert(out, matA); }); - - it("should place values into out", function() { expect(out).toBeVec( -2, 1, 1.5, -0.5, 1, -2 ); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.invert(matA, matA); }); - - it("should place values into matA", function() { expect(matA).toBeVec( -2, 1, 1.5, -0.5, 1, -2 ); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("determinant", function() { - beforeEach(function() { result = Mat2d.determinant(matA); }); - - it("should return the determinant", function() { expect(result).toEqual(-2); }); - }); - - describe("multiply", function() { - it("should have an alias called 'mul'", function() { expect(Mat2d.mul).toEqual(Mat2d.multiply); }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.multiply(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(31, 46, 39, 58, 52, 76); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - it("should not modify matB", function() { expect(matB).toBeVec(oldB); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.multiply(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(31, 46, 39, 58, 52, 76); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(oldB); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2d.multiply(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(31, 46, 39, 58, 52, 76); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - }); - - describe("rotate", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.rotate(out, matA, Math.PI * 0.5); }); - - it("should place values into out", function() { expect(out).toBeVec(3, 4, -1, -2, 5, 6); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.rotate(matA, matA, Math.PI * 0.5); }); - - it("should place values into matA", function() { expect(matA).toBeVec(3, 4, -1, -2, 5, 6); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("scale", function() { - let vecA; - beforeEach(function() { vecA = [2, 3]; }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.scale(out, matA, vecA); }); - - it("should place values into out", function() { expect(out).toBeVec(2, 4, 9, 12, 5, 6); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.scale(matA, matA, vecA); }); - - it("should place values into matA", function() { expect(matA).toBeVec(2, 4, 9, 12, 5, 6); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("translate", function() { - let vecA; - beforeEach(function() { vecA = [2, 3]; }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.translate(out, matA, vecA); }); - - it("should place values into out", function() { expect(out).toBeVec(1, 2, 3, 4, 16, 22); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.translate(matA, matA, vecA); }); - - it("should place values into matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 16, 22); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("str", function() { - beforeEach(function() { result = Mat2d.str(matA); }); - - it("should return a string representation of the matrix", function() { expect(result).toEqual("Mat2d(1, 2, 3, 4, 5, 6)"); }); - }); - - describe("frob", function() { - beforeEach(function() { result = Mat2d.frob(matA); }); - it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2) + Math.pow(5, 2) + Math.pow(6, 2) + 1)); }); - }); - - describe("add", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.add(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(8, 10, 12, 14, 16, 18); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - it("should not modify matB", function() { expect(matB).toBeVec(oldB); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.add(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(8, 10, 12, 14, 16, 18); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(oldB); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2d.add(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(8, 10, 12, 14, 16, 18); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - }); - - describe("subtract", function() { - it("should have an alias called 'sub'", function() { expect(Mat2d.sub).toEqual(Mat2d.subtract); }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.subtract(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(-6, -6, -6, -6, -6, -6); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - it("should not modify matB", function() { expect(matB).toBeVec(oldB); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.subtract(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(-6, -6, -6, -6, -6, -6); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(oldB); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2d.subtract(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(-6, -6, -6, -6, -6, -6); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(oldA); }); - }); - }); - - describe("fromValues", function() { - beforeEach(function() { result = Mat2d.fromValues(1, 2, 3, 4, 5, 6); }); - it("should return a 6 element array initialized to the values passed", function() { expect(result).toBeVec(1, 2, 3, 4, 5, 6); }); - }); - - describe("set", function() { - beforeEach(function() { result = Mat2d.set(out, 1, 2, 3, 4, 5, 6); }); - it("should place values into out", function() { expect(out).toBeVec(1, 2, 3, 4, 5, 6); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("multiplyScalar", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.multiplyScalar(out, matA, 2); }); - - it("should place values into out", function() { expect(out).toBeVec(2, 4, 6, 8, 10, 12); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.multiplyScalar(matA, matA, 2); }); - - it("should place values into matA", function() { expect(matA).toBeVec(2, 4, 6, 8, 10, 12); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("multiplyScalarAndAdd", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat2d.multiplyScalarAndAdd(out, matA, matB, 0.5); }); - - it("should place values into out", function() { expect(out).toBeVec(4.5, 6, 7.5, 9, 10.5, 12); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6); }); - it("should not modify matB", function() { expect(matB).toBeVec(7, 8, 9, 10, 11, 12); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat2d.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); - - it("should place values into matA", function() { expect(matA).toBeVec(4.5, 6, 7.5, 9, 10.5, 12); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(7, 8, 9, 10, 11, 12); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat2d.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); - - it("should place values into matB", function() { expect(matB).toBeVec(4.5, 6, 7.5, 9, 10.5, 12); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6); }); - }); - }); - - describe("exactEquals", function() { - let matC, r0, r1; - beforeEach(function() { - matA = [0, 1, 2, 3, 4, 5]; - matB = [0, 1, 2, 3, 4, 5]; - matC = [1, 2, 3, 4, 5, 6]; - r0 = Mat2d.exactEquals(matA, matB); - r1 = Mat2d.exactEquals(matA, matC); - }); - - it("should return true for identical matrices", function() { expect(r0).toBe(true); }); - it("should return false for different matrices", function() { expect(r1).toBe(false); }); - it("should not modify matA", function() { expect(matA).toBeVec(0, 1, 2, 3, 4, 5); }); - it("should not modify matB", function() { expect(matB).toBeVec(0, 1, 2, 3, 4, 5); }); - }); - - describe("equals", function() { - let matC, matD, r0, r1, r2; - beforeEach(function() { - matA = [0, 1, 2, 3, 4, 5]; - matB = [0, 1, 2, 3, 4, 5]; - matC = [1, 2, 3, 4, 5, 6]; - matD = [1e-16, 1, 2, 3, 4, 5]; - r0 = Mat2d.equals(matA, matB); - r1 = Mat2d.equals(matA, matC); - r2 = Mat2d.equals(matA, matD); - }); - it("should return true for identical matrices", function() { expect(r0).toBe(true); }); - it("should return false for different matrices", function() { expect(r1).toBe(false); }); - it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); - it("should not modify matA", function() { expect(matA).toBeVec(0, 1, 2, 3, 4, 5); }); - it("should not modify matB", function() { expect(matB).toBeVec(0, 1, 2, 3, 4, 5); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/mat3.spec.ts b/tests/mat3.spec.ts deleted file mode 100644 index f876e72f..00000000 --- a/tests/mat3.spec.ts +++ /dev/null @@ -1,560 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import "./test-utils" -import { Mat3 } from "../src/mat3" -import { Mat4 } from "../src/mat4" -import { Vec3 } from "../src/vec3" - -describe("Mat3", function() { - describe("constructor", () => { - it("should return an identity Mat3 if called with no arguments", () => { - expect(new Mat3()).toBeVec( - 1, 0, 0, - 0, 1, 0, - 0, 0, 1) - }); - - it("should return Mat3(m0, m1, ...m8) if called with (m0, m1, ...m8)", () => { - expect(new Mat3( - 1, 2, 3, - 4, 5, 6, - 7, 8, 9)).toBeVec( - 1, 2, 3, - 4, 5, 6, - 7, 8, 9); - }); - - it("should return Mat3(x, x, x, ...) if called with (x)", () => { - expect(new Mat3(1)).toBeVec( - 1, 1, 1, - 1, 1, 1, - 1, 1, 1); - }); - - it("should return Mat3(m0, m1, ...m8) if called with ([m0, m1, ...m8])", () => { - expect(new Mat3([ - 1, 2, 3, - 4, 5, 6, - 7, 8, 9])).toBeVec( - 1, 2, 3, - 4, 5, 6, - 7, 8, 9); - }); - - it("should return Mat3(m0, m1, ...m8) if called with (Mat3(m0, m1, ...m9))", () => { - let v = new Mat3( - 1, 2, 3, - 4, 5, 6, - 7, 8, 9); - expect(new Mat3(v)).toBeVec(v); - }); - - it("should return Mat3(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))", () => { - let arr = new Float32Array([ - 1, 2, 3, - 4, 5, 6, - 7, 8, 9]); - expect(new Mat3(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out, matA, matB, identity, result; - - beforeEach(function() { - matA = new Float32Array([1, 0, 0, - 0, 1, 0, - 1, 2, 1]); - - matB = new Float32Array([1, 0, 0, - 0, 1, 0, - 3, 4, 1]); - - out = new Float32Array([0, 0, 0, - 0, 0, 0, - 0, 0, 0]); - - identity = new Float32Array([1, 0, 0, - 0, 1, 0, - 0, 0, 1]); - }); - - describe("normalFromMat4", function() { - beforeEach(function() { - matA = new Float32Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1]); - result = Mat3.normalFromMat4(out, matA); - }); - - it("should return out", function() { expect(result).toBe(out); }); - - describe("with translation and rotation", function() { - beforeEach(function() { - Mat4.translate(matA, matA, [2, 4, 6]); - Mat4.rotateX(matA, matA, Math.PI / 2); - - result = Mat3.normalFromMat4(out, matA); - }); - - it("should give rotated matrix", function() { - expect(result).toBeVec(1, 0, 0, - 0, 0, 1, - 0,-1, 0); - }); - - describe("and scale", function() { - beforeEach(function() { - Mat4.scale(matA, matA, [2, 3, 4]); - - result = Mat3.normalFromMat4(out, matA); - }); - - it("should give rotated matrix", function() { - expect(result).toBeVec(0.5, 0, 0, - 0, 0, 0.333333, - 0, -0.25, 0); - }); - }); - }); - }); - - describe("fromQuat", function() { - let q; - - beforeEach(function() { - q = [ 0, -0.7071067811865475, 0, 0.7071067811865475 ]; - result = Mat3.fromQuat(out, q); - }); - - it("should return out", function() { expect(result).toBe(out); }); - - it("should rotate a vector the same as the original quat", function() { - let vecOut = new Vec3(); - Vec3.transformQuat(vecOut, [0,0,-1], q); - expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(vecOut); - }); - - it("should rotate a vector by PI/2 radians", function() { - expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(1,0,0); - }); - }); - - describe("fromMat4", function() { - beforeEach(function() { - result = Mat3.fromMat4(out, [ 1, 2, 3, 4, - 5, 6, 7, 8, - 9,10,11,12, - 13,14,15,16]); }); - - it("should return out", function() { expect(result).toBe(out); }); - - it("should calculate proper Mat3", function() { - expect(out).toBeVec( 1, 2, 3, - 5, 6, 7, - 9,10,11); - }); - }); - - describe("scale", function() { - beforeEach(function() { result = Mat3.scale(out, matA, [2,2]); }); - it("should return out", function() { expect(result).toBe(out); }); - it('should place proper values in out', function() { - expect(out).toBeVec( 2, 0, 0, - 0, 2, 0, - 1, 2, 1 ); - }); - }); - - describe("create", function() { - beforeEach(function() { result = Mat3.create(); }); - it("should return a 9 element array initialized to a 3x3 identity matrix", function() { expect(result).toBeVec(identity); }); - }); - - describe("clone", function() { - beforeEach(function() { result = Mat3.clone(matA); }); - it("should return a 9 element array initialized to the values in matA", function() { expect(result).toBeVec(matA); }); - }); - - describe("copy", function() { - beforeEach(function() { result = Mat3.copy(out, matA); }); - it("should place values into out", function() { expect(out).toBeVec(matA); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("identity", function() { - beforeEach(function() { result = Mat3.identity(out); }); - it("should place values into out", function() { expect(result).toBeVec(identity); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("transpose", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.transpose(out, matA); }); - - it("should place values into out", function() { - expect(out).toBeVec( - 1, 0, 1, - 0, 1, 2, - 0, 0, 1 - ); - }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - 1, 2, 1 - ); - }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.transpose(matA, matA); }); - - it("should place values into matA", function() { - expect(matA).toBeVec( - 1, 0, 1, - 0, 1, 2, - 0, 0, 1 - ); - }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("invert", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.invert(out, matA); }); - - it("should place values into out", function() { - expect(out).toBeVec( - 1, 0, 0, - 0, 1, 0, - -1, -2, 1 - ); - }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - 1, 2, 1 - ); - }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.invert(matA, matA); }); - - it("should place values into matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - -1, -2, 1 - ); - }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("adjoint", function() { - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.adjoint(out, matA); }); - - it("should place values into out", function() { - expect(out).toBeVec( - 1, 0, 0, - 0, 1, 0, - -1, -2, 1 - ); - }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - 1, 2, 1 - ); - }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.adjoint(matA, matA); }); - - it("should place values into matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - -1, -2, 1 - ); - }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("determinant", function() { - beforeEach(function() { result = Mat3.determinant(matA); }); - - it("should return the determinant", function() { expect(result).toEqual(1); }); - }); - - describe("multiply", function() { - it("should have an alias called 'mul'", function() { expect(Mat3.mul).toEqual(Mat3.multiply); }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.multiply(out, matA, matB); }); - - it("should place values into out", function() { - expect(out).toBeVec( - 1, 0, 0, - 0, 1, 0, - 4, 6, 1 - ); - }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - 1, 2, 1 - ); - }); - it("should not modify matB", function() { - expect(matB).toBeVec( - 1, 0, 0, - 0, 1, 0, - 3, 4, 1 - ); - }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.multiply(matA, matA, matB); }); - - it("should place values into matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - 4, 6, 1 - ); - }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { - expect(matB).toBeVec( - 1, 0, 0, - 0, 1, 0, - 3, 4, 1 - ); - }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat3.multiply(matB, matA, matB); }); - - it("should place values into matB", function() { - expect(matB).toBeVec( - 1, 0, 0, - 0, 1, 0, - 4, 6, 1 - ); - }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { - expect(matA).toBeVec( - 1, 0, 0, - 0, 1, 0, - 1, 2, 1 - ); - }); - }); - }); - - describe("str", function() { - beforeEach(function() { result = Mat3.str(matA); }); - - it("should return a string representation of the matrix", function() { expect(result).toEqual("Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)"); }); - }); - - describe("frob", function() { - beforeEach(function() { result = Mat3.frob(matA); }); - it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(1, 2))); }); - }); - - describe("add", function() { - beforeEach(function() { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; - }); - describe("with a separate output matrix", function() { - beforeEach(function() { - result = Mat3.add(out, matA, matB); - }); - - it("should place values into out", function() { expect(out).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - it("should not modify matB", function() { expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.add(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat3.add(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(11, 13, 15, 17, 19, 21, 23, 25, 27); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - }); - }); - - describe("subtract", function() { - beforeEach(function() { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; - }); - it("should have an alias called 'sub'", function() { expect(Mat3.sub).toEqual(Mat3.subtract); }); - - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.subtract(out, matA, matB); }); - - it("should place values into out", function() { expect(out).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - it("should not modify matB", function() { expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.subtract(matA, matA, matB); }); - - it("should place values into matA", function() { expect(matA).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat3.subtract(matB, matA, matB); }); - - it("should place values into matB", function() { expect(matB).toBeVec(-9, -9, -9, -9, -9, -9, -9, -9, -9); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - }); - }); - - describe("fromValues", function() { - beforeEach(function() { result = Mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - it("should return a 9 element array initialized to the values passed", function() { expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - }); - - describe("set", function() { - beforeEach(function() { result = Mat3.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9); }); - it("should place values into out", function() { expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("multiplyScalar", function() { - beforeEach(function() { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - }); - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.multiplyScalar(out, matA, 2); }); - - it("should place values into out", function() { expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.multiplyScalar(matA, matA, 2); }); - - it("should place values into matA", function() { expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18); }); - it("should return matA", function() { expect(result).toBe(matA); }); - }); - }); - - describe("multiplyScalarAndAdd", function() { - beforeEach(function() { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; - }); - describe("with a separate output matrix", function() { - beforeEach(function() { result = Mat3.multiplyScalarAndAdd(out, matA, matB, 0.5); }); - - it("should place values into out", function() { expect(out).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - it("should not modify matB", function() { expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18); }); - }); - - describe("when matA is the output matrix", function() { - beforeEach(function() { result = Mat3.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); - - it("should place values into matA", function() { expect(matA).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18); }); - it("should return matA", function() { expect(result).toBe(matA); }); - it("should not modify matB", function() { expect(matB).toBeVec(10, 11, 12, 13, 14, 15, 16, 17, 18); }); - }); - - describe("when matB is the output matrix", function() { - beforeEach(function() { result = Mat3.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); - - it("should place values into matB", function() { expect(matB).toBeVec(6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18); }); - it("should return matB", function() { expect(result).toBe(matB); }); - it("should not modify matA", function() { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9); }); - }); - }); - - describe("projection", function() { - beforeEach(function() { - result = Mat3.projection(out, 100.0, 200.0); - }); - - it("should return out", function() { expect(result).toBe(out); }); - - it("should give projection matrix", function() { - expect(result).toBeVec(0.02, 0, 0, - 0, -0.01, 0, - -1, 1, 1); - }); - }); - - describe("exactEquals", function() { - let matC, r0, r1; - beforeEach(function() { - matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - r0 = Mat3.exactEquals(matA, matB); - r1 = Mat3.exactEquals(matA, matC); - }); - - it("should return true for identical matrices", function() { expect(r0).toBe(true); }); - it("should return false for different matrices", function() { expect(r1).toBe(false); }); - it("should not modify matA", function() { expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8); }); - it("should not modify matB", function() { expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8); }); - }); - - describe("equals", function() { - let matC, matD, r0, r1, r2; - beforeEach(function() { - matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; - matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8]; - r0 = Mat3.equals(matA, matB); - r1 = Mat3.equals(matA, matC); - r2 = Mat3.equals(matA, matD); - }); - it("should return true for identical matrices", function() { expect(r0).toBe(true); }); - it("should return false for different matrices", function() { expect(r1).toBe(false); }); - it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); - it("should not modify matA", function() { expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8); }); - it("should not modify matB", function() { expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/mat4.spec.ts b/tests/mat4.spec.ts deleted file mode 100644 index c5c77b57..00000000 --- a/tests/mat4.spec.ts +++ /dev/null @@ -1,1182 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import "./test-utils" -import { Mat4, Mat4Like } from "../src/mat4" -import { Vec3, Vec3Like } from "../src/vec3" -import { Quat } from "../src/quat" - -describe("Mat4", () => { - describe("constructor", () => { - it("should return an identity Mat4 if called with no arguments", () => { - expect(new Mat4()).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1); - }); - - it("should return Mat4(m0, m1, ...m15) if called with (m0, m1, ...m15)", () => { - expect(new Mat4( - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16)).toBeVec( - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16); - }); - - it("should return Mat4(x, x, x) if called with (x)", () => { - expect(new Mat4(1)).toBeVec( - 1, 1, 1, 1, - 1, 1, 1, 1, - 1, 1, 1, 1, - 1, 1, 1, 1); - }); - - it("should return Mat4(m0, m1, ...m15) if called with ([m0, m1, ...m15])", () => { - expect(new Mat4([ - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16])).toBeVec( - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16); - }); - - it("should return Mat4(m0, m1, ...m15) if called with (Mat4(m0, m1, ...m15))", () => { - let v = new Mat4( - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16); - expect(new Mat4(v)).toBeVec(v); - }); - - it("should return Mat4(m0, m1, ...m15) if called with (Float32Array([m0, m1, ...m15]))", () => { - let arr = new Float32Array([ - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16]); - expect(new Mat4(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out, matA, matB, identity, result; - - beforeEach(() => { - // Attempting to portray a semi-realistic transform matrix - matA = new Float32Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1]); - - matB = new Float32Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 4, 5, 6, 1]); - - out = new Float32Array([0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0]); - - identity = new Float32Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1]); - }); - - describe("create", () => { - beforeEach(() => { result = Mat4.create(); }); - it("should return a 16 element array initialized to a 4x4 identity matrix", () => { expect(result).toBeVec(identity); }); - }); - - describe("clone", () => { - beforeEach(() => { result = Mat4.clone(matA); }); - it("should return a 16 element array initialized to the values in matA", () => { expect(result).toBeVec(matA); }); - }); - - describe("copy", () => { - beforeEach(() => { result = Mat4.copy(out, matA); }); - it("should place values into out", () => { expect(out).toBeVec(matA); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("identity", () => { - beforeEach(() => { result = Mat4.identity(out); }); - it("should place values into out", () => { expect(result).toBeVec(identity); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("transpose", () => { - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.transpose(out, matA); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 1, - 0, 1, 0, 2, - 0, 0, 1, 3, - 0, 0, 0, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.transpose(matA, matA); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 1, - 0, 1, 0, 2, - 0, 0, 1, 3, - 0, 0, 0, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("invert", () => { - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.invert(out, matA); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - -1, -2, -3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.invert(matA, matA); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - -1, -2, -3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("adjoint", () => { - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.adjoint(out, matA); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - -1, -2, -3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.adjoint(matA, matA); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - -1, -2, -3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("determinant", () => { - beforeEach(() => { result = Mat4.determinant(matA); }); - - it("should return the determinant", () => { expect(result).toEqual(1); }); - }); - - describe("multiply", () => { - it("should have an alias called 'mul'", () => { expect(Mat4.mul).toEqual(Mat4.multiply); }); - - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.multiply(out, matA, matB); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 5, 7, 9, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - it("should not modify matB", () => { - expect(matB).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 4, 5, 6, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.multiply(matA, matA, matB); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 5, 7, 9, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - it("should not modify matB", () => { - expect(matB).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 4, 5, 6, 1 - ); - }); - }); - - describe("when matB is the output matrix", () => { - beforeEach(() => { result = Mat4.multiply(matB, matA, matB); }); - - it("should place values into matB", () => { - expect(matB).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 5, 7, 9, 1 - ); - }); - it("should return matB", () => { expect(result).toBe(matB); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - }); - - describe("translate", () => { - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.translate(out, matA, [4, 5, 6]); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 5, 7, 9, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.translate(matA, matA, [4, 5, 6]); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 5, 7, 9, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("scale", () => { - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.scale(out, matA, [4, 5, 6]); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 4, 0, 0, 0, - 0, 5, 0, 0, - 0, 0, 6, 0, - 1, 2, 3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.scale(matA, matA, [4, 5, 6]); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 4, 0, 0, 0, - 0, 5, 0, 0, - 0, 0, 6, 0, - 1, 2, 3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("rotate", () => { - let rad = Math.PI * 0.5; - let axis: Vec3Like = [1, 0, 0]; - - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.rotate(out, matA, rad, axis); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 0, - 0, Math.cos(rad), Math.sin(rad), 0, - 0, -Math.sin(rad), Math.cos(rad), 0, - 1, 2, 3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.rotate(matA, matA, rad, axis); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, Math.cos(rad), Math.sin(rad), 0, - 0, -Math.sin(rad), Math.cos(rad), 0, - 1, 2, 3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("rotateX", () => { - let rad = Math.PI * 0.5; - - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.rotateX(out, matA, rad); }); - - it("should place values into out", () => { - expect(out).toBeVec( - 1, 0, 0, 0, - 0, Math.cos(rad), Math.sin(rad), 0, - 0, -Math.sin(rad), Math.cos(rad), 0, - 1, 2, 3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.rotateX(matA, matA, rad); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, Math.cos(rad), Math.sin(rad), 0, - 0, -Math.sin(rad), Math.cos(rad), 0, - 1, 2, 3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("rotateY", () => { - let rad = Math.PI * 0.5; - - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.rotateY(out, matA, rad); }); - - it("should place values into out", () => { - expect(out).toBeVec( - Math.cos(rad), 0, -Math.sin(rad), 0, - 0, 1, 0, 0, - Math.sin(rad), 0, Math.cos(rad), 0, - 1, 2, 3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.rotateY(matA, matA, rad); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - Math.cos(rad), 0, -Math.sin(rad), 0, - 0, 1, 0, 0, - Math.sin(rad), 0, Math.cos(rad), 0, - 1, 2, 3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("rotateZ", () => { - let rad = Math.PI * 0.5; - - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.rotateZ(out, matA, rad); }); - - it("should place values into out", () => { - expect(out).toBeVec( - Math.cos(rad), Math.sin(rad), 0, 0, - -Math.sin(rad), Math.cos(rad), 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { - expect(matA).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.rotateZ(matA, matA, rad); }); - - it("should place values into matA", () => { - expect(matA).toBeVec( - Math.cos(rad), Math.sin(rad), 0, 0, - -Math.sin(rad), Math.cos(rad), 0, 0, - 0, 0, 1, 0, - 1, 2, 3, 1 - ); - }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - // TODO: fromRotationTranslation - - describe("normalFromMat4", function() { - beforeEach(function() { - matA = new Float32Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1]); - result = Mat4.normalFromMat4(out, matA); - }); - - it("should return out", function() { expect(result).toBe(out); }); - - describe("with translation and rotation", function() { - beforeEach(function() { - Mat4.translate(matA, matA, [2, 4, 6]); - Mat4.rotateX(matA, matA, Math.PI / 2); - - result = Mat4.normalFromMat4(out, matA); - }); - - it("should give rotated matrix", function() { - expect(result).toBeVec(1, 0, 0, 0, - 0, 0, 1, 0, - 0,-1, 0, 0, - 0, 0, 0, 1); - }); - - describe("and scale", function() { - beforeEach(function() { - Mat4.scale(matA, matA, [2, 3, 4]); - - result = Mat4.normalFromMat4(out, matA); - }); - - it("should give rotated matrix", function() { - expect(result).toBeVec(0.5, 0, 0, 0, - 0, 0, 0.333333, 0, - 0, -0.25, 0, 0, - 0, 0, 0, 1); - }); - }); - }); - }); - - describe("getTranslation", () => { - describe("from the identity matrix", () => { - beforeEach(() => { - result = Vec3.fromValues(1, 2, 3); - out = Vec3.fromValues(1, 2, 3); - result = Mat4.getTranslation(out, identity); - }); - it("should place result both in result and out", () => { expect(result).toBe(out); }); - it("should return the zero vector", () => { expect(result).toBeVec(0, 0, 0); }); - }); - - describe("from a translation-only matrix", () => { - beforeEach(() => { - result = new Vec3(1, 2, 3); - out = new Vec3(1, 2, 3); - result = Mat4.getTranslation(out, matB); - }); - it("should return translation vector", () => { expect(out).toBeVec(4, 5, 6); }); - }); - - describe("from a translation and rotation matrix", () => { - beforeEach(() => { - let q = new Quat(); - let v = new Vec3(5, 6, 7); - Quat.setAxisAngle(q, [0.26726124, 0.534522474, 0.8017837], 0.55); - Mat4.fromRotationTranslation(out, q, v); - - result = new Vec3(); - Mat4.getTranslation(result, out); - }); - it("should keep the same translation vector, regardless of rotation", () => { - expect(result).toBeVec(5, 6, 7); - }); - }); - }); - - describe("getScaling", () => { - describe("from the identity matrix", () => { - beforeEach(() => { - result = new Vec3(1, 2, 3); - out = new Vec3(1, 2, 3); - result = Mat4.getScaling(out, identity); - }); - it("should place result both in result and out", () => { expect(result).toBe(out); }); - it("should return the identity vector", () => { expect(result).toBeVec(1, 1, 1); }); - }); - - describe("from a scale-only matrix", () => { - beforeEach(() => { - let v = new Vec3(4, 5, 6); - result = new Vec3(1, 2, 3) - out = new Vec3(1, 2, 3); - Mat4.fromScaling(matA, v); - result = Mat4.getScaling(out, matA); - }); - it("should return translation vector", () => { expect(out).toBeVec(4, 5, 6); }); - }); - - describe("from a translation and rotation matrix", () => { - beforeEach(() => { - let q = Quat.create(); - let v = Vec3.fromValues(5, 6, 7); - q = Quat.setAxisAngle(q, [1, 0, 0], 0.5); - Mat4.fromRotationTranslation(out, q, v); - - result = Vec3.fromValues(1, 2, 3); - Mat4.getScaling(result, out); - }) - it("should return the identity vector", () => { expect(result).toBeVec(1, 1, 1); }); - }); - - describe("from a translation, rotation and scale matrix", () => { - beforeEach(() => { - let q = Quat.create(); - let t = Vec3.fromValues(1, 2, 3); - let s = Vec3.fromValues(5, 6, 7); - q = Quat.setAxisAngle(q, [0, 1, 0], 0.7); - Mat4.fromRotationTranslationScale(out, q, t, s); - result = Vec3.fromValues(5, 6, 7); - Mat4.getScaling(result, out); - }) - it("should return the same scaling factor when created", () => { expect(result).toBeVec(5, 6, 7); }); - }); - - }); - - describe("getRotation", () => { - describe("from the identity matrix", () => { - beforeEach(() => { - result = Quat.fromValues(1, 2, 3, 4); - out = Quat.fromValues(1, 2, 3, 4); - result = Mat4.getRotation(out, identity); - }); - it("should place result both in result and out", () => { expect(result).toBe(out); }); - it("should return the unit quaternion", () => { - let unitQuat = Quat.create(); - Quat.identity(unitQuat); - expect(result).toBeVec(unitQuat); - }); - }); - - describe("from a translation-only matrix", () => { - beforeEach(() => { - result = Quat.fromValues(1, 2, 3, 4); - out = Quat.fromValues(1, 2, 3, 4); - result = Mat4.getRotation(out, matB); - }); - it("should return the unit quaternion", () => { - let unitQuat = Quat.create(); - Quat.identity(unitQuat); - expect(result).toBeVec(unitQuat); - }); - }); - - describe("from a translation and rotation matrix", () => { - it("should keep the same rotation as when created", () => { - let q = Quat.create(); - let outVec = Vec3.fromValues(5, 6, 7); - let testVec = Vec3.fromValues(1, 5, 2); - let ang = 0.78972; - - Vec3.normalize(testVec, testVec); - q = Quat.setAxisAngle(q, testVec, ang); - Mat4.fromRotationTranslation(out, q, outVec); - - result = Quat.fromValues(2, 3, 4, 6); - Mat4.getRotation(result, out); - let outaxis = Vec3.create(); - let outangle = Quat.getAxisAngle(outaxis, result); - - expect(outaxis).toBeVec(testVec); - expect(outangle).toBeCloseTo(ang); - }); - }); - }); - - describe("frustumNO", () => { - it("should have an alias called 'frustum'", () => { expect(Mat4.frustumNO).toEqual(Mat4.frustum); }); - - beforeEach(() => { result = Mat4.frustumNO(out, -1, 1, -1, 1, -1, 1); }); - it("should place values into out", () => { expect(result).toBeVec( - -1, 0, 0, 0, - 0, -1, 0, 0, - 0, 0, 0, -1, - 0, 0, 1, 0 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - - describe("with an Infinite far plane", () => { - beforeEach(() => { result = Mat4.frustumNO(out, -1, 1, -1, 1, -1, Infinity); }); - it("should calculate correct matrix", () => { expect(result).toBeVec( - -1, 0, 0, 0, - 0, -1, 0, 0, - 0, 0, -1, -1, - 0, 0, 2, 0 - ); }); - }); - }); - - describe("frustumZO", () => { - beforeEach(() => { result = Mat4.frustumZO(out, -1, 1, -1, 1, -1, 1); }); - it("should place values into out", () => { expect(result).toBeVec( - -1, 0, 0, 0, - 0, -1, 0, 0, - 0, 0, -0.5, -1, - 0, 0, 0.5, 0 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - - describe("with an Infinite far plane", () => { - beforeEach(() => { result = Mat4.frustumZO(out, -1, 1, -1, 1, -1, Infinity); }); - it("should calculate correct matrix", () => { expect(result).toBeVec( - -1, 0, 0, 0, - 0, -1, 0, 0, - 0, 0, -1, -1, - 0, 0, 1, 0 - ); }); - }); - }); - - describe("perspectiveNO", () => { - it("should have an alias called 'perspective'", () => { expect(Mat4.perspectiveNO).toEqual(Mat4.perspective); }); - - let fovy = Math.PI * 0.5; - beforeEach(() => { result = Mat4.perspectiveNO(out, fovy, 1, 0, 1); }); - it("should place values into out", () => { expect(result).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, -1, -1, - 0, 0, 0, 0 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - - describe("with nonzero near, 45deg fovy, and realistic aspect ratio", () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, 200); }); - it("should calculate correct matrix", () => { expect(result).toBeVec( - 1.81066, 0, 0, 0, - 0, 2.414213, 0, 0, - 0, 0, -1.001, -1, - 0, 0, -0.2001, 0 - ); }); - }); - - describe("with no far plane, 45deg fovy, and realistic aspect ratio", () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1); }); - it("should calculate correct matrix", () => { expect(result).toBeVec( - 1.81066, 0, 0, 0, - 0, 2.414213, 0, 0, - 0, 0, -1, -1, - 0, 0, -0.2, 0 - ); }); - }); - - describe("with infinite far plane, 45deg fovy, and realistic aspect ratio", () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, Infinity); }); - it("should calculate correct matrix", () => { expect(result).toBeVec( - 1.81066, 0, 0, 0, - 0, 2.414213, 0, 0, - 0, 0, -1, -1, - 0, 0, -0.2, 0 - ); }); - }); - }); - - describe("orthoNO", () => { - it("should have an alias called 'ortho'", () => { expect(Mat4.orthoNO).toEqual(Mat4.ortho); }); - - beforeEach(() => { result = Mat4.orthoNO(out, -1, 1, -1, 1, -1, 1); }); - it("should place values into out", () => { expect(result).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, -1, 0, - 0, 0, 0, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("lookAt", () => { - let eye = new Float32Array([0, 0, 1]); - let center = new Float32Array([0, 0, -1]); - let up = new Float32Array([0, 1, 0]); - let view, right; - - describe("looking down", () => { - beforeEach(() => { - view = new Float32Array([0, -1, 0]); - up = new Float32Array([0, 0, -1]); - right= new Float32Array([1, 0, 0]); - result = Mat4.lookAt(out, [0, 0, 0], view, up); - }); - - it("should transform view into local -Z", () => { - result = Vec3.transformMat4(new Float32Array(3), view, out); - expect(result).toBeVec(0, 0, -1); - }); - - it("should transform up into local +Y", () => { - result = Vec3.transformMat4(new Float32Array(3), up, out); - expect(result).toBeVec(0, 1, 0); - }); - - it("should transform right into local +X", () => { - result = Vec3.transformMat4(new Float32Array(3), right, out); - expect(result).toBeVec(1, 0, 0); - }); - - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("#74", () => { - beforeEach(() => { - Mat4.lookAt(out, - new Float32Array([0,2,0]), - new Float32Array([0,0.6,0]), - new Float32Array([0,0,-1])); - }); - - it("should transform a point 'above' into local +Y", () => { - result = Vec3.transformMat4(new Float32Array(3), [0, 2, -1], out); - expect(result).toBeVec(0, 1, 0); - }); - - it("should transform a point 'right of' into local +X", () => { - result = Vec3.transformMat4(new Float32Array(3), [1, 2, 0], out); - expect(result).toBeVec(1, 0, 0); - }); - - it("should transform a point 'in front of' into local -Z", () => { - result = Vec3.transformMat4(new Float32Array(3), [0, 1, 0], out); - expect(result).toBeVec(0, 0, -1); - }); - }); - - beforeEach(() => { - eye = new Float32Array([0, 0, 1]); - center = new Float32Array([0, 0, -1]); - up = new Float32Array([0, 1, 0]); - result = Mat4.lookAt(out, eye, center, up); - }); - it("should place values into out", () => { expect(result).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, -1, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("targetTo", () => { - var eye = new Float32Array([0, 0, 1]); - var center = new Float32Array([0, 0, -1]); - var up = new Float32Array([0, 1, 0]); - var view, up, right; - - describe("looking down", () => { - beforeEach(() => { - view = new Float32Array([0, -1, 0]); - up = new Float32Array([0, 0, -1]); - right= new Float32Array([1, 0, 0]); - result = Mat4.targetTo(out, [0, 0, 0], view, up); - }); - - it("should transform view into local Z", () => { - result = Vec3.transformMat4(new Float32Array(3), view, out); - expect(result).toBeVec(0, 0, 1); - }); - - it("should transform up into local -Y", () => { - result = Vec3.transformMat4(new Float32Array(3), up, out); - expect(result).toBeVec(0, -1, 0); - }); - - it("should transform right into local +X", () => { - result = Vec3.transformMat4(new Float32Array(3), right, out); - expect(result).toBeVec(1, 0, 0); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("scaling should be [1, 1, 1]", () => { - var scaling = Mat4.getScaling(new Float32Array(3), out); - expect(scaling).toBeVec(1, 1, 1); - }); - }); - - describe("#74", () => { - beforeEach(() => { - Mat4.targetTo(out, - new Float32Array([0,2,0]), - new Float32Array([0,0.6,0]), - new Float32Array([0,0,-1])); - }); - - it("should transform a point 'above' into local +Y", () => { - result = Vec3.transformMat4(new Float32Array(3), [0, 2, -1], out); - expect(result).toBeVec(0, 1, -2); - }); - - it("should transform a point 'right of' into local +X", () => { - result = Vec3.transformMat4(new Float32Array(3), [1, 2, 0], out); - expect(result).toBeVec(1, 2, -2); - }); - - it("should transform a point 'in front of' into local -Z", () => { - result = Vec3.transformMat4(new Float32Array(3), [0, 1, 0], out); - expect(result).toBeVec(0, 2, -1); - }); - - it("scaling should be [1, 1, 1]", () => { - var scaling = Mat4.getScaling(new Float32Array(3), out); - expect(scaling).toBeVec(1, 1, 1); - }); - }); - - describe("scaling test", () => { - beforeEach(() => { - Mat4.targetTo(out, - new Float32Array([0,1,0]), - new Float32Array([0,0,1]), - new Float32Array([0,0,-1])); - }); - - it("scaling should be [1, 1, 1]", () => { - var scaling = Mat4.getScaling(new Float32Array(3), out); - expect(scaling).toBeVec(1, 1, 1); - }); - }); - - beforeEach(() => { - eye = new Float32Array([0, 0, 1]); - center = new Float32Array([0, 0, -1]); - up = new Float32Array([0, 1, 0]); - result = Mat4.targetTo(out, eye, center, up); - }); - it("should place values into out", () => { expect(result).toBeVec( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 1, 1 - ); - }); - it("should return out", () => { expect(result).toBe(out); }); - it("scaling should be [1, 1, 1]", () => { - var scaling = Mat4.getScaling(new Float32Array(3), out); - expect(scaling).toBeVec(1, 1, 1); - }); - }); - - describe("str", () => { - beforeEach(() => { result = Mat4.str(matA); }); - - it("should return a string representation of the matrix", () => { expect(result).toEqual("Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)"); }); - }); - - describe("frob", () => { - beforeEach(() => { result = Mat4.frob(matA); }); - it("should return the Frobenius Norm of the matrix", () => { expect(result).toBeCloseTo( Math.sqrt(Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) )); }); - }); - - describe("add", () => { - beforeEach(() => { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; - }); - describe("with a separate output matrix", () => { - beforeEach(() => { - result = Mat4.add(out, matA, matB); - }); - - it("should place values into out", () => { expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - it("should not modify matB", () => { expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.add(matA, matA, matB); }); - - it("should place values into matA", () => { expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48); }); - it("should return matA", () => { expect(result).toBe(matA); }); - it("should not modify matB", () => { expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); }); - }); - - describe("when matB is the output matrix", () => { - beforeEach(() => { result = Mat4.add(matB, matA, matB); }); - - it("should place values into matB", () => { expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48); }); - it("should return matB", () => { expect(result).toBe(matB); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - }); - }); - - describe("subtract", () => { - beforeEach(() => { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; - }); - it("should have an alias called 'sub'", () => { expect(Mat4.sub).toEqual(Mat4.subtract); }); - - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.subtract(out, matA, matB); }); - - it("should place values into out", () => { expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - it("should not modify matB", () => { expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.subtract(matA, matA, matB); }); - - it("should place values into matA", () => { expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16); }); - it("should return matA", () => { expect(result).toBe(matA); }); - it("should not modify matB", () => { expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); }); - }); - - describe("when matB is the output matrix", () => { - beforeEach(() => { result = Mat4.subtract(matB, matA, matB); }); - - it("should place values into matB", () => { expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16); }); - it("should return matB", () => { expect(result).toBe(matB); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - }); - }); - - describe("fromValues", () => { - beforeEach(() => { result = Mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - it("should return a 16 element array initialized to the values passed", () => { expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - }); - - describe("set", () => { - beforeEach(() => { result = Mat4.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("multiplyScalar", () => { - beforeEach(() => { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - }); - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.multiplyScalar(out, matA, 2); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.multiplyScalar(matA, matA, 2); }); - - it("should place values into matA", () => { expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32); }); - it("should return matA", () => { expect(result).toBe(matA); }); - }); - }); - - describe("multiplyScalarAndAdd", () => { - beforeEach(() => { - matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; - }); - describe("with a separate output matrix", () => { - beforeEach(() => { result = Mat4.multiplyScalarAndAdd(out, matA, matB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - it("should not modify matB", () => { expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); }); - }); - - describe("when matA is the output matrix", () => { - beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); - - it("should place values into matA", () => { expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32); }); - it("should return matA", () => { expect(result).toBe(matA); }); - it("should not modify matB", () => { expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32); }); - }); - - describe("when matB is the output matrix", () => { - beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); - - it("should place values into matB", () => { expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32); }); - it("should return matB", () => { expect(result).toBe(matB); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); - }); - }); - - describe("exactEquals", () => { - let matC, r0, r1; - beforeEach(() => { - matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; - matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; - matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - r0 = Mat4.exactEquals(matA, matB); - r1 = Mat4.exactEquals(matA, matC); - }); - - it("should return true for identical matrices", () => { expect(r0).toBe(true); }); - it("should return false for different matrices", () => { expect(r1).toBe(false); }); - it("should not modify matA", () => { expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); }); - it("should not modify matB", () => { expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); }); - }); - - describe("equals", () => { - let matC, matD, r0, r1, r2; - beforeEach(() => { - matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; - matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; - matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; - r0 = Mat4.equals(matA, matB); - r1 = Mat4.equals(matA, matC); - r2 = Mat4.equals(matA, matD); - }); - it("should return true for identical matrices", () => { expect(r0).toBe(true); }); - it("should return false for different matrices", () => { expect(r1).toBe(false); }); - it("should return true for close but not identical matrices", () => { expect(r2).toBe(true); }); - it("should not modify matA", () => { expect(matA).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); }); - it("should not modify matB", () => { expect(matB).toBeVec(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/quat.spec.ts b/tests/quat.spec.ts deleted file mode 100644 index 1cbd6985..00000000 --- a/tests/quat.spec.ts +++ /dev/null @@ -1,801 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Quat, QuatLike } from "../src/quat" -import { Vec3, Vec3Like } from "../src/vec3" -import "./test-utils" - -describe("Quat", () => { - describe("constructor", () => { - it("should return Quat(0, 0, 0, 1) if called with no arguments", () => { - expect(new Quat()).toBeVec(0, 0, 0, 1); - }); - - it("should return Quat(x, y, z, w) if called with (x, y, z, w)", () => { - expect(new Quat(1, 2, 3, 4)).toBeVec(1, 2, 3, 4); - expect(new Quat(-3, 4.4, -5.6, 7.8)).toBeVec(-3, 4.4, -5.6, 7.8); - }); - - it("should return Quat(x, x, x, x) if called with (x)", () => { - expect(new Quat(1)).toBeVec(1, 1, 1, 1); - expect(new Quat(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3); - }); - - it("should return Quat(x, y, z, w) if called with ([x, y, z, w])", () => { - expect(new Quat([1, 2, 3, 4])).toBeVec(1, 2, 3, 4); - expect(new Quat([-3, 4.4, -5.6, 7.8])).toBeVec(-3, 4.4, -5.6, 7.8); - }); - - it("should return Quat(x, y, z, w) if called with (Quat(x, y, z, w))", () => { - let v = new Quat(3.4, 5.6, 7.8, 9); - expect(new Quat(v)).toBeVec(v); - }); - - it("should return Quat(x, y, z, w) if called with (Float32Array([x, y, z, w]))", () => { - let arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); - expect(new Quat(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out: Quat - let quatA: Quat; - let quatB: Quat; - let result: any; - let vec: Vec3Like; - - const id = new Quat(0, 0, 0, 1); - const deg90 = Math.PI / 2; - - beforeEach(() => { - quatA = new Quat(1, 2, 3, 4); - quatB = new Quat(5, 6, 7, 8); - out = new Quat(0, 0, 0, 0); - vec = [1, 1, -1]; - }); - - describe("slerp", () => { - describe("the normal case", () => { - beforeEach(() => { - result = Quat.slerp(out, [0, 0, 0, 1], [0, 1, 0, 0], 0.5); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should calculate proper quat", () => { - expect(result).toBeVec(0, 0.707106, 0, 0.707106); - }); - }); - - describe("where a == b", () => { - beforeEach(() => { - result = Quat.slerp(out, [0, 0, 0, 1], [0, 0, 0, 1], 0.5); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should calculate proper quat", () => { - expect(result).toBeVec(0, 0, 0, 1); - }); - }); - - describe("where theta == 180deg", () => { - beforeEach(() => { - Quat.rotateX(quatA, [1,0,0,0], Math.PI); // 180 deg - result = Quat.slerp(out, [1,0,0,0], quatA, 1); - }); - - it("should calculate proper quat", () => { - expect(result).toBeVec(0,0,0,-1); - }); - }); - - describe("where a == -b", () => { - beforeEach(() => { - result = Quat.slerp(out, [1, 0, 0, 0], [-1, 0, 0, 0], 0.5); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should calculate proper quat", () => { - expect(result).toBeVec(1, 0, 0, 0); - }); - }); - }); - - describe("pow", () => { - describe("identity quat", () => { - beforeEach(() => { - result = Quat.pow(out, id, 2.1 /* random number */); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should be the identity", () => { - expect(result).toBeVec(id); - }); - }); - - describe("power of one", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - - result = Quat.pow(out, quatA, 1); - }); - - it("should be the identity", () => { - expect(result).toBeVec(quatA); - }); - it("should be normalized", () => { - expect(Quat.length(result)).toBeCloseTo(1); - }); - }); - - describe("squared", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - - result = Quat.pow(out, quatA, 2); - }); - - it("should be the square", () => { - let reference = Quat.multiply(Quat.create(), quatA, quatA); - expect(result).toBeVec(reference); - }); - it("should be normalized", () => { - expect(Quat.length(result)).toBeCloseTo(1); - }); - }); - - describe("conjugate", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - - result = Quat.pow(out, quatA, -1); - }); - - it("should be the conjugate", () => { - let reference = Quat.conjugate(Quat.create(), quatA); - expect(result).toBeVec(reference); - }); - it("should be normalized", () => { - expect(Quat.length(result)).toBeCloseTo(1); - }); - }); - - describe("reversible", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - - let b = 2.1; // random number - result = Quat.pow(out, quatA, b); - result = Quat.pow(out, result, 1/b); - }); - - it("should be reverted", () => { - expect(result).toBeVec(quatA); - }); - it("should be normalized", () => { - expect(Quat.length(result)).toBeCloseTo(1); - }); - }); - }); - - describe("rotateX", () => { - beforeEach(() => { - result = Quat.rotateX(out, id, deg90); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should transform vec accordingly", () => { - Vec3.transformQuat(vec, [0,0,-1], out); - expect(vec).toBeVec(0, 1, 0); - }); - }); - - describe("rotateY", () => { - beforeEach(() => { - result = Quat.rotateY(out, id, deg90); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should transform vec accordingly", () => { - Vec3.transformQuat(vec, [0,0,-1], out); - expect(vec).toBeVec(-1, 0, 0); - }); - }); - - describe("rotateZ", () => { - beforeEach(() => { - result = Quat.rotateZ(out, id, deg90); - }); - - it("should return out", () => { expect(result).toBe(out); }); - it("should transform vec accordingly", () => { - Vec3.transformQuat(vec, [0,1,0], out); - expect(vec).toBeVec(-1, 0, 0); - }); - }); - - /*describe("fromMat3", () => { - let matr; - - describe("legacy", () => { - beforeEach(() => { - matr = [ 1, 0, 0, - 0, 0, -1, - 0, 1, 0 ]; - result = Quat.fromMat3(out, matr); - }); - - it("should set dest to the correct value", () => { - expect(result).toBeVec(-0.707106, 0, 0, 0.707106); - }); - }); - - describe("where trace > 0", () => { - beforeEach(() => { - matr = [ 1, 0, 0, - 0, 0, -1, - 0, 1, 0 ]; - result = Quat.fromMat3(out, matr); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("should produce the correct transformation", () => { - expect(Vec3.transformQuat([], [0,1,0], out)).toBeVec(0,0,-1); - }); - }); - - describe("from a normal matrix looking 'backward'", () => { - beforeEach(() => { - matr = mat3.create(); - mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt(mat4.create(), [0, 0, 0], [0, 0, 1], [0, 1, 0])))); - result = Quat.fromMat3(out, matr); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("should produce the same transformation as the given matrix", () => { - expect(Vec3.transformQuat([], [3,2,-1], Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr)); - }); - }); - - describe("from a normal matrix looking 'left' and 'upside down'", () => { - beforeEach(() => { - matr = mat3.create(); - mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt(mat4.create(), [0, 0, 0], [-1, 0, 0], [0, -1, 0])))); - result = Quat.fromMat3(out, matr); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("should produce the same transformation as the given matrix", () => { - expect(Vec3.transformQuat([], [3,2,-1], Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr)); - }); - }); - - describe("from a normal matrix looking 'upside down'", () => { - beforeEach(() => { - matr = mat3.create(); - mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt(mat4.create(), [0, 0, 0], [0, 0, -1], [0, -1, 0])))); - result = Quat.fromMat3(out, matr); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("should produce the same transformation as the given matrix", () => { - expect(Vec3.transformQuat([], [3,2,-1], Quat.normalize(out, out))).toBeEqualish(Vec3.transformMat3([], [3,2,-1], matr)); - }); - }); - });*/ - - describe("fromEuler", () => { - describe("legacy", () => { - beforeEach(() => { - result = Quat.fromEuler(out, -90, 0, 0); - }); - - it("should set dest to the correct value", () => { - expect(result).toBeVec(-0.707106, 0, 0, 0.707106); - }); - }); - - describe("where trace > 0", () => { - beforeEach(() => { - result = Quat.fromEuler(out, -90, 0, 0); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("should produce the correct transformation", () => { - expect(Vec3.transformQuat([], [0,1,0], out)).toBeVec(0,0,-1); - }); - }); - }); - - /*describe("setAxes", () => { - let r; - beforeEach(() => { r = Vec3.create(); }); - - describe("looking left", () => { - let view, up, right; - beforeEach(() => { - view = [-1, 0, 0]; - up = [ 0, 1, 0]; - right= [ 0, 0,-1]; - result = Quat.setAxes([], view, right, up); - }); - - it("should transform local view into world left", () => { - r = Vec3.transformQuat([], [0,0,-1], result); - expect(r).toBeVec(1, 0, 0); - }); - - it("should transform local right into world front", () => { - r = Vec3.transformQuat([], [1,0,0], result); - expect(r).toBeVec(0, 0, 1); - }); - }); - - describe("given opengl defaults", () => { - let view, up, right; - beforeEach(() => { - view = [0, 0, -1]; - up = [0, 1, 0]; - right= [1, 0, 0]; - result = Quat.setAxes(out, view, right, up); - }); - - it("should return out", () => { - expect(result).toBe(out); - }); - - it("should produce identity", () => { - expect(out).toBeVec(0, 0, 0, 1); - }); - }); - - describe("legacy example", () => { - let view, up, right; - beforeEach(() => { - right= [1, 0, 0]; - up = [0, 0, 1]; - view = [0, -1, 0]; - result = Quat.setAxes(out, view, right, up); - }); - - xit("should set correct quat4 values", () => { - expect(result).toBeVec(0.707106, 0, 0, 0.707106); - }); - }); - });*/ - - describe("rotationTo", () => { - let r; - beforeEach(() => { r = Vec3.create(); }); - - describe("at right angle", () => { - beforeEach(() => { - result = Quat.rotationTo(out, [0, 1, 0], [1, 0, 0]); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("should calculate proper quaternion", () => { - expect(out).toBeVec(0, 0, -0.707106, 0.707106); - }); - }); - - describe("when vectors are parallel", () => { - beforeEach(() => { - result = Quat.rotationTo(out, [0, 1, 0], [0, 1, 0]); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("multiplying A should produce B", () => { - expect(Vec3.transformQuat(r, [0, 1, 0], out)).toBeVec(0, 1, 0); - }); - }); - - describe("when vectors are opposed X", () => { - beforeEach(() => { - result = Quat.rotationTo(out, [1, 0, 0], [-1, 0, 0]); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("multiplying A should produce B", () => { - expect(Vec3.transformQuat(r, [1, 0, 0], out)).toBeVec(-1, 0, 0); - }); - }); - - describe("when vectors are opposed Y", () => { - beforeEach(() => { - result = Quat.rotationTo(out, [0, 1, 0], [0, -1, 0]); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("multiplying A should produce B", () => { - expect(Vec3.transformQuat(r, [0, 1, 0], out)).toBeVec(0, -1, 0); - }); - }); - - describe("when vectors are opposed Z", () => { - beforeEach(() => { - result = Quat.rotationTo(out, [0, 0, 1], [0, 0, -1]); - }); - - it("should return out", () => { expect(result).toBe(out); }); - - it("multiplying A should produce B", () => { - expect(Vec3.transformQuat(r, [0, 0, 1], out)).toBeVec(0, 0, -1); - }); - }); - }); - - describe("create", () => { - beforeEach(() => { result = Quat.create(); }); - it("should return a 4 element array initialized to an identity quaternion", () => { expect(result).toBeVec(0, 0, 0, 1); }); - }); - - describe("clone", () => { - beforeEach(() => { result = Quat.clone(quatA); }); - it("should return a 4 element array initialized to the values in quatA", () => { expect(result).toBeVec(quatA); }); - }); - - describe("fromValues", () => { - beforeEach(() => { result = Quat.fromValues(1, 2, 3, 4); }); - it("should return a 4 element array initialized to the values passed", () => { expect(result).toBeVec(1, 2, 3, 4); }); - }); - - describe("copy", () => { - beforeEach(() => { result = Quat.copy(out, quatA); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("set", () => { - beforeEach(() => { result = Quat.set(out, 1, 2, 3, 4); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("identity", () => { - beforeEach(() => { result = Quat.identity(out); }); - it("should place values into out", () => { expect(result).toBeVec(0, 0, 0, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("setAxisAngle", () => { - beforeEach(() => { result = Quat.setAxisAngle(out, [1, 0, 0], Math.PI * 0.5); }); - it("should place values into out", () => { expect(result).toBeVec(0.707106, 0, 0, 0.707106); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("getAxisAngle", () => { - let angle: number; - describe("for a quaternion representing no rotation", () => { - beforeEach(() => { result = Quat.setAxisAngle(out, [0, 1, 0], 0.0); angle = Quat.getAxisAngle(vec, out); }); - it("should return a multiple of 2*PI as the angle component", () => { expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0); }); - }); - - describe("for a simple rotation about X axis", () => { - beforeEach(() => { result = Quat.setAxisAngle(out, [1, 0, 0], 0.7778); angle = Quat.getAxisAngle(vec, out); }); - it("should return the same provided angle", () => { expect(angle).toBeCloseTo(0.7778); }); - it("should return the X axis as the angle", () => { expect(vec).toBeVec(1, 0, 0); }); - }); - - describe("for a simple rotation about Y axis", () => { - beforeEach(() => { result = Quat.setAxisAngle(out, [0, 1, 0], 0.879546); angle = Quat.getAxisAngle(vec, out); }); - it("should return the same provided angle", () => { expect(angle).toBeCloseTo(0.879546); }); - it("should return the X axis as the angle", () => { expect(vec).toBeVec(0, 1, 0); }); - }); - - describe("for a simple rotation about Z axis", () => { - beforeEach(() => { result = Quat.setAxisAngle(out, [0, 0, 1], 0.123456); angle = Quat.getAxisAngle(vec, out); }); - it("should return the same provided angle", () => { expect(angle).toBeCloseTo(0.123456); }); - it("should return the X axis as the angle", () => { expect(vec).toBeVec(0, 0, 1); }); - }); - - describe("for a slightly irregular axis and right angle", () => { - beforeEach(() => { result = Quat.setAxisAngle(out, [0.707106, 0, 0.707106], Math.PI * 0.5); angle = Quat.getAxisAngle(vec, out); }); - it("should place values into vec", () => { expect(vec).toBeVec(0.707106, 0, 0.707106); }); - it("should return a numeric angle", () => { expect(angle).toBeCloseTo(Math.PI * 0.5); }); - }); - - describe("for a very irregular axis and negative input angle", () => { - beforeEach(() => { - quatA = Quat.setAxisAngle(quatA, [0.65538555, 0.49153915, 0.57346237], 8.8888); - angle = Quat.getAxisAngle(vec, quatA); - quatB = Quat.setAxisAngle(quatB, vec, angle); - }); - it("should return an angle between 0 and 2*PI", () => { expect(angle).toBeGreaterThan(0.0); expect(angle).toBeLessThan(Math.PI * 2.0); }); - it("should create the same quaternion from axis and angle extracted", () => { expect(quatA).toBeVec(quatB); }); - }); - }); - - describe("getAngle", () => { - describe("from itself", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - }); - - it("should be zero", () => { - expect(Quat.getAngle(quatA, quatA)).toBeCloseTo(0); - }); - }); - - describe("from rotated", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - Quat.rotateX(quatB, quatA, Math.PI / 4); - }); - - it("should be 45 degrees", () => { - expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(Math.PI / 4); - }); - }); - - describe("compare with axisAngle", () => { - beforeEach(() => { - Quat.normalize(quatA, quatA); - Quat.normalize(quatB, quatB); - }); - - it("should be equalish", () => { - // compute reference value as axisAngle of quatA^{-1} * quatB - let quatAInv = Quat.conjugate(Quat.create(), quatA); - let quatAB = Quat.multiply(quatAInv, quatAInv, quatB); - let dummy = Vec3.create(); - let reference = Quat.getAxisAngle(dummy, quatAB); - - expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(reference); - }); - }); - }); - - describe("add", () => { - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.add(out, quatA, quatB); }); - - it("should place values into out", () => { expect(out).toBeVec(6, 8, 10, 12); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.add(quatA, quatA, quatB); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(6, 8, 10, 12); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatB is the output quaternion", () => { - beforeEach(() => { result = Quat.add(quatB, quatA, quatB); }); - - it("should place values into quatB", () => { expect(quatB).toBeVec(6, 8, 10, 12); }); - it("should return quatB", () => { expect(result).toBe(quatB); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("multiply", () => { - it("should have an alias called 'mul'", () => { expect(Quat.mul).toEqual(Quat.multiply); }); - - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.multiply(out, quatA, quatB); }); - - it("should place values into out", () => { expect(out).toBeVec(24, 48, 48, -6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.multiply(quatA, quatA, quatB); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(24, 48, 48, -6); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatB is the output quaternion", () => { - beforeEach(() => { result = Quat.multiply(quatB, quatA, quatB); }); - - it("should place values into quatB", () => { expect(quatB).toBeVec(24, 48, 48, -6); }); - it("should return quatB", () => { expect(result).toBe(quatB); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("scale", () => { - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.scale(out, quatA, 2); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 4, 6, 8); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.scale(quatA, quatA, 2); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(2, 4, 6, 8); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - }); - }); - - describe("length", () => { - it("should have an alias called 'len'", () => { expect(Quat.len).toEqual(Quat.length); }); - - beforeEach(() => { result = Quat.len(quatA); }); - - it("should return the length", () => { expect(result).toBeCloseTo(5.477225); }); - }); - - describe("squaredLength", () => { - it("should have an alias called 'sqrLen'", () => { expect(Quat.sqrLen).toEqual(Quat.squaredLength); }); - - beforeEach(() => { result = Quat.squaredLength(quatA); }); - - it("should return the squared length", () => { expect(result).toEqual(30); }); - }); - - describe("normalize", () => { - beforeEach(() => { quatA = [5, 0, 0, 0]; }); - - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.normalize(out, quatA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 0, 0, 0); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(5, 0, 0, 0); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.normalize(quatA, quatA); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(1, 0, 0, 0); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - }); - }); - - describe("lerp", () => { - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.lerp(out, quatA, quatB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4, 5, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.lerp(quatA, quatA, quatB, 0.5); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(3, 4, 5, 6); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatB is the output quaternion", () => { - beforeEach(() => { result = Quat.lerp(quatB, quatA, quatB, 0.5); }); - - it("should place values into quatB", () => { expect(quatB).toBeVec(3, 4, 5, 6); }); - it("should return quatB", () => { expect(result).toBe(quatB); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("slerp", () => { - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.slerp(out, quatA, quatB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4, 5, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.slerp(quatA, quatA, quatB, 0.5); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(3, 4, 5, 6); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when quatB is the output quaternion", () => { - beforeEach(() => { result = Quat.slerp(quatB, quatA, quatB, 0.5); }); - - it("should place values into quatB", () => { expect(quatB).toBeVec(3, 4, 5, 6); }); - it("should return quatB", () => { expect(result).toBe(quatB); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - }); - - /*describe("random", () => { - beforeEach(() => { result = Quat.random(out); }); - - it("should result in a normalized quaternion", () => { - let copy = Quat.clone(out); - expect(Quat.normalize(out, out)).toBeVec(copy); - }); - it("should return out", () => { expect(result).toBe(out); }); - });*/ - - describe("invert", () => { - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.invert(out, quatA); }); - - it("should place values into out", () => { expect(out).toBeVec(-0.033333, -0.066666, -0.1, 0.133333); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.invert(quatA, quatA); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(-0.033333, -0.066666, -0.1, 0.133333); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - }); - }); - - describe("conjugate", () => { - describe("with a separate output quaternion", () => { - beforeEach(() => { result = Quat.conjugate(out, quatA); }); - - it("should place values into out", () => { expect(out).toBeVec(-1, -2, -3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when quatA is the output quaternion", () => { - beforeEach(() => { result = Quat.conjugate(quatA, quatA); }); - - it("should place values into quatA", () => { expect(quatA).toBeVec(-1, -2, -3, 4); }); - it("should return quatA", () => { expect(result).toBe(quatA); }); - }); - }); - - describe("str", () => { - beforeEach(() => { result = Quat.str(quatA); }); - - it("should return a string representation of the quaternion", () => { expect(result).toEqual("Quat(1, 2, 3, 4)"); }); - }); - - describe("exactEquals", () => { - let quatC, r0, r1; - beforeEach(() => { - quatA = [0, 1, 2, 3]; - quatB = [0, 1, 2, 3]; - quatC = [1, 2, 3, 4]; - r0 = Quat.exactEquals(quatA, quatB); - r1 = Quat.exactEquals(quatA, quatC); - }); - - it("should return true for identical quaternions", () => { expect(r0).toBe(true); }); - it("should return false for different quaternions", () => { expect(r1).toBe(false); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(0, 1, 2, 3); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(0, 1, 2, 3); }); - }); - - describe("equals", () => { - let quatC, quatD, r0, r1, r2; - beforeEach(() => { - quatA = [0, 1, 2, 3]; - quatB = [0, 1, 2, 3]; - quatC = [1, 2, 3, 4]; - quatD = [1e-16, 1, 2, 3]; - r0 = Quat.equals(quatA, quatB); - r1 = Quat.equals(quatA, quatC); - r2 = Quat.equals(quatA, quatD); - }); - it("should return true for identical quaternions", () => { expect(r0).toBe(true); }); - it("should return false for different quaternions", () => { expect(r1).toBe(false); }); - it("should return true for close but not identical quaternions", () => { expect(r2).toBe(true); }); - it("should not modify quatA", () => { expect(quatA).toBeVec(0, 1, 2, 3); }); - it("should not modify quatB", () => { expect(quatB).toBeVec(0, 1, 2, 3); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/quat2.spec.ts b/tests/quat2.spec.ts deleted file mode 100644 index c959e724..00000000 --- a/tests/quat2.spec.ts +++ /dev/null @@ -1,759 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Quat2, Quat2Like } from "../src/quat2" -import "./test-utils" -import { Vec3, Vec3Like } from '../src/vec3'; -import { Quat, QuatLike } from '../src/quat'; -import { Mat4 } from '../src/mat4'; - -describe("Quat2", () => { - describe("constructor", () => { - it("should return Quat2(0, 0, 0, 1, 0, 0, 0, 0) if called with no arguments", () => { - expect(new Quat2()).toBeVec(0, 0, 0, 1, 0, 0, 0, 0); - }); - - it("should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (x, y, z, w, x2, y2, z2, w2)", () => { - expect(new Quat2(1, 2, 3, 4, 5, 6, 7, 8)).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); - }); - - it("should return Quat(x, x, x, x, x, x, x, x) if called with (x)", () => { - expect(new Quat2(1)).toBeVec(1, 1, 1, 1, 1, 1, 1, 1); - expect(new Quat2(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3, -2.3, -2.3, -2.3, -2.3); - }); - - it("should return Quat(x, y, z, w) if called with ([x, y, z, w])", () => { - expect(new Quat2([1, 2, 3, 4, 5, 6, 7, 8])).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); - }); - - it("should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Quat(x, y, z, w, x2, y2, z2, w2))", () => { - let v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2(v)).toBeVec(v); - }); - - it("should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float32Array([x, y, z, w, x2, y2, z2, w2]))", () => { - let arr = new Float32Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); - expect(new Quat2(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out: Quat2; - let outVec: Vec3; - let quat2A: Quat2Like; - let quat2B: Quat2Like; - let result: any; - let resultVec: Vec3Like; - let outQuat: QuatLike; - let vec: Vec3Like; - - beforeEach(function() { - quat2A = new Quat2(1, 2, 3, 4, 2, 5, 6, -2); - quat2B = new Quat2(5, 6, 7, 8, 9, 8, 6, -4); - out = new Quat2(); - outVec = new Vec3(); - outQuat = new Quat(); - vec = new Vec3(1, 1, -1); - }); - - describe("translate", function() { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); - beforeEach(function() { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); - Quat2.normalize(quat2A, quat2A); - Mat4.fromQuat2(matrixA, quat2A); - }); - - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.translate(out, quat2A, vec); - //Same thing with a matrix - Mat4.translate(matOut, matrixA, vec); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(quatOut); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(quat2B); }); - it("should not modify vec", function() { expect(vec).toBeVec(1,1,-1); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { - result = Quat2.translate(quat2A, quat2A, vec); - //Same thing with a matrix - Mat4.translate(matOut, matrixA, vec); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(quatOut); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - }); - - describe("rotateAroundAxis", function() { - let matrixA = new Mat4(); - let matOut = new Mat4(); - let ax: Vec3Like = [1,4,2]; - beforeEach(function() { - //quat2A only seems to work when created using this function? - Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); - Quat2.normalize(quat2A, quat2A); - Mat4.fromQuat2(matrixA, quat2A); - }); - - - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateAroundAxis(out, quat2A, ax, 5); - - //Same thing with a matrix - Mat4.rotate(matOut, matrixA, 5, ax); - Quat2.fromMat4(quat2B, matOut); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(quat2B); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2( - 0.18257418583505536, 0.3651483716701107, 0.5477225575051661, 0.7302967433402214, - -2.556038601690775, 3.742770809618635, 2.37346441585572, -3.0124740662784135 - ); }); - it("should not modify ax", function() { expect(ax).toBeVec(1, 4, 2); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateAroundAxis(quat2A, quat2A, ax, 5); - //Same thing with a matrix - - Mat4.rotate(matOut, matrixA, 5, ax); - Quat2.fromMat4(quat2B, matOut); - }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(quat2B); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - it("should not modify ax", function() { expect(ax).toBeVec(1, 4, 2); }); - }); - }); - - describe("rotateByQuatAppend", function() { - let correctResult = Quat2.create(); - let rotationQuat = Quat2.create(); - beforeEach(function() { - rotationQuat[0] = 2; - rotationQuat[1] = 5; - rotationQuat[2] = 2; - rotationQuat[3] = -10; - Quat2.multiply(correctResult, quat2A, rotationQuat); - }) - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateByQuatAppend(out, quat2A, [2, 5, 2, -10]); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(correctResult); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should not modify the rotation quaternion", function() { expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { result = Quat2.rotateByQuatAppend(quat2A, quat2A, [2, 5, 2, -10]); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(correctResult); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - it("should not modify the rotation quaternion", function() { expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0); }); - }); - }); - - describe("rotateByQuatPrepend", function() { - let correctResult = Quat2.create(); - let rotationQuat = Quat2.create(); - beforeEach(function() { - rotationQuat[0] = 2; - rotationQuat[1] = 5; - rotationQuat[2] = 2; - rotationQuat[3] = -10; - Quat2.multiply(correctResult, rotationQuat, quat2A); - }) - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateByQuatPrepend(out, Quat2.getReal(outQuat, rotationQuat), quat2A); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(correctResult); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should not modify the rotation quaternion", function() { expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { result = Quat2.rotateByQuatPrepend(quat2A, Quat2.getReal(outQuat, rotationQuat), quat2A); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(correctResult); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - it("should not modify the rotation quaternion", function() { expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0); }); - }); - }); - - describe("rotateX", function() { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); - beforeEach(function() { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]) as Quat2; - Quat2.normalize(quat2A, quat2A); - Mat4.fromQuat2(matrixA, quat2A); - }); - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateX(out, quat2A, 5); - //Same thing with a matrix - Mat4.rotateX(matOut, matrixA, 5); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(quatOut); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(quat2B); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateX(quat2A, quat2A, 5); - //Same thing with a matrix - Mat4.rotateX(matOut, matrixA, 5); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(quatOut); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - }); - - describe("rotateY", function() { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); - beforeEach(function() { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [5, 4, -10]) as Quat2; - Quat2.normalize(quat2A, quat2A); - Mat4.fromQuat2(matrixA, quat2A); - }); - - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateY(out, quat2A, -2); - //Same thing with a matrix - Mat4.rotateY(matOut, matrixA, -2); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(quatOut); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(quat2B); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateY(quat2A, quat2A, -2); - //Same thing with a matrix - Mat4.rotateY(matOut, matrixA, -2); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(quatOut); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - }); - - describe("rotateZ", function() { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); - beforeEach(function() { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,0,3,-4], [0, -4, -10]) as Quat2; - Quat2.normalize(quat2A, quat2A); - Mat4.fromQuat2(matrixA, quat2A); - }); - describe("with a separate output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateZ(out, quat2A, 1); - //Same thing with a matrix - Mat4.rotateZ(matOut, matrixA, 1); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into out", function() { expect(out).toBeQuat2(quatOut); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(quat2B); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { - result = Quat2.rotateZ(quat2A, quat2A, 1); - //Same thing with a matrix - Mat4.rotateZ(matOut, matrixA, 1); - Quat2.fromMat4(quatOut, matOut); - }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(quatOut); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - }); - - describe("from/toMat4", function() { - let matRes = Mat4.create(), matOut = Mat4.create(); - let rotationQuat = Quat.create(); - describe("quat to matrix and back", function() { - beforeEach(function() { - Quat.normalize(rotationQuat, [1,2,3,4]); - - Quat2.fromRotationTranslation(quat2A, rotationQuat, [1,-5,3]); - matRes = Mat4.fromQuat2(matOut, quat2A) as Mat4; - - result = Quat2.fromMat4(out, matRes); - }); - - it("should return out", function() { expect(result).toBe(out); }); - it("should return matOut", function() { expect(matRes).toBe(matOut); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(0.18257418, 0.36514836, 0.54772257, 0.73029673, -1.5518806, -1.82574184, 1.73445473, 0 ); }); - - it("should be equal to the starting dual quat", function() { - expect(quat2A).toBeQuat2(result); - }); - - }); - }); - - describe("create", function() { - beforeEach(function() { result = Quat2.create(); }); - it("should return 2 4 element arrays initialized to an identity dual quaternion", function() { expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0); }); - }); - - describe("clone", function() { - beforeEach(function() { result = Quat2.clone(quat2A); }); - it("should return 2 4 element arrays initialized to the values in quat2A", function() { expect(result).toBeQuat2(quat2A); }); - }); - - describe("fromValues", function() { - beforeEach(function() { result = Quat2.fromValues(1, 2, 3, 4, 5, 7, 8, -2); }); - it("should return 2 4 element arrays initialized to the values passedd to the values passed", function() { - expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2); - }); - }); - - describe("copy", function() { - beforeEach(function() { result = Quat2.copy(out, quat2A); }); - it("should place values into out", function() { expect(out).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("set", function() { - beforeEach(function() { result = Quat2.set(out, 1, 2, 3, 4, 2, 5, 6, -2); }); - it("should place values into out", function() { expect(out).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("identity", function() { - beforeEach(function() { result = Quat2.identity(out); }); - it("should place values into out", function() { expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0); }); - it("should return out", function() { expect(result).toBe(out); }); - }); - - describe("add", function() { - describe("with a separate output dual quaternion", function() { - beforeEach(function() { result = Quat2.add(out, quat2A, quat2B); }); - - it("should place values into out", function() { expect(out).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4); }); - }); - - describe("when quat2A is the output dual quaternion", function() { - beforeEach(function() { result = Quat2.add(quat2A, quat2A, quat2B); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)}); - }); - - describe("when quat2B is the output dual quaternion", function() { - beforeEach(function() { result = Quat2.add(quat2B, quat2A, quat2B); }); - - it("should place values into quat2B", function() { expect(quat2B).toBeQuat2(6, 8, 10, 12, 11, 13, 12, -6); }); - it("should return quat2B", function() { expect(result).toBe(quat2B); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - }); - - describe("multiply", function() { - it("should have an alias called 'mul'", function() { expect(Quat2.mul).toEqual(Quat2.multiply); }); - - describe("with a separate output quaternion", function() { - beforeEach(function() { result = Quat2.multiply(out, quat2A, quat2B); }); - - it("should place values into out", function() { expect(out).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { result = Quat2.multiply(quat2A, quat2A, quat2B); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157 ); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4); }); - }); - - describe("when quat2B is the output quaternion", function() { - beforeEach(function() { result = Quat2.multiply(quat2B, quat2A, quat2B); }); - - it("should place values into quat2B", function() { expect(quat2B).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157); }); - it("should return quat2B", function() { expect(result).toBe(quat2B); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - - describe("same as matrix multiplication", function() { - let matrixA = Mat4.create(), matrixB = Mat4.create(); - let matOut = Mat4.create(), quatOut = Quat2.create(); - beforeEach(function() { - //quat2A and quat2B only seem to work when created using this function? - Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); - Quat2.normalize(quat2A, quat2A); - Mat4.fromQuat2(matrixA, quat2A); - - Quat2.fromRotationTranslation(quat2B, [5, 6, 7, 8], [9, 8, 6]); - Quat2.normalize(quat2B, quat2B); - Mat4.fromQuat2(matrixB, quat2B); - - }); - it("the matrices should be equal to the dual quaternions", function() { - let testQuat = Quat2.create(); - Quat2.fromMat4(testQuat, matrixA); - expect(testQuat).toBeQuat2(...quat2A); - - Quat2.fromMat4(testQuat, matrixB); - expect(testQuat).toBeQuat2(...quat2B); - }); - - it("should be equal to the matrix multiplication", function() { - Quat2.multiply(out, quat2A, quat2B); - Mat4.mul(matOut, matrixA, matrixB); - Quat2.fromMat4(quatOut, matOut); - expect(out).toBeQuat2(quatOut); - }); - - }); - }); - - describe("scale", function() { - describe("with a separate output dual quaternion", function() { - beforeEach(function() { result = Quat2.scale(out, quat2A, 2); }); - it("should place values into out", function() { expect(out).toBeQuat2(2, 4, 6, 8, 4, 10, 12, -4); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - - describe("when quat2A is the output dual quaternion", function() { - beforeEach(function() { result = Quat2.scale(quat2A, quat2A, 2); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(2, 4, 6, 8, 4, 10, 12, -4); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - }); - - describe("length", function() { - it("should have an alias called 'len'", function() { expect(Quat2.len).toEqual(Quat2.length); }); - - beforeEach(function() { result = Quat2.length(quat2A); }); - - it("should return the length", function() { expect(result).toBeCloseTo(5.477225); }); - }); - - describe("squaredLength", function() { - it("should have an alias called 'sqrLen'", function() { expect(Quat2.sqrLen).toEqual(Quat2.squaredLength); }); - - beforeEach(function() { result = Quat2.squaredLength(quat2A); }); - - it("should return the squared length", function() { expect(result).toBeCloseTo(30); }); - }); - - describe("fromRotation", function() { - beforeEach(function() { result = Quat2.fromRotation(out, [1, 2, 3, 4]); }); - it("should place values into out", function() { expect(out).toBeQuat2(1, 2, 3, 4, 0, 0, 0, 0); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify the quaternion", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - - describe("fromTranslation", function(){ - beforeEach(function() { vec = [1, 2, 3]; result = Quat2.fromTranslation(out, vec); }); - it("should place values into out", function() { expect(out).toBeQuat2(0, 0, 0, 1, 0.5, 1, 1.5, 0); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify the vector", function() { expect(vec).toBeVec(1, 2, 3); }); - }); - - describe("fromRotationTranslation", function() { - beforeEach(function() { - vec = [1, 2, 3]; - result = Quat2.fromRotationTranslation(out, [1, 2, 3, 4], vec); - }); - it("should place values into out", function() { expect(out).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify the quaternion", function() { expect(Quat2.getReal(outQuat, quat2A)).toBeVec(1, 2, 3, 4); }); - it("should not modify the vector", function() { expect(vec).toBeVec(1, 2, 3); }); - it("should have a translation that can be retrieved with getTranslation", function() { - let t: Vec3Like = [0, 0, 0]; - Quat2.normalize(out, out); - Quat2.getTranslation(t, out); - - expect(t).toBeVec(1, 2, 3); - }); - }); - - describe("fromRotationTranslationValues", function() { - beforeEach(function() { result = Quat2.fromRotationTranslationValues(1,2,3,4, 1,2,3); }); - it("should return the correct result", function() { expect(result).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7); }); - it("should have a translation that can be retrieved with getTranslation", function() { - let t: Vec3Like = [0, 0, 0]; - Quat2.normalize(result, result); - Quat2.getTranslation(t, result); - expect(t).toBeVec(1, 2, 3); - }); - }); - - describe("getTranslation", function() { - describe("without a real part", function() { - beforeEach(function() { - Quat2.fromTranslation(out, [1,2,3]); - resultVec = Quat2.getTranslation(outVec, out); - }); - describe("not normalized", function() { - it("should return the same translation value", function() { expect(outVec).toBeVec(1, 2, 3); }); - it("should return out", function() { expect(outVec).toBe(resultVec); }); - }); - describe("normalized", function() { - it("should return the same translation value", function() { - Quat2.normalize(outVec, outVec); - expect(outVec).toBeVec(1, 2, 3); - }); - }); - }); - describe("with a real part", function() { - beforeEach(function() { - Quat2.fromRotationTranslation(out, [2, 4, 6, 2], [1, 2, 3]); - resultVec = Quat2.getTranslation(outVec, out); - }); - describe("not normalized", function() { - it("should not return the same translation value", function() { expect(outVec).not.toBeVec(1, 2, 3); }); - it("should return out", function() { expect(outVec).toBe(resultVec); }); - }); - describe("normalized", function() { - it("should return the same translation value", function() { - Quat2.normalize(out, out); - Quat2.getTranslation(outVec, out); - expect(outVec).toBeVec(1, 2, 3); - }); - }); - }); - }); - - describe("normalize", function() { - describe("when it is normalizing quat2A", function() { - beforeEach(function() { - quat2A = [1, 2, 3, 4, 2, 5, 6, -2]; - Quat2.normalize(out, quat2A); - }); - it("both parts should have been normalized", function() { expect(out).toBeQuat2(1/5.4772255, 2/5.4772255, 3/5.4772255, 4/5.4772255, 0.231260, 0.6450954, 0.693781,-0.9006993); }); - }); - - beforeEach(function() { quat2A = [5, 0, 0, 0, 0, 0, 0, 0]; }); - - describe("with a separate output quaternion", function() { - beforeEach(function() { result = Quat2.normalize(out, quat2A); }); - - it("should place values into out", function() { expect(out).toBeQuat2(1, 0, 0, 0, 0, 0, 0, 0); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(5, 0, 0, 0, 0, 0, 0, 0); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { result = Quat2.normalize(quat2A, quat2A); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(1, 0, 0, 0, 0, 0, 0, 0); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - - describe("when it contains a translation", function() { - beforeEach(function() { - Quat2.set(out, 5, 0, 0, 0, 1, 2, 3, 5); - Quat2.normalize(out, out); - }); - it("both parts should have been normalized", function() { expect(out).toBeQuat2(1, 0, 0, 0, 0, 0.4, 0.6, 1); }); - }); - }); - - describe("lerp", function() { - describe("with a separate output quaternion", function() { - beforeEach(function() { result = Quat2.lerp(out, quat2A, quat2B, 0.7); }); - - it("should place values into out", function() { expect(out).toBeQuat2(3.8, 4.8, 5.8, 6.8, 6.9, 7.1, 6.0, -3.4); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4); }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { result = Quat2.lerp(quat2A, quat2A, quat2B, 0.5); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4); }); - }); - - describe("when quat2B is the output quaternion", function() { - beforeEach(function() { result = Quat2.lerp(quat2B, quat2A, quat2B, 0.5); }); - - it("should place values into quat2B", function() { expect(quat2B).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3); }); - it("should return quat2B", function() { expect(result).toBe(quat2B); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - - describe("shortest path", function() { - beforeEach(function() { result = Quat2.lerp(out, [1, 2, 3, -4, 2, 5, 6, -2], [5, -6, 7, 8, 9, 8, 6, -4], 0.4); }); - it("should pick the shorter path", function() { expect(out).toBeQuat2( -1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4 ); }); - }); - }); - - describe("dot", function() { - describe("with a separate output dual quaternion", function() { - beforeEach(function() { result = Quat2.dot(quat2A, quat2B); }); - it("should return the dot product", function() { expect(result).toBe(70); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("should not modify quat2B", function() { expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4); }); - }); - }); - - describe("invert", function() { - describe("with a separate output dual quaternion", function() { - beforeEach(function() { result = Quat2.invert(out, quat2A); }); - - it("should place values into out", function() { expect(out).toBeQuat2(-0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - it("the real part should be equal to a inverted quaternion", function() { - Quat.invert(outQuat, [1, 2, 3, 4]); - - expect(Quat2.getReal(outQuat, out)).toBeVec(...outQuat); - }); - }); - - describe("when quat2A is the output quaternion", function() { - beforeEach(function() { result = Quat2.invert(quat2A, quat2A); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeVec(-0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - - }); - }); - - describe("get real/dual", function() { - describe("get real", function() { - beforeEach(function() { result = Quat2.getReal(outQuat, quat2A); }); - - it("should place values into out", function() { expect(outQuat).toBeVec(1, 2, 3, 4); }); - it("should return out", function() { expect(result).toBe(outQuat); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - - describe("get dual", function() { - beforeEach(function() { result = Quat2.getDual(outQuat, quat2A); }); - - it("should place values into out", function() { expect(outQuat).toBeVec(2, 5, 6, -2); }); - it("should return out", function() { expect(result).toBe(outQuat); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - }); - - describe("set real/dual", function() { - describe("set real", function() { - beforeEach(function() { - outQuat = [4, 6, 8, -100]; - result = Quat2.setReal(quat2A, outQuat); - }); - - it("should place values into out", function() { expect(quat2A).toBeQuat2(4, 6, 8, -100, 2, 5, 6, -2); }); - it("should return out", function() { expect(result).toBe(quat2A); }); - it("should not modify outQuat", function() { expect(outQuat).toBeVec(4, 6, 8, -100); }); - }); - - describe("set dual", function() { - beforeEach(function() { - outQuat = [4.3, 6, 8, -100]; - result = Quat2.setDual(quat2A, outQuat); - }); - - it("should place values into out", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 4.3, 6, 8, -100); }); - it("should return out", function() { expect(result).toBe(quat2A); }); - it("should not modify outQuat", function() { expect(outQuat).toBeVec(4.3, 6, 8, -100); }); - }); - }); - - describe("conjugate", function() { - describe("with a separate output dual quaternion", function() { - beforeEach(function() { result = Quat2.conjugate(out, quat2A); }); - - it("should place values into out", function() { expect(out).toBeQuat2(-1, -2, -3, 4, -2, -5, -6, -2); }); - it("should return out", function() { expect(result).toBe(out); }); - it("should not modify quat2A", function() { expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2); }); - }); - - describe("when quat2A is the output dual quaternion", function() { - beforeEach(function() { result = Quat2.conjugate(quat2A, quat2A); }); - - it("should place values into quat2A", function() { expect(quat2A).toBeQuat2(-1, -2, -3, 4, -2, -5, -6, -2); }); - it("should return quat2A", function() { expect(result).toBe(quat2A); }); - }); - }); - - describe("str", function() { - beforeEach(function() { result = Quat2.str(quat2A); }); - - it("should return a string representation of the quaternion", function() { expect(result).toEqual("Quat2(1, 2, 3, 4, 2, 5, 6, -2)"); }); - }); - - describe("exactEquals", function() { - let quat2C, r0, r1; - beforeEach(function() { - quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; - quat2B = [0, 1, 2, 3, 4, 5, 6, 7]; - quat2C = [1, 2, 3, 4, 5, 6, 7, 8]; - r0 = Quat2.exactEquals(quat2A, quat2B); - r1 = Quat2.exactEquals(quat2A, quat2C); - }); - - it("should return true for identical quaternions", function() { expect(r0).toBe(true); }); - it("should return false for different quaternions", function() { expect(r1).toBe(false); }); - it("should not modify quat2A", function() { expect(quat2A).toBeVec(0, 1, 2, 3, 4, 5, 6, 7); }); - it("should not modify quat2B", function() { expect(quat2B).toBeVec(0, 1, 2, 3, 4, 5, 6, 7); }); - }); - - describe("equals", function() { - let quat2C, quat2D, r0, r1, r2; - beforeEach(function() { - quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; - quat2B = [0, 1, 2, 3, 4, 5, 6, 7]; - quat2C = [1, 2, 3, 4, 5, 6, 7, 8]; - quat2D = [1e-16, 1, 2, 3, 4, 5, 6, 7]; - r0 = Quat2.equals(quat2A, quat2B); - r1 = Quat2.equals(quat2A, quat2C); - r2 = Quat2.equals(quat2A, quat2D); - }); - it("should return true for identical dual quaternions", function() { expect(r0).toBe(true); }); - it("should return false for different dual quaternions", function() { expect(r1).toBe(false); }); - it("should return true for close but not identical quaternions", function() { expect(r2).toBe(true); }); - it("should not modify quat2A", function() { expect(quat2A).toBeVec(0, 1, 2, 3, 4, 5, 6, 7); }); - it("should not modify quat2B", function() { expect(quat2B).toBeVec(0, 1, 2, 3, 4, 5, 6, 7); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/test-utils.ts b/tests/setupExtend.ts similarity index 51% rename from tests/test-utils.ts rename to tests/setupExtend.ts index 8ef929c7..a6849c24 100644 --- a/tests/test-utils.ts +++ b/tests/setupExtend.ts @@ -1,20 +1,20 @@ import { expect } from 'vitest'; -import { Quat2Like } from '../src/quat2'; -declare global { - namespace jest { - interface Matchers { - toBeVec(...expected: number[] | [Float32Array]): CustomMatcherResult; - toBeQuat2(...expected: number[] | [Float32Array] | [Quat2Like]): jest.CustomMatcherResult; - } - } +import type { FloatArray, Quat2Like, Vec2Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; + +/** Less precision than `GSM_EPSILON` from #gl-matrix/common. */ +const TEST_EPSILON = 0.00001; + +interface MatcherResult { + pass: boolean + message: () => string } -const EPSILON = 0.00001; expect.extend({ - toBeVec(received: Float32Array, ...expected: number[] | [Float32Array]): jest.CustomMatcherResult { - let values: number[] | Float32Array; - if (expected[0] instanceof Float32Array) { + toBeVec(received: FloatArray, ...expected: number[] | [FloatArray] | [Vec2Like] | [Vec3Like] | [Vec4Like]): + MatcherResult { + let values: number[] | FloatArray; + if (expected[0] instanceof Float32Array || expected[0] instanceof Float64Array) { values = expected[0]; } else { values = expected as number[]; @@ -22,14 +22,16 @@ expect.extend({ if (received.length != values.length) { return ({ pass: false, - message: () => `Expected (${received}) and (${values}) to have the same length. (${received.length} != ${values.length})` + message: () => `Expected (${received}) and (${values}) to have the same length. (${ + received.length} != ${values.length})` }); } for(let i = 0; i < values.length; ++i) { - if(Math.abs(received[i] - values[i]) >= EPSILON) { + if(Math.abs(received[i] - values[i]) >= TEST_EPSILON) { return ({ pass: false, - message: () => `Expected (${received}) to be (${values}), but value[${i}] is not within tolerance. (${received[i]} != ${values[i]})` + message: () => `Expected (${received}) to be (${values}), but value[${i}] is not within tolerance. (${ + received[i]} != ${values[i]})` }); } } @@ -41,9 +43,9 @@ expect.extend({ }, //Dual quaternions are very special & unique snowflakes - toBeQuat2(received: Float32Array, ...expected: number[] | [Float32Array]): jest.CustomMatcherResult { - let values: number[] | Float32Array; - if (expected[0] instanceof Float32Array) { + toBeQuat2(received: FloatArray, ...expected: number[] | [FloatArray] | [Quat2Like]): MatcherResult { + let values: number[] | FloatArray; + if (expected[0] instanceof Float32Array || expected[0] instanceof Float64Array) { values = expected[0]; } else { values = expected as number[]; @@ -53,7 +55,8 @@ expect.extend({ if (received.length != values.length) { return ({ pass: false, - message: () => `Expected (${received}) and (${values}) to have the same length. (${received.length} != ${values.length})` + message: () => `Expected (${received}) and (${values}) to have the same length. (${ + received.length} != ${values.length})` }); } @@ -61,21 +64,23 @@ expect.extend({ if (isNaN(received[i]) !== isNaN(values[i])) { return ({ pass: false, - message: () => `Expected (${received}) and (${values}) to be equalish. (${received.length} != ${values.length})` + message: () => `Expected (${received}) and (${values}) to be equalish. (${ + received.length} != ${values.length})` }); } if (allSignsFlipped) { - if (Math.abs(received[i] - (-values[i])) >= EPSILON) { + if (Math.abs(received[i] - (-values[i])) >= TEST_EPSILON) { return ({ pass: false, - message: () => `Expected (${received}) and (${values}) to be equalish. (${received.length} != ${values.length})` + message: () => `Expected (${received}) and (${values}) to be equalish. (${ + received.length} != ${values.length})` }); } } else { - if (Math.abs(received[i] - values[i]) >= EPSILON) { - allSignsFlipped = true; - i = 0; + if (Math.abs(received[i] - values[i]) >= TEST_EPSILON) { + allSignsFlipped = true; + i = 0; } } } @@ -85,4 +90,4 @@ expect.extend({ message: () => `Expected (${received}) to be (${values}).` }); } -}); \ No newline at end of file +}); diff --git a/tests/setupGlobal.js b/tests/setupGlobal.js new file mode 100644 index 00000000..35af2a07 --- /dev/null +++ b/tests/setupGlobal.js @@ -0,0 +1,6 @@ +import { executeGenF64 } from '../scripts/gen-f64.js'; + +// Creates F64 source and tests once before Vitest execution. Use the NPM script `gen64` to trigger testing reruns. +export function setup() { + executeGenF64(); +} diff --git a/tests/vec2-swizzle.spec.ts b/tests/vec2-swizzle.spec.ts deleted file mode 100644 index 0dfd1955..00000000 --- a/tests/vec2-swizzle.spec.ts +++ /dev/null @@ -1,633 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Vec2 } from "../src/vec2" -import { EnableSwizzles } from '../src/swizzle'; -import "./test-utils" - -describe("Vec2 Swizzles", () => { - EnableSwizzles(); - - let v: Vec2; - beforeEach(() => { v = new Vec2(1, 2); }); - - // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should - // not be modified by hand. - // [Swizzle Autogen] - - describe("Vec2().xx", () => { - it("should return Vec2(x, x)", () => { - expect(v.xx).toBeVec(v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xy", () => { - it("should return Vec2(x, y)", () => { - expect(v.xy).toBeVec(v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yx", () => { - it("should return Vec2(y, x)", () => { - expect(v.yx).toBeVec(v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yy", () => { - it("should return Vec2(y, y)", () => { - expect(v.yy).toBeVec(v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xxx", () => { - it("should return Vec3(x, x, x)", () => { - expect(v.xxx).toBeVec(v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xxy", () => { - it("should return Vec3(x, x, y)", () => { - expect(v.xxy).toBeVec(v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xyx", () => { - it("should return Vec3(x, y, x)", () => { - expect(v.xyx).toBeVec(v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xyy", () => { - it("should return Vec3(x, y, y)", () => { - expect(v.xyy).toBeVec(v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yxx", () => { - it("should return Vec3(y, x, x)", () => { - expect(v.yxx).toBeVec(v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yxy", () => { - it("should return Vec3(y, x, y)", () => { - expect(v.yxy).toBeVec(v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yyx", () => { - it("should return Vec3(y, y, x)", () => { - expect(v.yyx).toBeVec(v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yyy", () => { - it("should return Vec3(y, y, y)", () => { - expect(v.yyy).toBeVec(v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xxxx", () => { - it("should return Vec4(x, x, x, x)", () => { - expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xxxy", () => { - it("should return Vec4(x, x, x, y)", () => { - expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xxyx", () => { - it("should return Vec4(x, x, y, x)", () => { - expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xxyy", () => { - it("should return Vec4(x, x, y, y)", () => { - expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xyxx", () => { - it("should return Vec4(x, y, x, x)", () => { - expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xyxy", () => { - it("should return Vec4(x, y, x, y)", () => { - expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xyyx", () => { - it("should return Vec4(x, y, y, x)", () => { - expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().xyyy", () => { - it("should return Vec4(x, y, y, y)", () => { - expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yxxx", () => { - it("should return Vec4(y, x, x, x)", () => { - expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yxxy", () => { - it("should return Vec4(y, x, x, y)", () => { - expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yxyx", () => { - it("should return Vec4(y, x, y, x)", () => { - expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yxyy", () => { - it("should return Vec4(y, x, y, y)", () => { - expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yyxx", () => { - it("should return Vec4(y, y, x, x)", () => { - expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yyxy", () => { - it("should return Vec4(y, y, x, y)", () => { - expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yyyx", () => { - it("should return Vec4(y, y, y, x)", () => { - expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().yyyy", () => { - it("should return Vec4(y, y, y, y)", () => { - expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rr", () => { - it("should return Vec2(r, r)", () => { - expect(v.rr).toBeVec(v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rg", () => { - it("should return Vec2(r, g)", () => { - expect(v.rg).toBeVec(v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().gr", () => { - it("should return Vec2(g, r)", () => { - expect(v.gr).toBeVec(v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().gg", () => { - it("should return Vec2(g, g)", () => { - expect(v.gg).toBeVec(v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rrr", () => { - it("should return Vec3(r, r, r)", () => { - expect(v.rrr).toBeVec(v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rrg", () => { - it("should return Vec3(r, r, g)", () => { - expect(v.rrg).toBeVec(v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rgr", () => { - it("should return Vec3(r, g, r)", () => { - expect(v.rgr).toBeVec(v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rgg", () => { - it("should return Vec3(r, g, g)", () => { - expect(v.rgg).toBeVec(v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().grr", () => { - it("should return Vec3(g, r, r)", () => { - expect(v.grr).toBeVec(v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().grg", () => { - it("should return Vec3(g, r, g)", () => { - expect(v.grg).toBeVec(v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().ggr", () => { - it("should return Vec3(g, g, r)", () => { - expect(v.ggr).toBeVec(v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().ggg", () => { - it("should return Vec3(g, g, g)", () => { - expect(v.ggg).toBeVec(v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rrrr", () => { - it("should return Vec4(r, r, r, r)", () => { - expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rrrg", () => { - it("should return Vec4(r, r, r, g)", () => { - expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rrgr", () => { - it("should return Vec4(r, r, g, r)", () => { - expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rrgg", () => { - it("should return Vec4(r, r, g, g)", () => { - expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rgrr", () => { - it("should return Vec4(r, g, r, r)", () => { - expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rgrg", () => { - it("should return Vec4(r, g, r, g)", () => { - expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rggr", () => { - it("should return Vec4(r, g, g, r)", () => { - expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().rggg", () => { - it("should return Vec4(r, g, g, g)", () => { - expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().grrr", () => { - it("should return Vec4(g, r, r, r)", () => { - expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().grrg", () => { - it("should return Vec4(g, r, r, g)", () => { - expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().grgr", () => { - it("should return Vec4(g, r, g, r)", () => { - expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().grgg", () => { - it("should return Vec4(g, r, g, g)", () => { - expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().ggrr", () => { - it("should return Vec4(g, g, r, r)", () => { - expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().ggrg", () => { - it("should return Vec4(g, g, r, g)", () => { - expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().gggr", () => { - it("should return Vec4(g, g, g, r)", () => { - expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec2().gggg", () => { - it("should return Vec4(g, g, g, g)", () => { - expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - // [/Swizzle Autogen] -}); \ No newline at end of file diff --git a/tests/vec2.spec.ts b/tests/vec2.spec.ts deleted file mode 100644 index 299ad4bb..00000000 --- a/tests/vec2.spec.ts +++ /dev/null @@ -1,785 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Vec2, Vec2Like } from "../src/vec2" -import "./test-utils" - -describe("Vec2", () => { - let vecA: Vec2; - let vecB: Vec2; - let out: Vec2; - - beforeEach(() => { - vecA = new Vec2(1, 2); - vecB = new Vec2([3, 4]); - out = new Vec2(); - }); - - describe("constructor", () => { - it("should return Vec2(0, 0) if called with no arguments", () => { - expect(new Vec2()).toBeVec(0, 0); - }); - - it("should return Vec2(x, y) if called with (x, y)", () => { - expect(new Vec2(1, 2)).toBeVec(1, 2); - expect(new Vec2(-3, 4.4)).toBeVec(-3, 4.4); - }); - - it("should return Vec2(x, x) if called with (x)", () => { - expect(new Vec2(1)).toBeVec(1, 1); - expect(new Vec2(-2.3)).toBeVec(-2.3, -2.3); - }); - - it("should return Vec2(x, y) if called with ([x, y])", () => { - expect(new Vec2([1, 2])).toBeVec(1, 2); - expect(new Vec2([-3, 4.4])).toBeVec(-3, 4.4); - }); - - it("should return Vec2(x, y) if called with (Vec2(x, y))", () => { - let v = new Vec2(3.4, 5.6); - expect(new Vec2(v)).toBeVec(v); - }); - - it("should return Vec2(x, y) if called with (Float32Array([x, y]))", () => { - let arr = new Float32Array([1.2, 3.4]); - expect(new Vec2(arr)).toBeVec(arr); - }); - }); - - describe("static methods", () => { - describe("create", () => { - it("should return Vec2(0, 0)", () => { - expect(Vec2.create()).toBeVec(0, 0); - }); - }); - - describe("add", () => { - let result: Vec2Like; - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.add(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(4, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.add(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(4, 6); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.add(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(4, 6); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("with raw array as the output", () => { - let outArray: Vec2Like = [0, 0]; - beforeEach(() => { result = Vec2.add(outArray, vecA, vecB); }); - - it("should place values into out", () => { expect(outArray).toBeVec(4, 6); }); - it("should return out", () => { expect(result).toBe(outArray); }); - }); - - describe("with raw arrays as the inputs", () => { - beforeEach(() => { result = Vec2.add(out, [1, 2], [3, 4]); }); - - it("should place values into out", () => { expect(out).toBeVec(4, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - }); - }); - - describe("static", () => { - let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: any; - - beforeEach(() => { - vecA = new Vec2(1, 2); - vecB = new Vec2(3, 4); - out = new Vec2(0, 0); - }); - - describe("create", () => { - beforeEach(() => { result = Vec2.create(); }); - it("should return a 2 element array initialized to 0s", () => { expect(result).toBeVec(0, 0); }); - }); - - describe("clone", () => { - beforeEach(() => { result = Vec2.clone(vecA); }); - it("should return a 2 element array initialized to the values in vecA", () => { expect(result).toBeVec(vecA); }); - }); - - describe("fromValues", () => { - beforeEach(() => { result = Vec2.fromValues(1, 2); }); - it("should return a 2 element array initialized to the values passed", () => { expect(result).toBeVec(1, 2); }); - }); - - describe("copy", () => { - beforeEach(() => { result = Vec2.copy(out, vecA); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("set", () => { - beforeEach(() => { result = Vec2.set(out, 1, 2); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("add", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.add(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(4, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.add(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(4, 6); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.add(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(4, 6); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - }); - - describe("subtract", () => { - it("should have an alias called 'sub'", () => { expect(Vec2.sub).toEqual(Vec2.subtract); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.subtract(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(-2, -2); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.subtract(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-2, -2); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.subtract(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(-2, -2); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - }); - - describe("multiply", () => { - it("should have an alias called 'mul'", () => { expect(Vec2.mul).toEqual(Vec2.multiply); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.multiply(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 8); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.multiply(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 8); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.multiply(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3, 8); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - }); - - describe("divide", () => { - it("should have an alias called 'div'", () => { expect(Vec2.div).toEqual(Vec2.divide); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.divide(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(0.3333333, 0.5); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.divide(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(0.3333333, 0.5); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.divide(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(0.3333333, 0.5); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - }); - - describe("ceil", () => { - beforeEach(() => { vecA = [Math.E, Math.PI]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.ceil(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.ceil(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("floor", () => { - beforeEach(() => { vecA = [Math.E, Math.PI]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.floor(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.floor(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("min", () => { - beforeEach(() => { vecA = [1, 4]; vecB = [3, 2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.min(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 2); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.min(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 2); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.min(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(1, 2); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 4); }); - }); - }); - - describe("max", () => { - beforeEach(() => { vecA = [1, 4]; vecB = [3, 2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.max(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.max(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 2); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.max(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3, 4); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 4); }); - }); - }); - - describe("round", () => { - beforeEach(() => { vecA = [Math.E, Math.PI]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.round(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.round(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("scale", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.scale(out, vecA, 2); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.scale(vecA, vecA, 2); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("scaleAndAdd", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.scaleAndAdd(out, vecA, vecB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(2.5, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.scaleAndAdd(vecA, vecA, vecB, 0.5); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2.5, 4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.scaleAndAdd(vecB, vecA, vecB, 0.5); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(2.5, 4); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - }); - - describe("distance", () => { - it("should have an alias called 'dist'", () => { expect(Vec2.dist).toEqual(Vec2.distance); }); - - beforeEach(() => { result = Vec2.distance(vecA, vecB); }); - - it("should return the distance", () => { expect(result).toBeCloseTo(2.828427); }); - }); - - describe("squaredDistance", () => { - it("should have an alias called 'sqrDist'", () => { expect(Vec2.sqrDist).toEqual(Vec2.squaredDistance); }); - - beforeEach(() => { result = Vec2.squaredDistance(vecA, vecB); }); - - it("should return the squared distance", () => { expect(result).toEqual(8); }); - }); - - describe("length", () => { - it("should have an alias called 'len'", () => { expect(Vec2.len).toEqual(Vec2.length); }); - - beforeEach(() => { result = Vec2.len(vecA); }); - - it("should return the length", () => { expect(result).toBeCloseTo(2.236067); }); - }); - - describe("squaredLength", () => { - it("should have an alias called 'sqrLen'", () => { expect(Vec2.sqrLen).toEqual(Vec2.squaredLength); }); - - beforeEach(() => { result = Vec2.squaredLength(vecA); }); - - it("should return the squared length", () => { expect(result).toEqual(5); }); - }); - - describe("negate", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.negate(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(-1, -2); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.negate(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-1, -2); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("inverse", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.inverse(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 1/2); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.inverse(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 1/2); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("abs", () => { - beforeEach(() => { vecA = [-1, -2]; }); - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.abs(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 2); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(-1, -2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.abs(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("normalize", () => { - beforeEach(() => { vecA = [5, 0]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.normalize(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 0); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(5, 0); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.normalize(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 0); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("dot", () => { - beforeEach(() => { result = Vec2.dot(vecA, vecB); }); - - it("should return the dot product", () => { expect(result).toEqual(11); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("cross", () => { - let out3; - - beforeEach(() => { - out3 = [0, 0, 0]; - result = Vec2.cross(out3, vecA, vecB); - }); - - it("should place values into out", () => { expect(out3).toBeVec(0, 0, -2); }); - it("should return out", () => { expect(result).toBe(out3); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("lerp", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.lerp(out, vecA, vecB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.lerp(vecA, vecA, vecB, 0.5); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 4); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec2.lerp(vecB, vecA, vecB, 0.5); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(2, 3); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - }); - - /*describe("random", () => { - describe("with no scale", () => { - beforeEach(() => { result = Vec2.random(out); }); - - it("should result in a unit length vector", () => { expect(Vec2.len(out)).toBeCloseTo(1.0); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("with a scale", () => { - beforeEach(() => { result = Vec2.random(out, 5.0); }); - - it("should result in a unit length vector", () => { expect(Vec2.len(out)).toBeCloseTo(5.0); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - });*/ - - describe("transformMat2", () => { - let matA; - beforeEach(() => { matA = [1, 2, 3, 4]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.transformMat2(out, vecA, matA); }); - - it("should place values into out", () => { expect(out).toBeVec(7, 10); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.transformMat2(vecA, vecA, matA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(7, 10); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("transformMat2d", () => { - let matA; - beforeEach(() => { matA = [1, 2, 3, 4, 5, 6]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec2.transformMat2d(out, vecA, matA); }); - - it("should place values into out", () => { expect(out).toBeVec(12, 16); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec2.transformMat2d(vecA, vecA, matA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(12, 16); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify matA", () => { expect(matA).toBeVec(1, 2, 3, 4, 5, 6); }); - }); - }); - - /*describe("forEach", () => { - let vecArray; - - beforeEach(() => { - vecArray = [ - 1, 2, - 3, 4, - 0, 0 - ]; - }); - - describe("when performing operations that take no extra arguments", () => { - beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, Vec2.normalize); }); - - it("should update all values", () => { - expect(vecArray).toBeEqualish([ - 0.447214, 0.894427, - 0.6, 0.8, - 0, 0 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - }); - - describe("when performing operations that takes one extra arguments", () => { - beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 0, Vec2.add, vecA); }); - - it("should update all values", () => { - expect(vecArray).toBeEqualish([ - 2, 4, - 4, 6, - 1, 2 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when specifying an offset", () => { - beforeEach(() => { result = Vec2.forEach(vecArray, 0, 2, 0, Vec2.add, vecA); }); - - it("should update all values except the first vector", () => { - expect(vecArray).toBeEqualish([ - 1, 2, - 4, 6, - 1, 2 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when specifying a count", () => { - beforeEach(() => { result = Vec2.forEach(vecArray, 0, 0, 2, Vec2.add, vecA); }); - - it("should update all values except the last vector", () => { - expect(vecArray).toBeEqualish([ - 2, 4, - 4, 6, - 0, 0 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when specifying a stride", () => { - beforeEach(() => { result = Vec2.forEach(vecArray, 4, 0, 0, Vec2.add, vecA); }); - - it("should update all values except the second vector", () => { - expect(vecArray).toBeEqualish([ - 2, 4, - 3, 4, - 1, 2 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2); }); - }); - - describe("when calling a function that does not modify the out variable", () => { - beforeEach(() => { - result = Vec2.forEach(vecArray, 0, 0, 0, function(out, vec) {}); - }); - - it("values should remain unchanged", () => { - expect(vecArray).toBeEqualish([ - 1, 2, - 3, 4, - 0, 0, - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - }); - });*/ - - describe('rotate', () => { - describe('rotation around world origin [0, 0, 0]', () => { - beforeEach(() => { vecA = [0, 1]; vecB = [0, 0]; result = Vec2.rotate(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(0, -1); }); - }); - describe('rotation around an arbitrary origin', () => { - beforeEach(() => { vecA = [6, -5]; vecB = [0, -5]; result = Vec2.rotate(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(-6, -5); }); - }); - }); - - describe("angle", () => { - beforeEach(() => { - vecA = [1,0]; - vecB = [1,2]; - result = Vec2.angle(vecA, vecB); - }); - - it("should return the angle", () => { expect(result).toBeCloseTo(1.10714); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 0); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(1, 2); }); - }); - - describe("str", () => { - it("should return a string representation of the vector", () => { expect(Vec2.str(vecA)).toEqual("Vec2(1, 2)"); }); - }); - - describe("exactEquals", () => { - let vecC, r0, r1; - beforeEach(() => { - vecA = [0, 1]; - vecB = [0, 1]; - vecC = [1, 2]; - r0 = Vec2.exactEquals(vecA, vecB); - r1 = Vec2.exactEquals(vecA, vecC); - }); - - it("should return true for identical vectors", () => { expect(r0).toBe(true); }); - it("should return false for different vectors", () => { expect(r1).toBe(false); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(0, 1); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1); }); - }); - - describe("equals", () => { - let vecC, vecD, r0, r1, r2; - beforeEach(() => { - vecA = [0, 1]; - vecB = [0, 1]; - vecC = [1, 2]; - vecD = [1e-16, 1]; - r0 = Vec2.equals(vecA, vecB); - r1 = Vec2.equals(vecA, vecC); - r2 = Vec2.equals(vecA, vecD); - }); - it("should return true for identical vectors", () => { expect(r0).toBe(true); }); - it("should return false for different vectors", () => { expect(r1).toBe(false); }); - it("should return true for close but not identical vectors", () => { expect(r2).toBe(true); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(0, 1); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1); }); - }); - - describe("zero", () => { - beforeEach(() => { - vecA = [1, 2]; - result = Vec2.zero(vecA); - }); - it("should result in a 2 element vector with zeros", () => { expect(result).toBeVec(0, 0); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/vec3-swizzle.spec.ts b/tests/vec3-swizzle.spec.ts deleted file mode 100644 index 01e4d180..00000000 --- a/tests/vec3-swizzle.spec.ts +++ /dev/null @@ -1,2591 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Vec3 } from "../src/vec3" -import { EnableSwizzles } from '../src/swizzle'; -import "./test-utils" - -describe("Vec3 Swizzles", () => { - EnableSwizzles(); - - let v: Vec3; - beforeEach(() => { v = new Vec3(1, 2, 3); }); - - // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should - // not be modified by hand. - // [Swizzle Autogen] - - describe("Vec3().xx", () => { - it("should return Vec2(x, x)", () => { - expect(v.xx).toBeVec(v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xy", () => { - it("should return Vec2(x, y)", () => { - expect(v.xy).toBeVec(v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xz", () => { - it("should return Vec2(x, z)", () => { - expect(v.xz).toBeVec(v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yx", () => { - it("should return Vec2(y, x)", () => { - expect(v.yx).toBeVec(v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yy", () => { - it("should return Vec2(y, y)", () => { - expect(v.yy).toBeVec(v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yz", () => { - it("should return Vec2(y, z)", () => { - expect(v.yz).toBeVec(v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zx", () => { - it("should return Vec2(z, x)", () => { - expect(v.zx).toBeVec(v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zy", () => { - it("should return Vec2(z, y)", () => { - expect(v.zy).toBeVec(v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zz", () => { - it("should return Vec2(z, z)", () => { - expect(v.zz).toBeVec(v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxx", () => { - it("should return Vec3(x, x, x)", () => { - expect(v.xxx).toBeVec(v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxy", () => { - it("should return Vec3(x, x, y)", () => { - expect(v.xxy).toBeVec(v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxz", () => { - it("should return Vec3(x, x, z)", () => { - expect(v.xxz).toBeVec(v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyx", () => { - it("should return Vec3(x, y, x)", () => { - expect(v.xyx).toBeVec(v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyy", () => { - it("should return Vec3(x, y, y)", () => { - expect(v.xyy).toBeVec(v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyz", () => { - it("should return Vec3(x, y, z)", () => { - expect(v.xyz).toBeVec(v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzx", () => { - it("should return Vec3(x, z, x)", () => { - expect(v.xzx).toBeVec(v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzy", () => { - it("should return Vec3(x, z, y)", () => { - expect(v.xzy).toBeVec(v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzz", () => { - it("should return Vec3(x, z, z)", () => { - expect(v.xzz).toBeVec(v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxx", () => { - it("should return Vec3(y, x, x)", () => { - expect(v.yxx).toBeVec(v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxy", () => { - it("should return Vec3(y, x, y)", () => { - expect(v.yxy).toBeVec(v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxz", () => { - it("should return Vec3(y, x, z)", () => { - expect(v.yxz).toBeVec(v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyx", () => { - it("should return Vec3(y, y, x)", () => { - expect(v.yyx).toBeVec(v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyy", () => { - it("should return Vec3(y, y, y)", () => { - expect(v.yyy).toBeVec(v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyz", () => { - it("should return Vec3(y, y, z)", () => { - expect(v.yyz).toBeVec(v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzx", () => { - it("should return Vec3(y, z, x)", () => { - expect(v.yzx).toBeVec(v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzy", () => { - it("should return Vec3(y, z, y)", () => { - expect(v.yzy).toBeVec(v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzz", () => { - it("should return Vec3(y, z, z)", () => { - expect(v.yzz).toBeVec(v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxx", () => { - it("should return Vec3(z, x, x)", () => { - expect(v.zxx).toBeVec(v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxy", () => { - it("should return Vec3(z, x, y)", () => { - expect(v.zxy).toBeVec(v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxz", () => { - it("should return Vec3(z, x, z)", () => { - expect(v.zxz).toBeVec(v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyx", () => { - it("should return Vec3(z, y, x)", () => { - expect(v.zyx).toBeVec(v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyy", () => { - it("should return Vec3(z, y, y)", () => { - expect(v.zyy).toBeVec(v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyz", () => { - it("should return Vec3(z, y, z)", () => { - expect(v.zyz).toBeVec(v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzx", () => { - it("should return Vec3(z, z, x)", () => { - expect(v.zzx).toBeVec(v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzy", () => { - it("should return Vec3(z, z, y)", () => { - expect(v.zzy).toBeVec(v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzz", () => { - it("should return Vec3(z, z, z)", () => { - expect(v.zzz).toBeVec(v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxxx", () => { - it("should return Vec4(x, x, x, x)", () => { - expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxxy", () => { - it("should return Vec4(x, x, x, y)", () => { - expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxxz", () => { - it("should return Vec4(x, x, x, z)", () => { - expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxyx", () => { - it("should return Vec4(x, x, y, x)", () => { - expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxyy", () => { - it("should return Vec4(x, x, y, y)", () => { - expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxyz", () => { - it("should return Vec4(x, x, y, z)", () => { - expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxzx", () => { - it("should return Vec4(x, x, z, x)", () => { - expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxzy", () => { - it("should return Vec4(x, x, z, y)", () => { - expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xxzz", () => { - it("should return Vec4(x, x, z, z)", () => { - expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyxx", () => { - it("should return Vec4(x, y, x, x)", () => { - expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyxy", () => { - it("should return Vec4(x, y, x, y)", () => { - expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyxz", () => { - it("should return Vec4(x, y, x, z)", () => { - expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyyx", () => { - it("should return Vec4(x, y, y, x)", () => { - expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyyy", () => { - it("should return Vec4(x, y, y, y)", () => { - expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyyz", () => { - it("should return Vec4(x, y, y, z)", () => { - expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyzx", () => { - it("should return Vec4(x, y, z, x)", () => { - expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyzy", () => { - it("should return Vec4(x, y, z, y)", () => { - expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xyzz", () => { - it("should return Vec4(x, y, z, z)", () => { - expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzxx", () => { - it("should return Vec4(x, z, x, x)", () => { - expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzxy", () => { - it("should return Vec4(x, z, x, y)", () => { - expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzxz", () => { - it("should return Vec4(x, z, x, z)", () => { - expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzyx", () => { - it("should return Vec4(x, z, y, x)", () => { - expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzyy", () => { - it("should return Vec4(x, z, y, y)", () => { - expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzyz", () => { - it("should return Vec4(x, z, y, z)", () => { - expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzzx", () => { - it("should return Vec4(x, z, z, x)", () => { - expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzzy", () => { - it("should return Vec4(x, z, z, y)", () => { - expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().xzzz", () => { - it("should return Vec4(x, z, z, z)", () => { - expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxxx", () => { - it("should return Vec4(y, x, x, x)", () => { - expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxxy", () => { - it("should return Vec4(y, x, x, y)", () => { - expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxxz", () => { - it("should return Vec4(y, x, x, z)", () => { - expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxyx", () => { - it("should return Vec4(y, x, y, x)", () => { - expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxyy", () => { - it("should return Vec4(y, x, y, y)", () => { - expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxyz", () => { - it("should return Vec4(y, x, y, z)", () => { - expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxzx", () => { - it("should return Vec4(y, x, z, x)", () => { - expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxzy", () => { - it("should return Vec4(y, x, z, y)", () => { - expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yxzz", () => { - it("should return Vec4(y, x, z, z)", () => { - expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyxx", () => { - it("should return Vec4(y, y, x, x)", () => { - expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyxy", () => { - it("should return Vec4(y, y, x, y)", () => { - expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyxz", () => { - it("should return Vec4(y, y, x, z)", () => { - expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyyx", () => { - it("should return Vec4(y, y, y, x)", () => { - expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyyy", () => { - it("should return Vec4(y, y, y, y)", () => { - expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyyz", () => { - it("should return Vec4(y, y, y, z)", () => { - expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyzx", () => { - it("should return Vec4(y, y, z, x)", () => { - expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyzy", () => { - it("should return Vec4(y, y, z, y)", () => { - expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yyzz", () => { - it("should return Vec4(y, y, z, z)", () => { - expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzxx", () => { - it("should return Vec4(y, z, x, x)", () => { - expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzxy", () => { - it("should return Vec4(y, z, x, y)", () => { - expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzxz", () => { - it("should return Vec4(y, z, x, z)", () => { - expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzyx", () => { - it("should return Vec4(y, z, y, x)", () => { - expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzyy", () => { - it("should return Vec4(y, z, y, y)", () => { - expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzyz", () => { - it("should return Vec4(y, z, y, z)", () => { - expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzzx", () => { - it("should return Vec4(y, z, z, x)", () => { - expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzzy", () => { - it("should return Vec4(y, z, z, y)", () => { - expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().yzzz", () => { - it("should return Vec4(y, z, z, z)", () => { - expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxxx", () => { - it("should return Vec4(z, x, x, x)", () => { - expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxxy", () => { - it("should return Vec4(z, x, x, y)", () => { - expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxxz", () => { - it("should return Vec4(z, x, x, z)", () => { - expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxyx", () => { - it("should return Vec4(z, x, y, x)", () => { - expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxyy", () => { - it("should return Vec4(z, x, y, y)", () => { - expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxyz", () => { - it("should return Vec4(z, x, y, z)", () => { - expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxzx", () => { - it("should return Vec4(z, x, z, x)", () => { - expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxzy", () => { - it("should return Vec4(z, x, z, y)", () => { - expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zxzz", () => { - it("should return Vec4(z, x, z, z)", () => { - expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyxx", () => { - it("should return Vec4(z, y, x, x)", () => { - expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyxy", () => { - it("should return Vec4(z, y, x, y)", () => { - expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyxz", () => { - it("should return Vec4(z, y, x, z)", () => { - expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyyx", () => { - it("should return Vec4(z, y, y, x)", () => { - expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyyy", () => { - it("should return Vec4(z, y, y, y)", () => { - expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyyz", () => { - it("should return Vec4(z, y, y, z)", () => { - expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyzx", () => { - it("should return Vec4(z, y, z, x)", () => { - expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyzy", () => { - it("should return Vec4(z, y, z, y)", () => { - expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zyzz", () => { - it("should return Vec4(z, y, z, z)", () => { - expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzxx", () => { - it("should return Vec4(z, z, x, x)", () => { - expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzxy", () => { - it("should return Vec4(z, z, x, y)", () => { - expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzxz", () => { - it("should return Vec4(z, z, x, z)", () => { - expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzyx", () => { - it("should return Vec4(z, z, y, x)", () => { - expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzyy", () => { - it("should return Vec4(z, z, y, y)", () => { - expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzyz", () => { - it("should return Vec4(z, z, y, z)", () => { - expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzzx", () => { - it("should return Vec4(z, z, z, x)", () => { - expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzzy", () => { - it("should return Vec4(z, z, z, y)", () => { - expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().zzzz", () => { - it("should return Vec4(z, z, z, z)", () => { - expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rr", () => { - it("should return Vec2(r, r)", () => { - expect(v.rr).toBeVec(v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rg", () => { - it("should return Vec2(r, g)", () => { - expect(v.rg).toBeVec(v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rb", () => { - it("should return Vec2(r, b)", () => { - expect(v.rb).toBeVec(v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gr", () => { - it("should return Vec2(g, r)", () => { - expect(v.gr).toBeVec(v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gg", () => { - it("should return Vec2(g, g)", () => { - expect(v.gg).toBeVec(v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gb", () => { - it("should return Vec2(g, b)", () => { - expect(v.gb).toBeVec(v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().br", () => { - it("should return Vec2(b, r)", () => { - expect(v.br).toBeVec(v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.br; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bg", () => { - it("should return Vec2(b, g)", () => { - expect(v.bg).toBeVec(v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bb", () => { - it("should return Vec2(b, b)", () => { - expect(v.bb).toBeVec(v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrr", () => { - it("should return Vec3(r, r, r)", () => { - expect(v.rrr).toBeVec(v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrg", () => { - it("should return Vec3(r, r, g)", () => { - expect(v.rrg).toBeVec(v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrb", () => { - it("should return Vec3(r, r, b)", () => { - expect(v.rrb).toBeVec(v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgr", () => { - it("should return Vec3(r, g, r)", () => { - expect(v.rgr).toBeVec(v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgg", () => { - it("should return Vec3(r, g, g)", () => { - expect(v.rgg).toBeVec(v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgb", () => { - it("should return Vec3(r, g, b)", () => { - expect(v.rgb).toBeVec(v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbr", () => { - it("should return Vec3(r, b, r)", () => { - expect(v.rbr).toBeVec(v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbg", () => { - it("should return Vec3(r, b, g)", () => { - expect(v.rbg).toBeVec(v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbb", () => { - it("should return Vec3(r, b, b)", () => { - expect(v.rbb).toBeVec(v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grr", () => { - it("should return Vec3(g, r, r)", () => { - expect(v.grr).toBeVec(v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grg", () => { - it("should return Vec3(g, r, g)", () => { - expect(v.grg).toBeVec(v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grb", () => { - it("should return Vec3(g, r, b)", () => { - expect(v.grb).toBeVec(v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggr", () => { - it("should return Vec3(g, g, r)", () => { - expect(v.ggr).toBeVec(v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggg", () => { - it("should return Vec3(g, g, g)", () => { - expect(v.ggg).toBeVec(v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggb", () => { - it("should return Vec3(g, g, b)", () => { - expect(v.ggb).toBeVec(v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbr", () => { - it("should return Vec3(g, b, r)", () => { - expect(v.gbr).toBeVec(v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbg", () => { - it("should return Vec3(g, b, g)", () => { - expect(v.gbg).toBeVec(v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbb", () => { - it("should return Vec3(g, b, b)", () => { - expect(v.gbb).toBeVec(v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brr", () => { - it("should return Vec3(b, r, r)", () => { - expect(v.brr).toBeVec(v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brg", () => { - it("should return Vec3(b, r, g)", () => { - expect(v.brg).toBeVec(v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brb", () => { - it("should return Vec3(b, r, b)", () => { - expect(v.brb).toBeVec(v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgr", () => { - it("should return Vec3(b, g, r)", () => { - expect(v.bgr).toBeVec(v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgg", () => { - it("should return Vec3(b, g, g)", () => { - expect(v.bgg).toBeVec(v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgb", () => { - it("should return Vec3(b, g, b)", () => { - expect(v.bgb).toBeVec(v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbr", () => { - it("should return Vec3(b, b, r)", () => { - expect(v.bbr).toBeVec(v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbg", () => { - it("should return Vec3(b, b, g)", () => { - expect(v.bbg).toBeVec(v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbb", () => { - it("should return Vec3(b, b, b)", () => { - expect(v.bbb).toBeVec(v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrrr", () => { - it("should return Vec4(r, r, r, r)", () => { - expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrrg", () => { - it("should return Vec4(r, r, r, g)", () => { - expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrrb", () => { - it("should return Vec4(r, r, r, b)", () => { - expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrgr", () => { - it("should return Vec4(r, r, g, r)", () => { - expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrgg", () => { - it("should return Vec4(r, r, g, g)", () => { - expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrgb", () => { - it("should return Vec4(r, r, g, b)", () => { - expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrbr", () => { - it("should return Vec4(r, r, b, r)", () => { - expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrbg", () => { - it("should return Vec4(r, r, b, g)", () => { - expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rrbb", () => { - it("should return Vec4(r, r, b, b)", () => { - expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgrr", () => { - it("should return Vec4(r, g, r, r)", () => { - expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgrg", () => { - it("should return Vec4(r, g, r, g)", () => { - expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgrb", () => { - it("should return Vec4(r, g, r, b)", () => { - expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rggr", () => { - it("should return Vec4(r, g, g, r)", () => { - expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rggg", () => { - it("should return Vec4(r, g, g, g)", () => { - expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rggb", () => { - it("should return Vec4(r, g, g, b)", () => { - expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgbr", () => { - it("should return Vec4(r, g, b, r)", () => { - expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgbg", () => { - it("should return Vec4(r, g, b, g)", () => { - expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rgbb", () => { - it("should return Vec4(r, g, b, b)", () => { - expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbrr", () => { - it("should return Vec4(r, b, r, r)", () => { - expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbrg", () => { - it("should return Vec4(r, b, r, g)", () => { - expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbrb", () => { - it("should return Vec4(r, b, r, b)", () => { - expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbgr", () => { - it("should return Vec4(r, b, g, r)", () => { - expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbgg", () => { - it("should return Vec4(r, b, g, g)", () => { - expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbgb", () => { - it("should return Vec4(r, b, g, b)", () => { - expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbbr", () => { - it("should return Vec4(r, b, b, r)", () => { - expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbbg", () => { - it("should return Vec4(r, b, b, g)", () => { - expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().rbbb", () => { - it("should return Vec4(r, b, b, b)", () => { - expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grrr", () => { - it("should return Vec4(g, r, r, r)", () => { - expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grrg", () => { - it("should return Vec4(g, r, r, g)", () => { - expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grrb", () => { - it("should return Vec4(g, r, r, b)", () => { - expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grgr", () => { - it("should return Vec4(g, r, g, r)", () => { - expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grgg", () => { - it("should return Vec4(g, r, g, g)", () => { - expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grgb", () => { - it("should return Vec4(g, r, g, b)", () => { - expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grbr", () => { - it("should return Vec4(g, r, b, r)", () => { - expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grbg", () => { - it("should return Vec4(g, r, b, g)", () => { - expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().grbb", () => { - it("should return Vec4(g, r, b, b)", () => { - expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggrr", () => { - it("should return Vec4(g, g, r, r)", () => { - expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggrg", () => { - it("should return Vec4(g, g, r, g)", () => { - expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggrb", () => { - it("should return Vec4(g, g, r, b)", () => { - expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gggr", () => { - it("should return Vec4(g, g, g, r)", () => { - expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gggg", () => { - it("should return Vec4(g, g, g, g)", () => { - expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gggb", () => { - it("should return Vec4(g, g, g, b)", () => { - expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggbr", () => { - it("should return Vec4(g, g, b, r)", () => { - expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggbg", () => { - it("should return Vec4(g, g, b, g)", () => { - expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().ggbb", () => { - it("should return Vec4(g, g, b, b)", () => { - expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbrr", () => { - it("should return Vec4(g, b, r, r)", () => { - expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbrg", () => { - it("should return Vec4(g, b, r, g)", () => { - expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbrb", () => { - it("should return Vec4(g, b, r, b)", () => { - expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbgr", () => { - it("should return Vec4(g, b, g, r)", () => { - expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbgg", () => { - it("should return Vec4(g, b, g, g)", () => { - expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbgb", () => { - it("should return Vec4(g, b, g, b)", () => { - expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbbr", () => { - it("should return Vec4(g, b, b, r)", () => { - expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbbg", () => { - it("should return Vec4(g, b, b, g)", () => { - expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().gbbb", () => { - it("should return Vec4(g, b, b, b)", () => { - expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brrr", () => { - it("should return Vec4(b, r, r, r)", () => { - expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brrg", () => { - it("should return Vec4(b, r, r, g)", () => { - expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brrb", () => { - it("should return Vec4(b, r, r, b)", () => { - expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brgr", () => { - it("should return Vec4(b, r, g, r)", () => { - expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brgg", () => { - it("should return Vec4(b, r, g, g)", () => { - expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brgb", () => { - it("should return Vec4(b, r, g, b)", () => { - expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brbr", () => { - it("should return Vec4(b, r, b, r)", () => { - expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brbg", () => { - it("should return Vec4(b, r, b, g)", () => { - expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().brbb", () => { - it("should return Vec4(b, r, b, b)", () => { - expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgrr", () => { - it("should return Vec4(b, g, r, r)", () => { - expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgrg", () => { - it("should return Vec4(b, g, r, g)", () => { - expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgrb", () => { - it("should return Vec4(b, g, r, b)", () => { - expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bggr", () => { - it("should return Vec4(b, g, g, r)", () => { - expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bggg", () => { - it("should return Vec4(b, g, g, g)", () => { - expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bggb", () => { - it("should return Vec4(b, g, g, b)", () => { - expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgbr", () => { - it("should return Vec4(b, g, b, r)", () => { - expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgbg", () => { - it("should return Vec4(b, g, b, g)", () => { - expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bgbb", () => { - it("should return Vec4(b, g, b, b)", () => { - expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbrr", () => { - it("should return Vec4(b, b, r, r)", () => { - expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbrg", () => { - it("should return Vec4(b, b, r, g)", () => { - expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbrb", () => { - it("should return Vec4(b, b, r, b)", () => { - expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbgr", () => { - it("should return Vec4(b, b, g, r)", () => { - expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbgg", () => { - it("should return Vec4(b, b, g, g)", () => { - expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbgb", () => { - it("should return Vec4(b, b, g, b)", () => { - expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbbr", () => { - it("should return Vec4(b, b, b, r)", () => { - expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbbg", () => { - it("should return Vec4(b, b, b, g)", () => { - expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec3().bbbb", () => { - it("should return Vec4(b, b, b, b)", () => { - expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - // [/Swizzle Autogen] -}); \ No newline at end of file diff --git a/tests/vec3.spec.ts b/tests/vec3.spec.ts deleted file mode 100644 index 1e49181b..00000000 --- a/tests/vec3.spec.ts +++ /dev/null @@ -1,702 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Vec3, Vec3Like } from "../src/vec3" -import { Mat4, Mat4Like } from "../src/mat4" -import "./test-utils" - -describe("Vec3", () => { - describe("constructor", () => { - it("should return Vec3(0, 0, 0) if called with no arguments", () => { - expect(new Vec3()).toBeVec(0, 0, 0); - }); - - it("should return Vec3(x, y, z) if called with (x, y, z)", () => { - expect(new Vec3(1, 2, 3)).toBeVec(1, 2, 3); - expect(new Vec3(-3, 4.4, -5.6)).toBeVec(-3, 4.4, -5.6); - }); - - it("should return Vec3(x, x, x) if called with (x)", () => { - expect(new Vec3(1)).toBeVec(1, 1, 1); - expect(new Vec3(-2.3)).toBeVec(-2.3, -2.3, -2.3); - }); - - it("should return Vec3(x, y, z) if called with ([x, y, z])", () => { - expect(new Vec3([1, 2, 3])).toBeVec(1, 2, 3); - expect(new Vec3([-3, 4.4, -5.6])).toBeVec(-3, 4.4, -5.6); - }); - - it("should return Vec3(x, y, z) if called with (Vec3(x, y, z))", () => { - let v = new Vec3(3.4, 5.6, 7.8); - expect(new Vec3(v)).toBeVec(v); - }); - - it("should return Vec3(x, y, z) if called with (Float32Array([x, y, z]))", () => { - let arr = new Float32Array([1.2, 3.4, 5.6]); - expect(new Vec3(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out: Vec3Like; - let vecA: Vec3Like; - let vecB: Vec3Like; - let result: Vec3Like; - - beforeEach(() => { - vecA = new Vec3(1, 2, 3); - vecB = new Vec3(4, 5, 6); - out = new Vec3(0, 0, 0); - }); - - describe('rotateX', () => { - describe('rotation around world origin [0, 0, 0]', () => { - beforeEach(() => { vecA = [0, 1, 0]; vecB = [0, 0, 0]; result = Vec3.rotateX(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(0, -1, 0); }); - }); - describe('rotation around an arbitrary origin', () => { - beforeEach(() => { vecA = [2, 7, 0]; vecB = [2, 5, 0]; result = Vec3.rotateX(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(2, 3, 0); }); - }); - }); - - describe('rotateY', () => { - describe('rotation around world origin [0, 0, 0]', () => { - beforeEach(() => { vecA = [1, 0, 0]; vecB = [0, 0, 0]; result = Vec3.rotateY(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(-1, 0, 0); }); - }); - describe('rotation around an arbitrary origin', () => { - beforeEach(() => { vecA = [-2, 3, 10]; vecB = [-4, 3, 10]; result = Vec3.rotateY(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(-6, 3, 10); }); - }); - }); - - describe('rotateZ', () => { - describe('rotation around world origin [0, 0, 0]', () => { - beforeEach(() => { vecA = [0, 1, 0]; vecB = [0, 0, 0]; result = Vec3.rotateZ(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(0, -1, 0); }); - }); - describe('rotation around an arbitrary origin', () => { - beforeEach(() => { vecA = [0, 6, -5]; vecB = [0, 0, -5]; result = Vec3.rotateZ(out, vecA, vecB, Math.PI); }); - it("should return the rotated vector", () => { expect(result).toBeVec(0, -6, -5); }); - }); - }); - - describe('transformMat4', () => { - let matr : Mat4Like; - describe("with an identity", () => { - beforeEach(() => { matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ] }); - - beforeEach(() => { result = Vec3.transformMat4(out, vecA, matr); }); - - it("should produce the input", () => { - expect(out).toBeVec(1, 2, 3); - }); - - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("with a lookAt", () => { - beforeEach(() => { matr = Mat4.lookAt(new Mat4(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); }); - - beforeEach(() => { result = Vec3.transformMat4(out, vecA, matr); }); - - it("should rotate and translate the input", () => { - expect(out).toBeVec( 4, -4, -4 ); - }); - - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("with a perspective matrix (#92)", () => { - it("should transform a point from perspective(pi/2, 4/3, 1, 100)", () => { - matr = [0.750, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, -1.02, -1, - 0, 0, -2.02, 0]; - result = Vec3.transformMat4([0, 0, 0], [10, 20, 30], matr); - expect(result).toBeVec(-0.25, -0.666666, 1.087333); - }); - }); - - }); - - /*describe('transformMat3', () => { - let matr; - describe("with an identity", () => { - beforeEach(() => { matr = [1, 0, 0, 0, 1, 0, 0, 0, 1 ] }); - - beforeEach(() => { result = Vec3.transformMat3(out, vecA, matr); }); - - it("should produce the input", () => { - expect(out).toBeVec(1, 2, 3); - }); - - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("with 90deg about X", () => { - beforeEach(() => { - result = Vec3.transformMat3(out, [0,1,0], [1,0,0,0,0,1,0,-1,0]); - }); - - it("should produce correct output", () => { - expect(out).toBeVec(0,0,1); - }); - }); - - describe("with 90deg about Y", () => { - beforeEach(() => { - result = Vec3.transformMat3(out, [1,0,0], [0,0,-1,0,1,0,1,0,0]); - }); - - it("should produce correct output", () => { - expect(out).toBeVec(0,0,-1); - }); - }); - - describe("with 90deg about Z", () => { - beforeEach(() => { - result = Vec3.transformMat3(out, [1,0,0], [0,1,0,-1,0,0,0,0,1]); - }); - - it("should produce correct output", () => { - expect(out).toBeVec(0,1,0); - }); - }); - - describe("with a lookAt normal matrix", () => { - beforeEach(() => { - matr = mat4.lookAt(mat4.create(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); - let n = mat3.create(); - matr = mat3.transpose(n, mat3.invert(n, mat3.fromMat4(n, matr))); - }); - - beforeEach(() => { result = Vec3.transformMat3(out, [1,0,0], matr); }); - - it("should rotate the input", () => { - expect(out).toBeVec( 0,0,1 ); - }); - - it("should return out", () => { expect(result).toBe(out); }); - }); - });*/ - - describe("transformQuat", () => { - beforeEach(() => { result = Vec3.transformQuat(out, vecA, [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); }); - it("should rotate the input vector", () => { expect(out).toBeVec(1, 2, 3); }); - it("should return out", () => { expect(result).not.toBe([1,2,3,4]); }); - }); - - describe("create", () => { - beforeEach(() => { result = Vec3.create(); }); - it("should return a 3 element array initialized to 0s", () => { expect(result).toBeVec(0, 0, 0); }); - }); - - describe("clone", () => { - beforeEach(() => { result = Vec3.clone(vecA); }); - it("should return a 3 element array initialized to the values in vecA", () => { expect(result).toBeVec(vecA); }); - }); - - describe("fromValues", () => { - beforeEach(() => { result = Vec3.fromValues(1, 2, 3); }); - it("should return a 3 element array initialized to the values passed", () => { expect(result).toBeVec(1, 2, 3); }); - }); - - describe("copy", () => { - beforeEach(() => { result = Vec3.copy(out, vecA); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("set", () => { - beforeEach(() => { result = Vec3.set(out, 1, 2, 3); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("add", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.add(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(5, 7, 9); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.add(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(5, 7, 9); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.add(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(5, 7, 9); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("subtract", () => { - it("should have an alias called 'sub'", () => { expect(Vec3.sub).toEqual(Vec3.subtract); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.subtract(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(-3, -3, -3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.subtract(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-3, -3, -3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.subtract(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(-3, -3, -3); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("multiply", () => { - it("should have an alias called 'mul'", () => { expect(Vec3.mul).toEqual(Vec3.multiply); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.multiply(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(4, 10, 18); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.multiply(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(4, 10, 18); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.multiply(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(4, 10, 18); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("divide", () => { - it("should have an alias called 'div'", () => { expect(Vec3.div).toEqual(Vec3.divide); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.divide(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(0.25, 0.4, 0.5); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.divide(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(0.25, 0.4, 0.5); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.divide(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(0.25, 0.4, 0.5); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("ceil", () => { - beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.ceil(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4, 2); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.ceil(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 4, 2); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("floor", () => { - beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.floor(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 3, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.floor(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 3, 1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("min", () => { - beforeEach(() => { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.min(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 1, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.min(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 1, 1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.min(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(1, 1, 1); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1); }); - }); - }); - - describe("max", () => { - beforeEach(() => { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.max(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 3, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.max(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 3, 3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.max(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3, 3, 3); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1); }); - }); - }); - - /*describe("round", () => { - beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.round(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 3, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.round(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 3, 1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - });*/ - - describe("scale", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.scale(out, vecA, 2); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 4, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.scale(vecA, vecA, 2); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 4, 6); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("scaleAndAdd", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.scaleAndAdd(out, vecA, vecB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4.5, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.scaleAndAdd(vecA, vecA, vecB, 0.5); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 4.5, 6); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.scaleAndAdd(vecB, vecA, vecB, 0.5); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3, 4.5, 6); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("distance", () => { - it("should have an alias called 'dist'", () => { expect(Vec3.dist).toEqual(Vec3.distance); }); - it("should return the distance", () => { expect(Vec3.distance(vecA, vecB)).toBeCloseTo(5.196152); }); - }); - - describe("squaredDistance", () => { - it("should have an alias called 'sqrDist'", () => { expect(Vec3.sqrDist).toEqual(Vec3.squaredDistance); }); - it("should return the squared distance", () => { expect(Vec3.squaredDistance(vecA, vecB)).toEqual(27); }); - }); - - describe("length", () => { - it("should have an alias called 'len'", () => { expect(Vec3.len).toEqual(Vec3.length); }); - it("should return the length", () => { expect(Vec3.len(vecA)).toBeCloseTo(3.741657); }); - }); - - describe("squaredLength", () => { - it("should have an alias called 'sqrLen'", () => { expect(Vec3.sqrLen).toEqual(Vec3.squaredLength); }); - it("should return the squared length", () => { expect(Vec3.squaredLength(vecA)).toEqual(14); }); - }); - - describe("negate", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.negate(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(-1, -2, -3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.negate(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-1, -2, -3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("inverse", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.inverse(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 1/2, 1/3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.inverse(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 1/2, 1/3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("abs", () => { - beforeEach(() => { vecA = [-1, -2, -3]; }); - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.abs(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(-1, -2, -3); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.abs(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("normalize", () => { - beforeEach(() => { vecA = [5, 0, 0]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.normalize(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 0, 0); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(5, 0, 0); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.normalize(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 0, 0); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("dot", () => { - let value: number; - beforeEach(() => { value = Vec3.dot(vecA, vecB); }); - - it("should return the dot product", () => { expect(value).toEqual(32); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("cross", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.cross(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(-3, 6, -3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.cross(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-3, 6, -3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.cross(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(-3, 6, -3); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("lerp", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec3.lerp(out, vecA, vecB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(2.5, 3.5, 4.5); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec3.lerp(vecA, vecA, vecB, 0.5); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2.5, 3.5, 4.5); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec3.lerp(vecB, vecA, vecB, 0.5); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(2.5, 3.5, 4.5); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - }); - }); - - describe("angle", () => { - let value: number; - beforeEach(() => { value = Vec3.angle(vecA, vecB); }); - - it("should return the angle", () => { expect(value).toBeCloseTo(0.225726); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(4, 5, 6); }); - }); - - describe("str", () => { - it("should return a string representation of the vector", () => { expect(Vec3.str(vecA)).toEqual("Vec3(1, 2, 3)"); }); - }); - - describe("exactEquals", () => { - let vecC: Vec3Like, r0: boolean, r1: boolean; - beforeEach(() => { - vecA = [0, 1, 2]; - vecB = [0, 1, 2]; - vecC = [1, 2, 3]; - r0 = Vec3.exactEquals(vecA, vecB); - r1 = Vec3.exactEquals(vecA, vecC); - }); - - it("should return true for identical vectors", () => { expect(r0).toBe(true); }); - it("should return false for different vectors", () => { expect(r1).toBe(false); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(0, 1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 2); }); - }); - - describe("equals", () => { - let vecC: Vec3Like, - vecD: Vec3Like, - r0: boolean, - r1: boolean, - r2: boolean; - beforeEach(() => { - vecA = [0, 1, 2]; - vecB = [0, 1, 2]; - vecC = [1, 2, 3]; - vecD = [1e-16, 1, 2]; - r0 = Vec3.equals(vecA, vecB); - r1 = Vec3.equals(vecA, vecC); - r2 = Vec3.equals(vecA, vecD); - }); - it("should return true for identical vectors", () => { expect(r0).toBe(true); }); - it("should return false for different vectors", () => { expect(r1).toBe(false); }); - it("should return true for close but not identical vectors", () => { expect(r2).toBe(true); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(0, 1, 2); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 2); }); - }); - - describe("zero", () => { - beforeEach(() => { - vecA = [1, 2, 3]; - result = Vec3.zero(vecA); - }); - it("should result in a 3 element vector with zeros", () => { expect(result).toBeVec(0, 0, 0); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/vec4-swizzle.spec.ts b/tests/vec4-swizzle.spec.ts deleted file mode 100644 index 66d512c2..00000000 --- a/tests/vec4-swizzle.spec.ts +++ /dev/null @@ -1,7409 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Vec4 } from "../src/vec4" -import { EnableSwizzles } from '../src/swizzle'; -import "./test-utils" - -describe("Vec4 Swizzles", () => { - EnableSwizzles(); - - let v: Vec4; - beforeEach(() => { v = new Vec4(1, 2, 3); }); - - // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should - // not be modified by hand. - // [Swizzle Autogen] - - describe("Vec4().xx", () => { - it("should return Vec2(x, x)", () => { - expect(v.xx).toBeVec(v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xy", () => { - it("should return Vec2(x, y)", () => { - expect(v.xy).toBeVec(v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xz", () => { - it("should return Vec2(x, z)", () => { - expect(v.xz).toBeVec(v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xw", () => { - it("should return Vec2(x, w)", () => { - expect(v.xw).toBeVec(v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yx", () => { - it("should return Vec2(y, x)", () => { - expect(v.yx).toBeVec(v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yy", () => { - it("should return Vec2(y, y)", () => { - expect(v.yy).toBeVec(v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yz", () => { - it("should return Vec2(y, z)", () => { - expect(v.yz).toBeVec(v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yw", () => { - it("should return Vec2(y, w)", () => { - expect(v.yw).toBeVec(v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zx", () => { - it("should return Vec2(z, x)", () => { - expect(v.zx).toBeVec(v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zy", () => { - it("should return Vec2(z, y)", () => { - expect(v.zy).toBeVec(v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zz", () => { - it("should return Vec2(z, z)", () => { - expect(v.zz).toBeVec(v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zw", () => { - it("should return Vec2(z, w)", () => { - expect(v.zw).toBeVec(v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wx", () => { - it("should return Vec2(w, x)", () => { - expect(v.wx).toBeVec(v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wy", () => { - it("should return Vec2(w, y)", () => { - expect(v.wy).toBeVec(v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wz", () => { - it("should return Vec2(w, z)", () => { - expect(v.wz).toBeVec(v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ww", () => { - it("should return Vec2(w, w)", () => { - expect(v.ww).toBeVec(v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxx", () => { - it("should return Vec3(x, x, x)", () => { - expect(v.xxx).toBeVec(v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxy", () => { - it("should return Vec3(x, x, y)", () => { - expect(v.xxy).toBeVec(v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxz", () => { - it("should return Vec3(x, x, z)", () => { - expect(v.xxz).toBeVec(v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxw", () => { - it("should return Vec3(x, x, w)", () => { - expect(v.xxw).toBeVec(v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyx", () => { - it("should return Vec3(x, y, x)", () => { - expect(v.xyx).toBeVec(v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyy", () => { - it("should return Vec3(x, y, y)", () => { - expect(v.xyy).toBeVec(v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyz", () => { - it("should return Vec3(x, y, z)", () => { - expect(v.xyz).toBeVec(v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyw", () => { - it("should return Vec3(x, y, w)", () => { - expect(v.xyw).toBeVec(v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzx", () => { - it("should return Vec3(x, z, x)", () => { - expect(v.xzx).toBeVec(v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzy", () => { - it("should return Vec3(x, z, y)", () => { - expect(v.xzy).toBeVec(v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzz", () => { - it("should return Vec3(x, z, z)", () => { - expect(v.xzz).toBeVec(v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzw", () => { - it("should return Vec3(x, z, w)", () => { - expect(v.xzw).toBeVec(v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwx", () => { - it("should return Vec3(x, w, x)", () => { - expect(v.xwx).toBeVec(v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwy", () => { - it("should return Vec3(x, w, y)", () => { - expect(v.xwy).toBeVec(v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwz", () => { - it("should return Vec3(x, w, z)", () => { - expect(v.xwz).toBeVec(v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xww", () => { - it("should return Vec3(x, w, w)", () => { - expect(v.xww).toBeVec(v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxx", () => { - it("should return Vec3(y, x, x)", () => { - expect(v.yxx).toBeVec(v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxy", () => { - it("should return Vec3(y, x, y)", () => { - expect(v.yxy).toBeVec(v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxz", () => { - it("should return Vec3(y, x, z)", () => { - expect(v.yxz).toBeVec(v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxw", () => { - it("should return Vec3(y, x, w)", () => { - expect(v.yxw).toBeVec(v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyx", () => { - it("should return Vec3(y, y, x)", () => { - expect(v.yyx).toBeVec(v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyy", () => { - it("should return Vec3(y, y, y)", () => { - expect(v.yyy).toBeVec(v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyz", () => { - it("should return Vec3(y, y, z)", () => { - expect(v.yyz).toBeVec(v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyw", () => { - it("should return Vec3(y, y, w)", () => { - expect(v.yyw).toBeVec(v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzx", () => { - it("should return Vec3(y, z, x)", () => { - expect(v.yzx).toBeVec(v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzy", () => { - it("should return Vec3(y, z, y)", () => { - expect(v.yzy).toBeVec(v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzz", () => { - it("should return Vec3(y, z, z)", () => { - expect(v.yzz).toBeVec(v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzw", () => { - it("should return Vec3(y, z, w)", () => { - expect(v.yzw).toBeVec(v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywx", () => { - it("should return Vec3(y, w, x)", () => { - expect(v.ywx).toBeVec(v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ywx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywy", () => { - it("should return Vec3(y, w, y)", () => { - expect(v.ywy).toBeVec(v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ywy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywz", () => { - it("should return Vec3(y, w, z)", () => { - expect(v.ywz).toBeVec(v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ywz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yww", () => { - it("should return Vec3(y, w, w)", () => { - expect(v.yww).toBeVec(v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxx", () => { - it("should return Vec3(z, x, x)", () => { - expect(v.zxx).toBeVec(v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxy", () => { - it("should return Vec3(z, x, y)", () => { - expect(v.zxy).toBeVec(v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxz", () => { - it("should return Vec3(z, x, z)", () => { - expect(v.zxz).toBeVec(v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxw", () => { - it("should return Vec3(z, x, w)", () => { - expect(v.zxw).toBeVec(v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyx", () => { - it("should return Vec3(z, y, x)", () => { - expect(v.zyx).toBeVec(v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyy", () => { - it("should return Vec3(z, y, y)", () => { - expect(v.zyy).toBeVec(v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyz", () => { - it("should return Vec3(z, y, z)", () => { - expect(v.zyz).toBeVec(v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyw", () => { - it("should return Vec3(z, y, w)", () => { - expect(v.zyw).toBeVec(v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzx", () => { - it("should return Vec3(z, z, x)", () => { - expect(v.zzx).toBeVec(v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzy", () => { - it("should return Vec3(z, z, y)", () => { - expect(v.zzy).toBeVec(v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzz", () => { - it("should return Vec3(z, z, z)", () => { - expect(v.zzz).toBeVec(v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzw", () => { - it("should return Vec3(z, z, w)", () => { - expect(v.zzw).toBeVec(v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwx", () => { - it("should return Vec3(z, w, x)", () => { - expect(v.zwx).toBeVec(v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwy", () => { - it("should return Vec3(z, w, y)", () => { - expect(v.zwy).toBeVec(v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwz", () => { - it("should return Vec3(z, w, z)", () => { - expect(v.zwz).toBeVec(v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zww", () => { - it("should return Vec3(z, w, w)", () => { - expect(v.zww).toBeVec(v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxx", () => { - it("should return Vec3(w, x, x)", () => { - expect(v.wxx).toBeVec(v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxy", () => { - it("should return Vec3(w, x, y)", () => { - expect(v.wxy).toBeVec(v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxz", () => { - it("should return Vec3(w, x, z)", () => { - expect(v.wxz).toBeVec(v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxw", () => { - it("should return Vec3(w, x, w)", () => { - expect(v.wxw).toBeVec(v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyx", () => { - it("should return Vec3(w, y, x)", () => { - expect(v.wyx).toBeVec(v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyy", () => { - it("should return Vec3(w, y, y)", () => { - expect(v.wyy).toBeVec(v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyz", () => { - it("should return Vec3(w, y, z)", () => { - expect(v.wyz).toBeVec(v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyw", () => { - it("should return Vec3(w, y, w)", () => { - expect(v.wyw).toBeVec(v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzx", () => { - it("should return Vec3(w, z, x)", () => { - expect(v.wzx).toBeVec(v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzy", () => { - it("should return Vec3(w, z, y)", () => { - expect(v.wzy).toBeVec(v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzz", () => { - it("should return Vec3(w, z, z)", () => { - expect(v.wzz).toBeVec(v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzw", () => { - it("should return Vec3(w, z, w)", () => { - expect(v.wzw).toBeVec(v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwx", () => { - it("should return Vec3(w, w, x)", () => { - expect(v.wwx).toBeVec(v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwy", () => { - it("should return Vec3(w, w, y)", () => { - expect(v.wwy).toBeVec(v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwz", () => { - it("should return Vec3(w, w, z)", () => { - expect(v.wwz).toBeVec(v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().www", () => { - it("should return Vec3(w, w, w)", () => { - expect(v.www).toBeVec(v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.www; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxxx", () => { - it("should return Vec4(x, x, x, x)", () => { - expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxxy", () => { - it("should return Vec4(x, x, x, y)", () => { - expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxxz", () => { - it("should return Vec4(x, x, x, z)", () => { - expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxxw", () => { - it("should return Vec4(x, x, x, w)", () => { - expect(v.xxxw).toBeVec(v[0], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xxxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxyx", () => { - it("should return Vec4(x, x, y, x)", () => { - expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxyy", () => { - it("should return Vec4(x, x, y, y)", () => { - expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxyz", () => { - it("should return Vec4(x, x, y, z)", () => { - expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxyw", () => { - it("should return Vec4(x, x, y, w)", () => { - expect(v.xxyw).toBeVec(v[0], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xxyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxzx", () => { - it("should return Vec4(x, x, z, x)", () => { - expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxzy", () => { - it("should return Vec4(x, x, z, y)", () => { - expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxzz", () => { - it("should return Vec4(x, x, z, z)", () => { - expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxzw", () => { - it("should return Vec4(x, x, z, w)", () => { - expect(v.xxzw).toBeVec(v[0], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xxzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxwx", () => { - it("should return Vec4(x, x, w, x)", () => { - expect(v.xxwx).toBeVec(v[0], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xxwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxwy", () => { - it("should return Vec4(x, x, w, y)", () => { - expect(v.xxwy).toBeVec(v[0], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xxwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxwz", () => { - it("should return Vec4(x, x, w, z)", () => { - expect(v.xxwz).toBeVec(v[0], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xxwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xxww", () => { - it("should return Vec4(x, x, w, w)", () => { - expect(v.xxww).toBeVec(v[0], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xxww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyxx", () => { - it("should return Vec4(x, y, x, x)", () => { - expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyxy", () => { - it("should return Vec4(x, y, x, y)", () => { - expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyxz", () => { - it("should return Vec4(x, y, x, z)", () => { - expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyxw", () => { - it("should return Vec4(x, y, x, w)", () => { - expect(v.xyxw).toBeVec(v[0], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xyxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyyx", () => { - it("should return Vec4(x, y, y, x)", () => { - expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyyy", () => { - it("should return Vec4(x, y, y, y)", () => { - expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyyz", () => { - it("should return Vec4(x, y, y, z)", () => { - expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyyw", () => { - it("should return Vec4(x, y, y, w)", () => { - expect(v.xyyw).toBeVec(v[0], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xyyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyzx", () => { - it("should return Vec4(x, y, z, x)", () => { - expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyzy", () => { - it("should return Vec4(x, y, z, y)", () => { - expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyzz", () => { - it("should return Vec4(x, y, z, z)", () => { - expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyzw", () => { - it("should return Vec4(x, y, z, w)", () => { - expect(v.xyzw).toBeVec(v[0], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xyzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xywx", () => { - it("should return Vec4(x, y, w, x)", () => { - expect(v.xywx).toBeVec(v[0], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xywx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xywy", () => { - it("should return Vec4(x, y, w, y)", () => { - expect(v.xywy).toBeVec(v[0], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xywy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xywz", () => { - it("should return Vec4(x, y, w, z)", () => { - expect(v.xywz).toBeVec(v[0], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xywz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xyww", () => { - it("should return Vec4(x, y, w, w)", () => { - expect(v.xyww).toBeVec(v[0], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xyww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzxx", () => { - it("should return Vec4(x, z, x, x)", () => { - expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzxy", () => { - it("should return Vec4(x, z, x, y)", () => { - expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzxz", () => { - it("should return Vec4(x, z, x, z)", () => { - expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzxw", () => { - it("should return Vec4(x, z, x, w)", () => { - expect(v.xzxw).toBeVec(v[0], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xzxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzyx", () => { - it("should return Vec4(x, z, y, x)", () => { - expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzyy", () => { - it("should return Vec4(x, z, y, y)", () => { - expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzyz", () => { - it("should return Vec4(x, z, y, z)", () => { - expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzyw", () => { - it("should return Vec4(x, z, y, w)", () => { - expect(v.xzyw).toBeVec(v[0], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xzyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzzx", () => { - it("should return Vec4(x, z, z, x)", () => { - expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzzy", () => { - it("should return Vec4(x, z, z, y)", () => { - expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzzz", () => { - it("should return Vec4(x, z, z, z)", () => { - expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzzw", () => { - it("should return Vec4(x, z, z, w)", () => { - expect(v.xzzw).toBeVec(v[0], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xzzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzwx", () => { - it("should return Vec4(x, z, w, x)", () => { - expect(v.xzwx).toBeVec(v[0], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xzwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzwy", () => { - it("should return Vec4(x, z, w, y)", () => { - expect(v.xzwy).toBeVec(v[0], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xzwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzwz", () => { - it("should return Vec4(x, z, w, z)", () => { - expect(v.xzwz).toBeVec(v[0], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xzwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xzww", () => { - it("should return Vec4(x, z, w, w)", () => { - expect(v.xzww).toBeVec(v[0], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xzww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwxx", () => { - it("should return Vec4(x, w, x, x)", () => { - expect(v.xwxx).toBeVec(v[0], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xwxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwxy", () => { - it("should return Vec4(x, w, x, y)", () => { - expect(v.xwxy).toBeVec(v[0], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xwxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwxz", () => { - it("should return Vec4(x, w, x, z)", () => { - expect(v.xwxz).toBeVec(v[0], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xwxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwxw", () => { - it("should return Vec4(x, w, x, w)", () => { - expect(v.xwxw).toBeVec(v[0], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xwxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwyx", () => { - it("should return Vec4(x, w, y, x)", () => { - expect(v.xwyx).toBeVec(v[0], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xwyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwyy", () => { - it("should return Vec4(x, w, y, y)", () => { - expect(v.xwyy).toBeVec(v[0], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xwyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwyz", () => { - it("should return Vec4(x, w, y, z)", () => { - expect(v.xwyz).toBeVec(v[0], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xwyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwyw", () => { - it("should return Vec4(x, w, y, w)", () => { - expect(v.xwyw).toBeVec(v[0], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xwyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwzx", () => { - it("should return Vec4(x, w, z, x)", () => { - expect(v.xwzx).toBeVec(v[0], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xwzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwzy", () => { - it("should return Vec4(x, w, z, y)", () => { - expect(v.xwzy).toBeVec(v[0], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xwzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwzz", () => { - it("should return Vec4(x, w, z, z)", () => { - expect(v.xwzz).toBeVec(v[0], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xwzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwzw", () => { - it("should return Vec4(x, w, z, w)", () => { - expect(v.xwzw).toBeVec(v[0], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xwzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwwx", () => { - it("should return Vec4(x, w, w, x)", () => { - expect(v.xwwx).toBeVec(v[0], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.xwwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwwy", () => { - it("should return Vec4(x, w, w, y)", () => { - expect(v.xwwy).toBeVec(v[0], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.xwwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwwz", () => { - it("should return Vec4(x, w, w, z)", () => { - expect(v.xwwz).toBeVec(v[0], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.xwwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().xwww", () => { - it("should return Vec4(x, w, w, w)", () => { - expect(v.xwww).toBeVec(v[0], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.xwww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxxx", () => { - it("should return Vec4(y, x, x, x)", () => { - expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxxy", () => { - it("should return Vec4(y, x, x, y)", () => { - expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxxz", () => { - it("should return Vec4(y, x, x, z)", () => { - expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxxw", () => { - it("should return Vec4(y, x, x, w)", () => { - expect(v.yxxw).toBeVec(v[1], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yxxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxyx", () => { - it("should return Vec4(y, x, y, x)", () => { - expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxyy", () => { - it("should return Vec4(y, x, y, y)", () => { - expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxyz", () => { - it("should return Vec4(y, x, y, z)", () => { - expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxyw", () => { - it("should return Vec4(y, x, y, w)", () => { - expect(v.yxyw).toBeVec(v[1], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yxyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxzx", () => { - it("should return Vec4(y, x, z, x)", () => { - expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxzy", () => { - it("should return Vec4(y, x, z, y)", () => { - expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxzz", () => { - it("should return Vec4(y, x, z, z)", () => { - expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxzw", () => { - it("should return Vec4(y, x, z, w)", () => { - expect(v.yxzw).toBeVec(v[1], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yxzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxwx", () => { - it("should return Vec4(y, x, w, x)", () => { - expect(v.yxwx).toBeVec(v[1], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yxwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxwy", () => { - it("should return Vec4(y, x, w, y)", () => { - expect(v.yxwy).toBeVec(v[1], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yxwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxwz", () => { - it("should return Vec4(y, x, w, z)", () => { - expect(v.yxwz).toBeVec(v[1], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yxwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yxww", () => { - it("should return Vec4(y, x, w, w)", () => { - expect(v.yxww).toBeVec(v[1], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yxww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyxx", () => { - it("should return Vec4(y, y, x, x)", () => { - expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyxy", () => { - it("should return Vec4(y, y, x, y)", () => { - expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyxz", () => { - it("should return Vec4(y, y, x, z)", () => { - expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyxw", () => { - it("should return Vec4(y, y, x, w)", () => { - expect(v.yyxw).toBeVec(v[1], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yyxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyyx", () => { - it("should return Vec4(y, y, y, x)", () => { - expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyyy", () => { - it("should return Vec4(y, y, y, y)", () => { - expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyyz", () => { - it("should return Vec4(y, y, y, z)", () => { - expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyyw", () => { - it("should return Vec4(y, y, y, w)", () => { - expect(v.yyyw).toBeVec(v[1], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yyyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyzx", () => { - it("should return Vec4(y, y, z, x)", () => { - expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyzy", () => { - it("should return Vec4(y, y, z, y)", () => { - expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyzz", () => { - it("should return Vec4(y, y, z, z)", () => { - expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyzw", () => { - it("should return Vec4(y, y, z, w)", () => { - expect(v.yyzw).toBeVec(v[1], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yyzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yywx", () => { - it("should return Vec4(y, y, w, x)", () => { - expect(v.yywx).toBeVec(v[1], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yywx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yywy", () => { - it("should return Vec4(y, y, w, y)", () => { - expect(v.yywy).toBeVec(v[1], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yywy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yywz", () => { - it("should return Vec4(y, y, w, z)", () => { - expect(v.yywz).toBeVec(v[1], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yywz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yyww", () => { - it("should return Vec4(y, y, w, w)", () => { - expect(v.yyww).toBeVec(v[1], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yyww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzxx", () => { - it("should return Vec4(y, z, x, x)", () => { - expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzxy", () => { - it("should return Vec4(y, z, x, y)", () => { - expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzxz", () => { - it("should return Vec4(y, z, x, z)", () => { - expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzxw", () => { - it("should return Vec4(y, z, x, w)", () => { - expect(v.yzxw).toBeVec(v[1], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yzxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzyx", () => { - it("should return Vec4(y, z, y, x)", () => { - expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzyy", () => { - it("should return Vec4(y, z, y, y)", () => { - expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzyz", () => { - it("should return Vec4(y, z, y, z)", () => { - expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzyw", () => { - it("should return Vec4(y, z, y, w)", () => { - expect(v.yzyw).toBeVec(v[1], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yzyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzzx", () => { - it("should return Vec4(y, z, z, x)", () => { - expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzzy", () => { - it("should return Vec4(y, z, z, y)", () => { - expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzzz", () => { - it("should return Vec4(y, z, z, z)", () => { - expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzzw", () => { - it("should return Vec4(y, z, z, w)", () => { - expect(v.yzzw).toBeVec(v[1], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yzzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzwx", () => { - it("should return Vec4(y, z, w, x)", () => { - expect(v.yzwx).toBeVec(v[1], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.yzwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzwy", () => { - it("should return Vec4(y, z, w, y)", () => { - expect(v.yzwy).toBeVec(v[1], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.yzwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzwz", () => { - it("should return Vec4(y, z, w, z)", () => { - expect(v.yzwz).toBeVec(v[1], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.yzwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().yzww", () => { - it("should return Vec4(y, z, w, w)", () => { - expect(v.yzww).toBeVec(v[1], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.yzww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywxx", () => { - it("should return Vec4(y, w, x, x)", () => { - expect(v.ywxx).toBeVec(v[1], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ywxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywxy", () => { - it("should return Vec4(y, w, x, y)", () => { - expect(v.ywxy).toBeVec(v[1], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ywxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywxz", () => { - it("should return Vec4(y, w, x, z)", () => { - expect(v.ywxz).toBeVec(v[1], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ywxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywxw", () => { - it("should return Vec4(y, w, x, w)", () => { - expect(v.ywxw).toBeVec(v[1], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ywxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywyx", () => { - it("should return Vec4(y, w, y, x)", () => { - expect(v.ywyx).toBeVec(v[1], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ywyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywyy", () => { - it("should return Vec4(y, w, y, y)", () => { - expect(v.ywyy).toBeVec(v[1], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ywyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywyz", () => { - it("should return Vec4(y, w, y, z)", () => { - expect(v.ywyz).toBeVec(v[1], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ywyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywyw", () => { - it("should return Vec4(y, w, y, w)", () => { - expect(v.ywyw).toBeVec(v[1], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ywyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywzx", () => { - it("should return Vec4(y, w, z, x)", () => { - expect(v.ywzx).toBeVec(v[1], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ywzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywzy", () => { - it("should return Vec4(y, w, z, y)", () => { - expect(v.ywzy).toBeVec(v[1], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ywzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywzz", () => { - it("should return Vec4(y, w, z, z)", () => { - expect(v.ywzz).toBeVec(v[1], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ywzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywzw", () => { - it("should return Vec4(y, w, z, w)", () => { - expect(v.ywzw).toBeVec(v[1], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ywzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywwx", () => { - it("should return Vec4(y, w, w, x)", () => { - expect(v.ywwx).toBeVec(v[1], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ywwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywwy", () => { - it("should return Vec4(y, w, w, y)", () => { - expect(v.ywwy).toBeVec(v[1], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ywwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywwz", () => { - it("should return Vec4(y, w, w, z)", () => { - expect(v.ywwz).toBeVec(v[1], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ywwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ywww", () => { - it("should return Vec4(y, w, w, w)", () => { - expect(v.ywww).toBeVec(v[1], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ywww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxxx", () => { - it("should return Vec4(z, x, x, x)", () => { - expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxxy", () => { - it("should return Vec4(z, x, x, y)", () => { - expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxxz", () => { - it("should return Vec4(z, x, x, z)", () => { - expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxxw", () => { - it("should return Vec4(z, x, x, w)", () => { - expect(v.zxxw).toBeVec(v[2], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zxxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxyx", () => { - it("should return Vec4(z, x, y, x)", () => { - expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxyy", () => { - it("should return Vec4(z, x, y, y)", () => { - expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxyz", () => { - it("should return Vec4(z, x, y, z)", () => { - expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxyw", () => { - it("should return Vec4(z, x, y, w)", () => { - expect(v.zxyw).toBeVec(v[2], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zxyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxzx", () => { - it("should return Vec4(z, x, z, x)", () => { - expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxzy", () => { - it("should return Vec4(z, x, z, y)", () => { - expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxzz", () => { - it("should return Vec4(z, x, z, z)", () => { - expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxzw", () => { - it("should return Vec4(z, x, z, w)", () => { - expect(v.zxzw).toBeVec(v[2], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zxzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxwx", () => { - it("should return Vec4(z, x, w, x)", () => { - expect(v.zxwx).toBeVec(v[2], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zxwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxwy", () => { - it("should return Vec4(z, x, w, y)", () => { - expect(v.zxwy).toBeVec(v[2], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zxwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxwz", () => { - it("should return Vec4(z, x, w, z)", () => { - expect(v.zxwz).toBeVec(v[2], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zxwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zxww", () => { - it("should return Vec4(z, x, w, w)", () => { - expect(v.zxww).toBeVec(v[2], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zxww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyxx", () => { - it("should return Vec4(z, y, x, x)", () => { - expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyxy", () => { - it("should return Vec4(z, y, x, y)", () => { - expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyxz", () => { - it("should return Vec4(z, y, x, z)", () => { - expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyxw", () => { - it("should return Vec4(z, y, x, w)", () => { - expect(v.zyxw).toBeVec(v[2], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zyxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyyx", () => { - it("should return Vec4(z, y, y, x)", () => { - expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyyy", () => { - it("should return Vec4(z, y, y, y)", () => { - expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyyz", () => { - it("should return Vec4(z, y, y, z)", () => { - expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyyw", () => { - it("should return Vec4(z, y, y, w)", () => { - expect(v.zyyw).toBeVec(v[2], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zyyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyzx", () => { - it("should return Vec4(z, y, z, x)", () => { - expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyzy", () => { - it("should return Vec4(z, y, z, y)", () => { - expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyzz", () => { - it("should return Vec4(z, y, z, z)", () => { - expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyzw", () => { - it("should return Vec4(z, y, z, w)", () => { - expect(v.zyzw).toBeVec(v[2], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zyzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zywx", () => { - it("should return Vec4(z, y, w, x)", () => { - expect(v.zywx).toBeVec(v[2], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zywx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zywy", () => { - it("should return Vec4(z, y, w, y)", () => { - expect(v.zywy).toBeVec(v[2], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zywy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zywz", () => { - it("should return Vec4(z, y, w, z)", () => { - expect(v.zywz).toBeVec(v[2], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zywz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zyww", () => { - it("should return Vec4(z, y, w, w)", () => { - expect(v.zyww).toBeVec(v[2], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zyww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzxx", () => { - it("should return Vec4(z, z, x, x)", () => { - expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzxy", () => { - it("should return Vec4(z, z, x, y)", () => { - expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzxz", () => { - it("should return Vec4(z, z, x, z)", () => { - expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzxw", () => { - it("should return Vec4(z, z, x, w)", () => { - expect(v.zzxw).toBeVec(v[2], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zzxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzyx", () => { - it("should return Vec4(z, z, y, x)", () => { - expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzyy", () => { - it("should return Vec4(z, z, y, y)", () => { - expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzyz", () => { - it("should return Vec4(z, z, y, z)", () => { - expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzyw", () => { - it("should return Vec4(z, z, y, w)", () => { - expect(v.zzyw).toBeVec(v[2], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zzyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzzx", () => { - it("should return Vec4(z, z, z, x)", () => { - expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzzy", () => { - it("should return Vec4(z, z, z, y)", () => { - expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzzz", () => { - it("should return Vec4(z, z, z, z)", () => { - expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzzw", () => { - it("should return Vec4(z, z, z, w)", () => { - expect(v.zzzw).toBeVec(v[2], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zzzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzwx", () => { - it("should return Vec4(z, z, w, x)", () => { - expect(v.zzwx).toBeVec(v[2], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zzwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzwy", () => { - it("should return Vec4(z, z, w, y)", () => { - expect(v.zzwy).toBeVec(v[2], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zzwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzwz", () => { - it("should return Vec4(z, z, w, z)", () => { - expect(v.zzwz).toBeVec(v[2], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zzwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zzww", () => { - it("should return Vec4(z, z, w, w)", () => { - expect(v.zzww).toBeVec(v[2], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zzww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwxx", () => { - it("should return Vec4(z, w, x, x)", () => { - expect(v.zwxx).toBeVec(v[2], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zwxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwxy", () => { - it("should return Vec4(z, w, x, y)", () => { - expect(v.zwxy).toBeVec(v[2], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zwxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwxz", () => { - it("should return Vec4(z, w, x, z)", () => { - expect(v.zwxz).toBeVec(v[2], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zwxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwxw", () => { - it("should return Vec4(z, w, x, w)", () => { - expect(v.zwxw).toBeVec(v[2], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zwxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwyx", () => { - it("should return Vec4(z, w, y, x)", () => { - expect(v.zwyx).toBeVec(v[2], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zwyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwyy", () => { - it("should return Vec4(z, w, y, y)", () => { - expect(v.zwyy).toBeVec(v[2], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zwyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwyz", () => { - it("should return Vec4(z, w, y, z)", () => { - expect(v.zwyz).toBeVec(v[2], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zwyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwyw", () => { - it("should return Vec4(z, w, y, w)", () => { - expect(v.zwyw).toBeVec(v[2], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zwyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwzx", () => { - it("should return Vec4(z, w, z, x)", () => { - expect(v.zwzx).toBeVec(v[2], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zwzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwzy", () => { - it("should return Vec4(z, w, z, y)", () => { - expect(v.zwzy).toBeVec(v[2], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zwzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwzz", () => { - it("should return Vec4(z, w, z, z)", () => { - expect(v.zwzz).toBeVec(v[2], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zwzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwzw", () => { - it("should return Vec4(z, w, z, w)", () => { - expect(v.zwzw).toBeVec(v[2], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zwzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwwx", () => { - it("should return Vec4(z, w, w, x)", () => { - expect(v.zwwx).toBeVec(v[2], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.zwwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwwy", () => { - it("should return Vec4(z, w, w, y)", () => { - expect(v.zwwy).toBeVec(v[2], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.zwwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwwz", () => { - it("should return Vec4(z, w, w, z)", () => { - expect(v.zwwz).toBeVec(v[2], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.zwwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().zwww", () => { - it("should return Vec4(z, w, w, w)", () => { - expect(v.zwww).toBeVec(v[2], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.zwww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxxx", () => { - it("should return Vec4(w, x, x, x)", () => { - expect(v.wxxx).toBeVec(v[3], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wxxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxxy", () => { - it("should return Vec4(w, x, x, y)", () => { - expect(v.wxxy).toBeVec(v[3], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wxxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxxz", () => { - it("should return Vec4(w, x, x, z)", () => { - expect(v.wxxz).toBeVec(v[3], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wxxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxxw", () => { - it("should return Vec4(w, x, x, w)", () => { - expect(v.wxxw).toBeVec(v[3], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wxxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxyx", () => { - it("should return Vec4(w, x, y, x)", () => { - expect(v.wxyx).toBeVec(v[3], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wxyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxyy", () => { - it("should return Vec4(w, x, y, y)", () => { - expect(v.wxyy).toBeVec(v[3], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wxyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxyz", () => { - it("should return Vec4(w, x, y, z)", () => { - expect(v.wxyz).toBeVec(v[3], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wxyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxyw", () => { - it("should return Vec4(w, x, y, w)", () => { - expect(v.wxyw).toBeVec(v[3], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wxyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxzx", () => { - it("should return Vec4(w, x, z, x)", () => { - expect(v.wxzx).toBeVec(v[3], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wxzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxzy", () => { - it("should return Vec4(w, x, z, y)", () => { - expect(v.wxzy).toBeVec(v[3], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wxzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxzz", () => { - it("should return Vec4(w, x, z, z)", () => { - expect(v.wxzz).toBeVec(v[3], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wxzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxzw", () => { - it("should return Vec4(w, x, z, w)", () => { - expect(v.wxzw).toBeVec(v[3], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wxzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxwx", () => { - it("should return Vec4(w, x, w, x)", () => { - expect(v.wxwx).toBeVec(v[3], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wxwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxwy", () => { - it("should return Vec4(w, x, w, y)", () => { - expect(v.wxwy).toBeVec(v[3], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wxwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxwz", () => { - it("should return Vec4(w, x, w, z)", () => { - expect(v.wxwz).toBeVec(v[3], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wxwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wxww", () => { - it("should return Vec4(w, x, w, w)", () => { - expect(v.wxww).toBeVec(v[3], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wxww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyxx", () => { - it("should return Vec4(w, y, x, x)", () => { - expect(v.wyxx).toBeVec(v[3], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wyxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyxy", () => { - it("should return Vec4(w, y, x, y)", () => { - expect(v.wyxy).toBeVec(v[3], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wyxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyxz", () => { - it("should return Vec4(w, y, x, z)", () => { - expect(v.wyxz).toBeVec(v[3], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wyxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyxw", () => { - it("should return Vec4(w, y, x, w)", () => { - expect(v.wyxw).toBeVec(v[3], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wyxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyyx", () => { - it("should return Vec4(w, y, y, x)", () => { - expect(v.wyyx).toBeVec(v[3], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wyyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyyy", () => { - it("should return Vec4(w, y, y, y)", () => { - expect(v.wyyy).toBeVec(v[3], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wyyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyyz", () => { - it("should return Vec4(w, y, y, z)", () => { - expect(v.wyyz).toBeVec(v[3], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wyyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyyw", () => { - it("should return Vec4(w, y, y, w)", () => { - expect(v.wyyw).toBeVec(v[3], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wyyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyzx", () => { - it("should return Vec4(w, y, z, x)", () => { - expect(v.wyzx).toBeVec(v[3], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wyzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyzy", () => { - it("should return Vec4(w, y, z, y)", () => { - expect(v.wyzy).toBeVec(v[3], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wyzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyzz", () => { - it("should return Vec4(w, y, z, z)", () => { - expect(v.wyzz).toBeVec(v[3], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wyzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyzw", () => { - it("should return Vec4(w, y, z, w)", () => { - expect(v.wyzw).toBeVec(v[3], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wyzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wywx", () => { - it("should return Vec4(w, y, w, x)", () => { - expect(v.wywx).toBeVec(v[3], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wywx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wywy", () => { - it("should return Vec4(w, y, w, y)", () => { - expect(v.wywy).toBeVec(v[3], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wywy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wywz", () => { - it("should return Vec4(w, y, w, z)", () => { - expect(v.wywz).toBeVec(v[3], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wywz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wyww", () => { - it("should return Vec4(w, y, w, w)", () => { - expect(v.wyww).toBeVec(v[3], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wyww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzxx", () => { - it("should return Vec4(w, z, x, x)", () => { - expect(v.wzxx).toBeVec(v[3], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wzxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzxy", () => { - it("should return Vec4(w, z, x, y)", () => { - expect(v.wzxy).toBeVec(v[3], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wzxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzxz", () => { - it("should return Vec4(w, z, x, z)", () => { - expect(v.wzxz).toBeVec(v[3], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wzxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzxw", () => { - it("should return Vec4(w, z, x, w)", () => { - expect(v.wzxw).toBeVec(v[3], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wzxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzyx", () => { - it("should return Vec4(w, z, y, x)", () => { - expect(v.wzyx).toBeVec(v[3], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wzyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzyy", () => { - it("should return Vec4(w, z, y, y)", () => { - expect(v.wzyy).toBeVec(v[3], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wzyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzyz", () => { - it("should return Vec4(w, z, y, z)", () => { - expect(v.wzyz).toBeVec(v[3], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wzyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzyw", () => { - it("should return Vec4(w, z, y, w)", () => { - expect(v.wzyw).toBeVec(v[3], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wzyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzzx", () => { - it("should return Vec4(w, z, z, x)", () => { - expect(v.wzzx).toBeVec(v[3], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wzzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzzy", () => { - it("should return Vec4(w, z, z, y)", () => { - expect(v.wzzy).toBeVec(v[3], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wzzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzzz", () => { - it("should return Vec4(w, z, z, z)", () => { - expect(v.wzzz).toBeVec(v[3], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wzzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzzw", () => { - it("should return Vec4(w, z, z, w)", () => { - expect(v.wzzw).toBeVec(v[3], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wzzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzwx", () => { - it("should return Vec4(w, z, w, x)", () => { - expect(v.wzwx).toBeVec(v[3], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wzwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzwy", () => { - it("should return Vec4(w, z, w, y)", () => { - expect(v.wzwy).toBeVec(v[3], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wzwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzwz", () => { - it("should return Vec4(w, z, w, z)", () => { - expect(v.wzwz).toBeVec(v[3], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wzwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wzww", () => { - it("should return Vec4(w, z, w, w)", () => { - expect(v.wzww).toBeVec(v[3], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wzww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwxx", () => { - it("should return Vec4(w, w, x, x)", () => { - expect(v.wwxx).toBeVec(v[3], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wwxx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwxy", () => { - it("should return Vec4(w, w, x, y)", () => { - expect(v.wwxy).toBeVec(v[3], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wwxy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwxz", () => { - it("should return Vec4(w, w, x, z)", () => { - expect(v.wwxz).toBeVec(v[3], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wwxz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwxw", () => { - it("should return Vec4(w, w, x, w)", () => { - expect(v.wwxw).toBeVec(v[3], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wwxw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwyx", () => { - it("should return Vec4(w, w, y, x)", () => { - expect(v.wwyx).toBeVec(v[3], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wwyx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwyy", () => { - it("should return Vec4(w, w, y, y)", () => { - expect(v.wwyy).toBeVec(v[3], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wwyy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwyz", () => { - it("should return Vec4(w, w, y, z)", () => { - expect(v.wwyz).toBeVec(v[3], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wwyz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwyw", () => { - it("should return Vec4(w, w, y, w)", () => { - expect(v.wwyw).toBeVec(v[3], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wwyw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwzx", () => { - it("should return Vec4(w, w, z, x)", () => { - expect(v.wwzx).toBeVec(v[3], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wwzx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwzy", () => { - it("should return Vec4(w, w, z, y)", () => { - expect(v.wwzy).toBeVec(v[3], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wwzy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwzz", () => { - it("should return Vec4(w, w, z, z)", () => { - expect(v.wwzz).toBeVec(v[3], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wwzz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwzw", () => { - it("should return Vec4(w, w, z, w)", () => { - expect(v.wwzw).toBeVec(v[3], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wwzw; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwwx", () => { - it("should return Vec4(w, w, w, x)", () => { - expect(v.wwwx).toBeVec(v[3], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.wwwx; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwwy", () => { - it("should return Vec4(w, w, w, y)", () => { - expect(v.wwwy).toBeVec(v[3], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.wwwy; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwwz", () => { - it("should return Vec4(w, w, w, z)", () => { - expect(v.wwwz).toBeVec(v[3], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.wwwz; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().wwww", () => { - it("should return Vec4(w, w, w, w)", () => { - expect(v.wwww).toBeVec(v[3], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.wwww; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rr", () => { - it("should return Vec2(r, r)", () => { - expect(v.rr).toBeVec(v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rg", () => { - it("should return Vec2(r, g)", () => { - expect(v.rg).toBeVec(v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rb", () => { - it("should return Vec2(r, b)", () => { - expect(v.rb).toBeVec(v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ra", () => { - it("should return Vec2(r, a)", () => { - expect(v.ra).toBeVec(v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gr", () => { - it("should return Vec2(g, r)", () => { - expect(v.gr).toBeVec(v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gg", () => { - it("should return Vec2(g, g)", () => { - expect(v.gg).toBeVec(v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gb", () => { - it("should return Vec2(g, b)", () => { - expect(v.gb).toBeVec(v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ga", () => { - it("should return Vec2(g, a)", () => { - expect(v.ga).toBeVec(v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().br", () => { - it("should return Vec2(b, r)", () => { - expect(v.br).toBeVec(v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.br; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bg", () => { - it("should return Vec2(b, g)", () => { - expect(v.bg).toBeVec(v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bb", () => { - it("should return Vec2(b, b)", () => { - expect(v.bb).toBeVec(v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ba", () => { - it("should return Vec2(b, a)", () => { - expect(v.ba).toBeVec(v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ar", () => { - it("should return Vec2(a, r)", () => { - expect(v.ar).toBeVec(v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ag", () => { - it("should return Vec2(a, g)", () => { - expect(v.ag).toBeVec(v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ab", () => { - it("should return Vec2(a, b)", () => { - expect(v.ab).toBeVec(v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aa", () => { - it("should return Vec2(a, a)", () => { - expect(v.aa).toBeVec(v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrr", () => { - it("should return Vec3(r, r, r)", () => { - expect(v.rrr).toBeVec(v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrg", () => { - it("should return Vec3(r, r, g)", () => { - expect(v.rrg).toBeVec(v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrb", () => { - it("should return Vec3(r, r, b)", () => { - expect(v.rrb).toBeVec(v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rra", () => { - it("should return Vec3(r, r, a)", () => { - expect(v.rra).toBeVec(v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgr", () => { - it("should return Vec3(r, g, r)", () => { - expect(v.rgr).toBeVec(v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgg", () => { - it("should return Vec3(r, g, g)", () => { - expect(v.rgg).toBeVec(v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgb", () => { - it("should return Vec3(r, g, b)", () => { - expect(v.rgb).toBeVec(v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rga", () => { - it("should return Vec3(r, g, a)", () => { - expect(v.rga).toBeVec(v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbr", () => { - it("should return Vec3(r, b, r)", () => { - expect(v.rbr).toBeVec(v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbg", () => { - it("should return Vec3(r, b, g)", () => { - expect(v.rbg).toBeVec(v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbb", () => { - it("should return Vec3(r, b, b)", () => { - expect(v.rbb).toBeVec(v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rba", () => { - it("should return Vec3(r, b, a)", () => { - expect(v.rba).toBeVec(v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rar", () => { - it("should return Vec3(r, a, r)", () => { - expect(v.rar).toBeVec(v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rag", () => { - it("should return Vec3(r, a, g)", () => { - expect(v.rag).toBeVec(v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rab", () => { - it("should return Vec3(r, a, b)", () => { - expect(v.rab).toBeVec(v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raa", () => { - it("should return Vec3(r, a, a)", () => { - expect(v.raa).toBeVec(v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.raa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grr", () => { - it("should return Vec3(g, r, r)", () => { - expect(v.grr).toBeVec(v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grg", () => { - it("should return Vec3(g, r, g)", () => { - expect(v.grg).toBeVec(v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grb", () => { - it("should return Vec3(g, r, b)", () => { - expect(v.grb).toBeVec(v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gra", () => { - it("should return Vec3(g, r, a)", () => { - expect(v.gra).toBeVec(v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggr", () => { - it("should return Vec3(g, g, r)", () => { - expect(v.ggr).toBeVec(v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggg", () => { - it("should return Vec3(g, g, g)", () => { - expect(v.ggg).toBeVec(v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggb", () => { - it("should return Vec3(g, g, b)", () => { - expect(v.ggb).toBeVec(v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gga", () => { - it("should return Vec3(g, g, a)", () => { - expect(v.gga).toBeVec(v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbr", () => { - it("should return Vec3(g, b, r)", () => { - expect(v.gbr).toBeVec(v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbg", () => { - it("should return Vec3(g, b, g)", () => { - expect(v.gbg).toBeVec(v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbb", () => { - it("should return Vec3(g, b, b)", () => { - expect(v.gbb).toBeVec(v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gba", () => { - it("should return Vec3(g, b, a)", () => { - expect(v.gba).toBeVec(v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gar", () => { - it("should return Vec3(g, a, r)", () => { - expect(v.gar).toBeVec(v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gag", () => { - it("should return Vec3(g, a, g)", () => { - expect(v.gag).toBeVec(v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gab", () => { - it("should return Vec3(g, a, b)", () => { - expect(v.gab).toBeVec(v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaa", () => { - it("should return Vec3(g, a, a)", () => { - expect(v.gaa).toBeVec(v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brr", () => { - it("should return Vec3(b, r, r)", () => { - expect(v.brr).toBeVec(v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brg", () => { - it("should return Vec3(b, r, g)", () => { - expect(v.brg).toBeVec(v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brb", () => { - it("should return Vec3(b, r, b)", () => { - expect(v.brb).toBeVec(v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bra", () => { - it("should return Vec3(b, r, a)", () => { - expect(v.bra).toBeVec(v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgr", () => { - it("should return Vec3(b, g, r)", () => { - expect(v.bgr).toBeVec(v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgg", () => { - it("should return Vec3(b, g, g)", () => { - expect(v.bgg).toBeVec(v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgb", () => { - it("should return Vec3(b, g, b)", () => { - expect(v.bgb).toBeVec(v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bga", () => { - it("should return Vec3(b, g, a)", () => { - expect(v.bga).toBeVec(v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbr", () => { - it("should return Vec3(b, b, r)", () => { - expect(v.bbr).toBeVec(v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbg", () => { - it("should return Vec3(b, b, g)", () => { - expect(v.bbg).toBeVec(v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbb", () => { - it("should return Vec3(b, b, b)", () => { - expect(v.bbb).toBeVec(v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bba", () => { - it("should return Vec3(b, b, a)", () => { - expect(v.bba).toBeVec(v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bar", () => { - it("should return Vec3(b, a, r)", () => { - expect(v.bar).toBeVec(v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bag", () => { - it("should return Vec3(b, a, g)", () => { - expect(v.bag).toBeVec(v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bab", () => { - it("should return Vec3(b, a, b)", () => { - expect(v.bab).toBeVec(v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baa", () => { - it("should return Vec3(b, a, a)", () => { - expect(v.baa).toBeVec(v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.baa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arr", () => { - it("should return Vec3(a, r, r)", () => { - expect(v.arr).toBeVec(v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.arr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arg", () => { - it("should return Vec3(a, r, g)", () => { - expect(v.arg).toBeVec(v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.arg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arb", () => { - it("should return Vec3(a, r, b)", () => { - expect(v.arb).toBeVec(v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.arb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ara", () => { - it("should return Vec3(a, r, a)", () => { - expect(v.ara).toBeVec(v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ara; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agr", () => { - it("should return Vec3(a, g, r)", () => { - expect(v.agr).toBeVec(v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.agr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agg", () => { - it("should return Vec3(a, g, g)", () => { - expect(v.agg).toBeVec(v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.agg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agb", () => { - it("should return Vec3(a, g, b)", () => { - expect(v.agb).toBeVec(v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.agb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aga", () => { - it("should return Vec3(a, g, a)", () => { - expect(v.aga).toBeVec(v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abr", () => { - it("should return Vec3(a, b, r)", () => { - expect(v.abr).toBeVec(v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.abr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abg", () => { - it("should return Vec3(a, b, g)", () => { - expect(v.abg).toBeVec(v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.abg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abb", () => { - it("should return Vec3(a, b, b)", () => { - expect(v.abb).toBeVec(v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.abb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aba", () => { - it("should return Vec3(a, b, a)", () => { - expect(v.aba).toBeVec(v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aar", () => { - it("should return Vec3(a, a, r)", () => { - expect(v.aar).toBeVec(v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.aar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aag", () => { - it("should return Vec3(a, a, g)", () => { - expect(v.aag).toBeVec(v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.aag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aab", () => { - it("should return Vec3(a, a, b)", () => { - expect(v.aab).toBeVec(v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.aab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaa", () => { - it("should return Vec3(a, a, a)", () => { - expect(v.aaa).toBeVec(v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrrr", () => { - it("should return Vec4(r, r, r, r)", () => { - expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrrg", () => { - it("should return Vec4(r, r, r, g)", () => { - expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrrb", () => { - it("should return Vec4(r, r, r, b)", () => { - expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrra", () => { - it("should return Vec4(r, r, r, a)", () => { - expect(v.rrra).toBeVec(v[0], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rrra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrgr", () => { - it("should return Vec4(r, r, g, r)", () => { - expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrgg", () => { - it("should return Vec4(r, r, g, g)", () => { - expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrgb", () => { - it("should return Vec4(r, r, g, b)", () => { - expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrga", () => { - it("should return Vec4(r, r, g, a)", () => { - expect(v.rrga).toBeVec(v[0], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rrga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrbr", () => { - it("should return Vec4(r, r, b, r)", () => { - expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrbg", () => { - it("should return Vec4(r, r, b, g)", () => { - expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrbb", () => { - it("should return Vec4(r, r, b, b)", () => { - expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrba", () => { - it("should return Vec4(r, r, b, a)", () => { - expect(v.rrba).toBeVec(v[0], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rrba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrar", () => { - it("should return Vec4(r, r, a, r)", () => { - expect(v.rrar).toBeVec(v[0], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rrar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrag", () => { - it("should return Vec4(r, r, a, g)", () => { - expect(v.rrag).toBeVec(v[0], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rrag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rrab", () => { - it("should return Vec4(r, r, a, b)", () => { - expect(v.rrab).toBeVec(v[0], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rrab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rraa", () => { - it("should return Vec4(r, r, a, a)", () => { - expect(v.rraa).toBeVec(v[0], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rraa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgrr", () => { - it("should return Vec4(r, g, r, r)", () => { - expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgrg", () => { - it("should return Vec4(r, g, r, g)", () => { - expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgrb", () => { - it("should return Vec4(r, g, r, b)", () => { - expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgra", () => { - it("should return Vec4(r, g, r, a)", () => { - expect(v.rgra).toBeVec(v[0], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rgra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rggr", () => { - it("should return Vec4(r, g, g, r)", () => { - expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rggg", () => { - it("should return Vec4(r, g, g, g)", () => { - expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rggb", () => { - it("should return Vec4(r, g, g, b)", () => { - expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgga", () => { - it("should return Vec4(r, g, g, a)", () => { - expect(v.rgga).toBeVec(v[0], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rgga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgbr", () => { - it("should return Vec4(r, g, b, r)", () => { - expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgbg", () => { - it("should return Vec4(r, g, b, g)", () => { - expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgbb", () => { - it("should return Vec4(r, g, b, b)", () => { - expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgba", () => { - it("should return Vec4(r, g, b, a)", () => { - expect(v.rgba).toBeVec(v[0], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rgba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgar", () => { - it("should return Vec4(r, g, a, r)", () => { - expect(v.rgar).toBeVec(v[0], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rgar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgag", () => { - it("should return Vec4(r, g, a, g)", () => { - expect(v.rgag).toBeVec(v[0], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rgag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgab", () => { - it("should return Vec4(r, g, a, b)", () => { - expect(v.rgab).toBeVec(v[0], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rgab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rgaa", () => { - it("should return Vec4(r, g, a, a)", () => { - expect(v.rgaa).toBeVec(v[0], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rgaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbrr", () => { - it("should return Vec4(r, b, r, r)", () => { - expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbrg", () => { - it("should return Vec4(r, b, r, g)", () => { - expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbrb", () => { - it("should return Vec4(r, b, r, b)", () => { - expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbra", () => { - it("should return Vec4(r, b, r, a)", () => { - expect(v.rbra).toBeVec(v[0], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rbra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbgr", () => { - it("should return Vec4(r, b, g, r)", () => { - expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbgg", () => { - it("should return Vec4(r, b, g, g)", () => { - expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbgb", () => { - it("should return Vec4(r, b, g, b)", () => { - expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbga", () => { - it("should return Vec4(r, b, g, a)", () => { - expect(v.rbga).toBeVec(v[0], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rbga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbbr", () => { - it("should return Vec4(r, b, b, r)", () => { - expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbbg", () => { - it("should return Vec4(r, b, b, g)", () => { - expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbbb", () => { - it("should return Vec4(r, b, b, b)", () => { - expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbba", () => { - it("should return Vec4(r, b, b, a)", () => { - expect(v.rbba).toBeVec(v[0], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rbba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbar", () => { - it("should return Vec4(r, b, a, r)", () => { - expect(v.rbar).toBeVec(v[0], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rbar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbag", () => { - it("should return Vec4(r, b, a, g)", () => { - expect(v.rbag).toBeVec(v[0], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rbag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbab", () => { - it("should return Vec4(r, b, a, b)", () => { - expect(v.rbab).toBeVec(v[0], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rbab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rbaa", () => { - it("should return Vec4(r, b, a, a)", () => { - expect(v.rbaa).toBeVec(v[0], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rbaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rarr", () => { - it("should return Vec4(r, a, r, r)", () => { - expect(v.rarr).toBeVec(v[0], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rarr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rarg", () => { - it("should return Vec4(r, a, r, g)", () => { - expect(v.rarg).toBeVec(v[0], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rarg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rarb", () => { - it("should return Vec4(r, a, r, b)", () => { - expect(v.rarb).toBeVec(v[0], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rarb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rara", () => { - it("should return Vec4(r, a, r, a)", () => { - expect(v.rara).toBeVec(v[0], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.rara; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ragr", () => { - it("should return Vec4(r, a, g, r)", () => { - expect(v.ragr).toBeVec(v[0], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ragr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ragg", () => { - it("should return Vec4(r, a, g, g)", () => { - expect(v.ragg).toBeVec(v[0], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ragg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ragb", () => { - it("should return Vec4(r, a, g, b)", () => { - expect(v.ragb).toBeVec(v[0], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ragb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raga", () => { - it("should return Vec4(r, a, g, a)", () => { - expect(v.raga).toBeVec(v[0], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.raga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rabr", () => { - it("should return Vec4(r, a, b, r)", () => { - expect(v.rabr).toBeVec(v[0], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.rabr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rabg", () => { - it("should return Vec4(r, a, b, g)", () => { - expect(v.rabg).toBeVec(v[0], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.rabg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().rabb", () => { - it("should return Vec4(r, a, b, b)", () => { - expect(v.rabb).toBeVec(v[0], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.rabb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raba", () => { - it("should return Vec4(r, a, b, a)", () => { - expect(v.raba).toBeVec(v[0], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.raba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raar", () => { - it("should return Vec4(r, a, a, r)", () => { - expect(v.raar).toBeVec(v[0], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.raar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raag", () => { - it("should return Vec4(r, a, a, g)", () => { - expect(v.raag).toBeVec(v[0], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.raag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raab", () => { - it("should return Vec4(r, a, a, b)", () => { - expect(v.raab).toBeVec(v[0], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.raab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().raaa", () => { - it("should return Vec4(r, a, a, a)", () => { - expect(v.raaa).toBeVec(v[0], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.raaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grrr", () => { - it("should return Vec4(g, r, r, r)", () => { - expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grrg", () => { - it("should return Vec4(g, r, r, g)", () => { - expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grrb", () => { - it("should return Vec4(g, r, r, b)", () => { - expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grra", () => { - it("should return Vec4(g, r, r, a)", () => { - expect(v.grra).toBeVec(v[1], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.grra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grgr", () => { - it("should return Vec4(g, r, g, r)", () => { - expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grgg", () => { - it("should return Vec4(g, r, g, g)", () => { - expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grgb", () => { - it("should return Vec4(g, r, g, b)", () => { - expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grga", () => { - it("should return Vec4(g, r, g, a)", () => { - expect(v.grga).toBeVec(v[1], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.grga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grbr", () => { - it("should return Vec4(g, r, b, r)", () => { - expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grbg", () => { - it("should return Vec4(g, r, b, g)", () => { - expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grbb", () => { - it("should return Vec4(g, r, b, b)", () => { - expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grba", () => { - it("should return Vec4(g, r, b, a)", () => { - expect(v.grba).toBeVec(v[1], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.grba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grar", () => { - it("should return Vec4(g, r, a, r)", () => { - expect(v.grar).toBeVec(v[1], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.grar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grag", () => { - it("should return Vec4(g, r, a, g)", () => { - expect(v.grag).toBeVec(v[1], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.grag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().grab", () => { - it("should return Vec4(g, r, a, b)", () => { - expect(v.grab).toBeVec(v[1], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.grab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().graa", () => { - it("should return Vec4(g, r, a, a)", () => { - expect(v.graa).toBeVec(v[1], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.graa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggrr", () => { - it("should return Vec4(g, g, r, r)", () => { - expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggrg", () => { - it("should return Vec4(g, g, r, g)", () => { - expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggrb", () => { - it("should return Vec4(g, g, r, b)", () => { - expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggra", () => { - it("should return Vec4(g, g, r, a)", () => { - expect(v.ggra).toBeVec(v[1], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ggra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gggr", () => { - it("should return Vec4(g, g, g, r)", () => { - expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gggg", () => { - it("should return Vec4(g, g, g, g)", () => { - expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gggb", () => { - it("should return Vec4(g, g, g, b)", () => { - expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggga", () => { - it("should return Vec4(g, g, g, a)", () => { - expect(v.ggga).toBeVec(v[1], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ggga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggbr", () => { - it("should return Vec4(g, g, b, r)", () => { - expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggbg", () => { - it("should return Vec4(g, g, b, g)", () => { - expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggbb", () => { - it("should return Vec4(g, g, b, b)", () => { - expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggba", () => { - it("should return Vec4(g, g, b, a)", () => { - expect(v.ggba).toBeVec(v[1], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ggba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggar", () => { - it("should return Vec4(g, g, a, r)", () => { - expect(v.ggar).toBeVec(v[1], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.ggar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggag", () => { - it("should return Vec4(g, g, a, g)", () => { - expect(v.ggag).toBeVec(v[1], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.ggag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggab", () => { - it("should return Vec4(g, g, a, b)", () => { - expect(v.ggab).toBeVec(v[1], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.ggab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().ggaa", () => { - it("should return Vec4(g, g, a, a)", () => { - expect(v.ggaa).toBeVec(v[1], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.ggaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbrr", () => { - it("should return Vec4(g, b, r, r)", () => { - expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbrg", () => { - it("should return Vec4(g, b, r, g)", () => { - expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbrb", () => { - it("should return Vec4(g, b, r, b)", () => { - expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbra", () => { - it("should return Vec4(g, b, r, a)", () => { - expect(v.gbra).toBeVec(v[1], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gbra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbgr", () => { - it("should return Vec4(g, b, g, r)", () => { - expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbgg", () => { - it("should return Vec4(g, b, g, g)", () => { - expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbgb", () => { - it("should return Vec4(g, b, g, b)", () => { - expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbga", () => { - it("should return Vec4(g, b, g, a)", () => { - expect(v.gbga).toBeVec(v[1], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gbga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbbr", () => { - it("should return Vec4(g, b, b, r)", () => { - expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbbg", () => { - it("should return Vec4(g, b, b, g)", () => { - expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbbb", () => { - it("should return Vec4(g, b, b, b)", () => { - expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbba", () => { - it("should return Vec4(g, b, b, a)", () => { - expect(v.gbba).toBeVec(v[1], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gbba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbar", () => { - it("should return Vec4(g, b, a, r)", () => { - expect(v.gbar).toBeVec(v[1], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gbar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbag", () => { - it("should return Vec4(g, b, a, g)", () => { - expect(v.gbag).toBeVec(v[1], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gbag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbab", () => { - it("should return Vec4(g, b, a, b)", () => { - expect(v.gbab).toBeVec(v[1], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gbab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gbaa", () => { - it("should return Vec4(g, b, a, a)", () => { - expect(v.gbaa).toBeVec(v[1], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gbaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().garr", () => { - it("should return Vec4(g, a, r, r)", () => { - expect(v.garr).toBeVec(v[1], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.garr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().garg", () => { - it("should return Vec4(g, a, r, g)", () => { - expect(v.garg).toBeVec(v[1], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.garg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().garb", () => { - it("should return Vec4(g, a, r, b)", () => { - expect(v.garb).toBeVec(v[1], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.garb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gara", () => { - it("should return Vec4(g, a, r, a)", () => { - expect(v.gara).toBeVec(v[1], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gara; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gagr", () => { - it("should return Vec4(g, a, g, r)", () => { - expect(v.gagr).toBeVec(v[1], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gagr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gagg", () => { - it("should return Vec4(g, a, g, g)", () => { - expect(v.gagg).toBeVec(v[1], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gagg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gagb", () => { - it("should return Vec4(g, a, g, b)", () => { - expect(v.gagb).toBeVec(v[1], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gagb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaga", () => { - it("should return Vec4(g, a, g, a)", () => { - expect(v.gaga).toBeVec(v[1], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gaga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gabr", () => { - it("should return Vec4(g, a, b, r)", () => { - expect(v.gabr).toBeVec(v[1], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gabr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gabg", () => { - it("should return Vec4(g, a, b, g)", () => { - expect(v.gabg).toBeVec(v[1], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gabg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gabb", () => { - it("should return Vec4(g, a, b, b)", () => { - expect(v.gabb).toBeVec(v[1], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gabb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaba", () => { - it("should return Vec4(g, a, b, a)", () => { - expect(v.gaba).toBeVec(v[1], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gaba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaar", () => { - it("should return Vec4(g, a, a, r)", () => { - expect(v.gaar).toBeVec(v[1], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.gaar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaag", () => { - it("should return Vec4(g, a, a, g)", () => { - expect(v.gaag).toBeVec(v[1], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.gaag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaab", () => { - it("should return Vec4(g, a, a, b)", () => { - expect(v.gaab).toBeVec(v[1], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.gaab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().gaaa", () => { - it("should return Vec4(g, a, a, a)", () => { - expect(v.gaaa).toBeVec(v[1], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.gaaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brrr", () => { - it("should return Vec4(b, r, r, r)", () => { - expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brrg", () => { - it("should return Vec4(b, r, r, g)", () => { - expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brrb", () => { - it("should return Vec4(b, r, r, b)", () => { - expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brra", () => { - it("should return Vec4(b, r, r, a)", () => { - expect(v.brra).toBeVec(v[2], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.brra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brgr", () => { - it("should return Vec4(b, r, g, r)", () => { - expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brgg", () => { - it("should return Vec4(b, r, g, g)", () => { - expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brgb", () => { - it("should return Vec4(b, r, g, b)", () => { - expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brga", () => { - it("should return Vec4(b, r, g, a)", () => { - expect(v.brga).toBeVec(v[2], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.brga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brbr", () => { - it("should return Vec4(b, r, b, r)", () => { - expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brbg", () => { - it("should return Vec4(b, r, b, g)", () => { - expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brbb", () => { - it("should return Vec4(b, r, b, b)", () => { - expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brba", () => { - it("should return Vec4(b, r, b, a)", () => { - expect(v.brba).toBeVec(v[2], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.brba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brar", () => { - it("should return Vec4(b, r, a, r)", () => { - expect(v.brar).toBeVec(v[2], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.brar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brag", () => { - it("should return Vec4(b, r, a, g)", () => { - expect(v.brag).toBeVec(v[2], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.brag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().brab", () => { - it("should return Vec4(b, r, a, b)", () => { - expect(v.brab).toBeVec(v[2], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.brab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().braa", () => { - it("should return Vec4(b, r, a, a)", () => { - expect(v.braa).toBeVec(v[2], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.braa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgrr", () => { - it("should return Vec4(b, g, r, r)", () => { - expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgrg", () => { - it("should return Vec4(b, g, r, g)", () => { - expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgrb", () => { - it("should return Vec4(b, g, r, b)", () => { - expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgra", () => { - it("should return Vec4(b, g, r, a)", () => { - expect(v.bgra).toBeVec(v[2], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bgra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bggr", () => { - it("should return Vec4(b, g, g, r)", () => { - expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bggg", () => { - it("should return Vec4(b, g, g, g)", () => { - expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bggb", () => { - it("should return Vec4(b, g, g, b)", () => { - expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgga", () => { - it("should return Vec4(b, g, g, a)", () => { - expect(v.bgga).toBeVec(v[2], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bgga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgbr", () => { - it("should return Vec4(b, g, b, r)", () => { - expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgbg", () => { - it("should return Vec4(b, g, b, g)", () => { - expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgbb", () => { - it("should return Vec4(b, g, b, b)", () => { - expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgba", () => { - it("should return Vec4(b, g, b, a)", () => { - expect(v.bgba).toBeVec(v[2], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bgba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgar", () => { - it("should return Vec4(b, g, a, r)", () => { - expect(v.bgar).toBeVec(v[2], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bgar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgag", () => { - it("should return Vec4(b, g, a, g)", () => { - expect(v.bgag).toBeVec(v[2], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bgag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgab", () => { - it("should return Vec4(b, g, a, b)", () => { - expect(v.bgab).toBeVec(v[2], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bgab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bgaa", () => { - it("should return Vec4(b, g, a, a)", () => { - expect(v.bgaa).toBeVec(v[2], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bgaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbrr", () => { - it("should return Vec4(b, b, r, r)", () => { - expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbrg", () => { - it("should return Vec4(b, b, r, g)", () => { - expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbrb", () => { - it("should return Vec4(b, b, r, b)", () => { - expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbra", () => { - it("should return Vec4(b, b, r, a)", () => { - expect(v.bbra).toBeVec(v[2], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bbra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbgr", () => { - it("should return Vec4(b, b, g, r)", () => { - expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbgg", () => { - it("should return Vec4(b, b, g, g)", () => { - expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbgb", () => { - it("should return Vec4(b, b, g, b)", () => { - expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbga", () => { - it("should return Vec4(b, b, g, a)", () => { - expect(v.bbga).toBeVec(v[2], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bbga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbbr", () => { - it("should return Vec4(b, b, b, r)", () => { - expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbbg", () => { - it("should return Vec4(b, b, b, g)", () => { - expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbbb", () => { - it("should return Vec4(b, b, b, b)", () => { - expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbba", () => { - it("should return Vec4(b, b, b, a)", () => { - expect(v.bbba).toBeVec(v[2], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bbba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbar", () => { - it("should return Vec4(b, b, a, r)", () => { - expect(v.bbar).toBeVec(v[2], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bbar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbag", () => { - it("should return Vec4(b, b, a, g)", () => { - expect(v.bbag).toBeVec(v[2], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bbag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbab", () => { - it("should return Vec4(b, b, a, b)", () => { - expect(v.bbab).toBeVec(v[2], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bbab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bbaa", () => { - it("should return Vec4(b, b, a, a)", () => { - expect(v.bbaa).toBeVec(v[2], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bbaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().barr", () => { - it("should return Vec4(b, a, r, r)", () => { - expect(v.barr).toBeVec(v[2], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.barr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().barg", () => { - it("should return Vec4(b, a, r, g)", () => { - expect(v.barg).toBeVec(v[2], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.barg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().barb", () => { - it("should return Vec4(b, a, r, b)", () => { - expect(v.barb).toBeVec(v[2], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.barb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bara", () => { - it("should return Vec4(b, a, r, a)", () => { - expect(v.bara).toBeVec(v[2], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.bara; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bagr", () => { - it("should return Vec4(b, a, g, r)", () => { - expect(v.bagr).toBeVec(v[2], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.bagr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bagg", () => { - it("should return Vec4(b, a, g, g)", () => { - expect(v.bagg).toBeVec(v[2], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.bagg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().bagb", () => { - it("should return Vec4(b, a, g, b)", () => { - expect(v.bagb).toBeVec(v[2], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.bagb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baga", () => { - it("should return Vec4(b, a, g, a)", () => { - expect(v.baga).toBeVec(v[2], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.baga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().babr", () => { - it("should return Vec4(b, a, b, r)", () => { - expect(v.babr).toBeVec(v[2], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.babr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().babg", () => { - it("should return Vec4(b, a, b, g)", () => { - expect(v.babg).toBeVec(v[2], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.babg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().babb", () => { - it("should return Vec4(b, a, b, b)", () => { - expect(v.babb).toBeVec(v[2], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.babb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baba", () => { - it("should return Vec4(b, a, b, a)", () => { - expect(v.baba).toBeVec(v[2], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.baba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baar", () => { - it("should return Vec4(b, a, a, r)", () => { - expect(v.baar).toBeVec(v[2], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.baar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baag", () => { - it("should return Vec4(b, a, a, g)", () => { - expect(v.baag).toBeVec(v[2], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.baag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baab", () => { - it("should return Vec4(b, a, a, b)", () => { - expect(v.baab).toBeVec(v[2], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.baab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().baaa", () => { - it("should return Vec4(b, a, a, a)", () => { - expect(v.baaa).toBeVec(v[2], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.baaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arrr", () => { - it("should return Vec4(a, r, r, r)", () => { - expect(v.arrr).toBeVec(v[3], v[0], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.arrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arrg", () => { - it("should return Vec4(a, r, r, g)", () => { - expect(v.arrg).toBeVec(v[3], v[0], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.arrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arrb", () => { - it("should return Vec4(a, r, r, b)", () => { - expect(v.arrb).toBeVec(v[3], v[0], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.arrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arra", () => { - it("should return Vec4(a, r, r, a)", () => { - expect(v.arra).toBeVec(v[3], v[0], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.arra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().argr", () => { - it("should return Vec4(a, r, g, r)", () => { - expect(v.argr).toBeVec(v[3], v[0], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.argr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().argg", () => { - it("should return Vec4(a, r, g, g)", () => { - expect(v.argg).toBeVec(v[3], v[0], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.argg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().argb", () => { - it("should return Vec4(a, r, g, b)", () => { - expect(v.argb).toBeVec(v[3], v[0], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.argb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arga", () => { - it("should return Vec4(a, r, g, a)", () => { - expect(v.arga).toBeVec(v[3], v[0], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.arga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arbr", () => { - it("should return Vec4(a, r, b, r)", () => { - expect(v.arbr).toBeVec(v[3], v[0], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.arbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arbg", () => { - it("should return Vec4(a, r, b, g)", () => { - expect(v.arbg).toBeVec(v[3], v[0], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.arbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arbb", () => { - it("should return Vec4(a, r, b, b)", () => { - expect(v.arbb).toBeVec(v[3], v[0], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.arbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arba", () => { - it("should return Vec4(a, r, b, a)", () => { - expect(v.arba).toBeVec(v[3], v[0], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.arba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arar", () => { - it("should return Vec4(a, r, a, r)", () => { - expect(v.arar).toBeVec(v[3], v[0], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.arar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arag", () => { - it("should return Vec4(a, r, a, g)", () => { - expect(v.arag).toBeVec(v[3], v[0], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.arag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().arab", () => { - it("should return Vec4(a, r, a, b)", () => { - expect(v.arab).toBeVec(v[3], v[0], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.arab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().araa", () => { - it("should return Vec4(a, r, a, a)", () => { - expect(v.araa).toBeVec(v[3], v[0], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.araa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agrr", () => { - it("should return Vec4(a, g, r, r)", () => { - expect(v.agrr).toBeVec(v[3], v[1], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.agrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agrg", () => { - it("should return Vec4(a, g, r, g)", () => { - expect(v.agrg).toBeVec(v[3], v[1], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.agrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agrb", () => { - it("should return Vec4(a, g, r, b)", () => { - expect(v.agrb).toBeVec(v[3], v[1], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.agrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agra", () => { - it("should return Vec4(a, g, r, a)", () => { - expect(v.agra).toBeVec(v[3], v[1], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.agra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aggr", () => { - it("should return Vec4(a, g, g, r)", () => { - expect(v.aggr).toBeVec(v[3], v[1], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.aggr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aggg", () => { - it("should return Vec4(a, g, g, g)", () => { - expect(v.aggg).toBeVec(v[3], v[1], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.aggg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aggb", () => { - it("should return Vec4(a, g, g, b)", () => { - expect(v.aggb).toBeVec(v[3], v[1], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.aggb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agga", () => { - it("should return Vec4(a, g, g, a)", () => { - expect(v.agga).toBeVec(v[3], v[1], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.agga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agbr", () => { - it("should return Vec4(a, g, b, r)", () => { - expect(v.agbr).toBeVec(v[3], v[1], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.agbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agbg", () => { - it("should return Vec4(a, g, b, g)", () => { - expect(v.agbg).toBeVec(v[3], v[1], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.agbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agbb", () => { - it("should return Vec4(a, g, b, b)", () => { - expect(v.agbb).toBeVec(v[3], v[1], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.agbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agba", () => { - it("should return Vec4(a, g, b, a)", () => { - expect(v.agba).toBeVec(v[3], v[1], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.agba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agar", () => { - it("should return Vec4(a, g, a, r)", () => { - expect(v.agar).toBeVec(v[3], v[1], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.agar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agag", () => { - it("should return Vec4(a, g, a, g)", () => { - expect(v.agag).toBeVec(v[3], v[1], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.agag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agab", () => { - it("should return Vec4(a, g, a, b)", () => { - expect(v.agab).toBeVec(v[3], v[1], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.agab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().agaa", () => { - it("should return Vec4(a, g, a, a)", () => { - expect(v.agaa).toBeVec(v[3], v[1], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.agaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abrr", () => { - it("should return Vec4(a, b, r, r)", () => { - expect(v.abrr).toBeVec(v[3], v[2], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.abrr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abrg", () => { - it("should return Vec4(a, b, r, g)", () => { - expect(v.abrg).toBeVec(v[3], v[2], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.abrg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abrb", () => { - it("should return Vec4(a, b, r, b)", () => { - expect(v.abrb).toBeVec(v[3], v[2], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.abrb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abra", () => { - it("should return Vec4(a, b, r, a)", () => { - expect(v.abra).toBeVec(v[3], v[2], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.abra; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abgr", () => { - it("should return Vec4(a, b, g, r)", () => { - expect(v.abgr).toBeVec(v[3], v[2], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.abgr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abgg", () => { - it("should return Vec4(a, b, g, g)", () => { - expect(v.abgg).toBeVec(v[3], v[2], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.abgg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abgb", () => { - it("should return Vec4(a, b, g, b)", () => { - expect(v.abgb).toBeVec(v[3], v[2], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.abgb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abga", () => { - it("should return Vec4(a, b, g, a)", () => { - expect(v.abga).toBeVec(v[3], v[2], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.abga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abbr", () => { - it("should return Vec4(a, b, b, r)", () => { - expect(v.abbr).toBeVec(v[3], v[2], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.abbr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abbg", () => { - it("should return Vec4(a, b, b, g)", () => { - expect(v.abbg).toBeVec(v[3], v[2], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.abbg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abbb", () => { - it("should return Vec4(a, b, b, b)", () => { - expect(v.abbb).toBeVec(v[3], v[2], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.abbb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abba", () => { - it("should return Vec4(a, b, b, a)", () => { - expect(v.abba).toBeVec(v[3], v[2], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.abba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abar", () => { - it("should return Vec4(a, b, a, r)", () => { - expect(v.abar).toBeVec(v[3], v[2], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.abar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abag", () => { - it("should return Vec4(a, b, a, g)", () => { - expect(v.abag).toBeVec(v[3], v[2], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.abag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abab", () => { - it("should return Vec4(a, b, a, b)", () => { - expect(v.abab).toBeVec(v[3], v[2], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.abab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().abaa", () => { - it("should return Vec4(a, b, a, a)", () => { - expect(v.abaa).toBeVec(v[3], v[2], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.abaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aarr", () => { - it("should return Vec4(a, a, r, r)", () => { - expect(v.aarr).toBeVec(v[3], v[3], v[0], v[0]); - }); - it("should be return a copy", () => { - let sw = v.aarr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aarg", () => { - it("should return Vec4(a, a, r, g)", () => { - expect(v.aarg).toBeVec(v[3], v[3], v[0], v[1]); - }); - it("should be return a copy", () => { - let sw = v.aarg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aarb", () => { - it("should return Vec4(a, a, r, b)", () => { - expect(v.aarb).toBeVec(v[3], v[3], v[0], v[2]); - }); - it("should be return a copy", () => { - let sw = v.aarb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aara", () => { - it("should return Vec4(a, a, r, a)", () => { - expect(v.aara).toBeVec(v[3], v[3], v[0], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aara; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aagr", () => { - it("should return Vec4(a, a, g, r)", () => { - expect(v.aagr).toBeVec(v[3], v[3], v[1], v[0]); - }); - it("should be return a copy", () => { - let sw = v.aagr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aagg", () => { - it("should return Vec4(a, a, g, g)", () => { - expect(v.aagg).toBeVec(v[3], v[3], v[1], v[1]); - }); - it("should be return a copy", () => { - let sw = v.aagg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aagb", () => { - it("should return Vec4(a, a, g, b)", () => { - expect(v.aagb).toBeVec(v[3], v[3], v[1], v[2]); - }); - it("should be return a copy", () => { - let sw = v.aagb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaga", () => { - it("should return Vec4(a, a, g, a)", () => { - expect(v.aaga).toBeVec(v[3], v[3], v[1], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aaga; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aabr", () => { - it("should return Vec4(a, a, b, r)", () => { - expect(v.aabr).toBeVec(v[3], v[3], v[2], v[0]); - }); - it("should be return a copy", () => { - let sw = v.aabr; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aabg", () => { - it("should return Vec4(a, a, b, g)", () => { - expect(v.aabg).toBeVec(v[3], v[3], v[2], v[1]); - }); - it("should be return a copy", () => { - let sw = v.aabg; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aabb", () => { - it("should return Vec4(a, a, b, b)", () => { - expect(v.aabb).toBeVec(v[3], v[3], v[2], v[2]); - }); - it("should be return a copy", () => { - let sw = v.aabb; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaba", () => { - it("should return Vec4(a, a, b, a)", () => { - expect(v.aaba).toBeVec(v[3], v[3], v[2], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aaba; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaar", () => { - it("should return Vec4(a, a, a, r)", () => { - expect(v.aaar).toBeVec(v[3], v[3], v[3], v[0]); - }); - it("should be return a copy", () => { - let sw = v.aaar; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaag", () => { - it("should return Vec4(a, a, a, g)", () => { - expect(v.aaag).toBeVec(v[3], v[3], v[3], v[1]); - }); - it("should be return a copy", () => { - let sw = v.aaag; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaab", () => { - it("should return Vec4(a, a, a, b)", () => { - expect(v.aaab).toBeVec(v[3], v[3], v[3], v[2]); - }); - it("should be return a copy", () => { - let sw = v.aaab; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - describe("Vec4().aaaa", () => { - it("should return Vec4(a, a, a, a)", () => { - expect(v.aaaa).toBeVec(v[3], v[3], v[3], v[3]); - }); - it("should be return a copy", () => { - let sw = v.aaaa; - sw[0] += 1; - expect(v[0]).not.toEqual(sw[0]); - }); - }); - - // [/Swizzle Autogen] -}); \ No newline at end of file diff --git a/tests/vec4.spec.ts b/tests/vec4.spec.ts deleted file mode 100644 index 3669d442..00000000 --- a/tests/vec4.spec.ts +++ /dev/null @@ -1,689 +0,0 @@ -import { expect, describe, it, beforeEach } from 'vitest'; -import { Vec4, Vec4Like } from "../src/vec4" -import "./test-utils" - -describe("Vec4", () => { - describe("constructor", () => { - it("should return Vec4(0, 0, 0, 0) if called with no arguments", () => { - expect(new Vec4()).toBeVec(0, 0, 0, 0); - }); - - it("should return Vec4(x, y, z, w) if called with (x, y, z, w)", () => { - expect(new Vec4(1, 2, 3, 4)).toBeVec(1, 2, 3, 4); - expect(new Vec4(-3, 4.4, -5.6, 7.8)).toBeVec(-3, 4.4, -5.6, 7.8); - }); - - it("should return Vec4(x, x, x) if called with (x)", () => { - expect(new Vec4(1)).toBeVec(1, 1, 1, 1); - expect(new Vec4(-2.3)).toBeVec(-2.3, -2.3, -2.3, -2.3); - }); - - it("should return Vec4(x, y, z, w) if called with ([x, y, z, w])", () => { - expect(new Vec4([1, 2, 3, 4])).toBeVec(1, 2, 3, 4); - expect(new Vec4([-3, 4.4, -5.6, 7.8])).toBeVec(-3, 4.4, -5.6, 7.8); - }); - - it("should return Vec4(x, y, z, w) if called with (Vec4(x, y, z, w))", () => { - let v = new Vec4(3.4, 5.6, 7.8, 9); - expect(new Vec4(v)).toBeVec(v); - }); - - it("should return Vec4(x, y, z, w) if called with (Float32Array([x, y, z, w]))", () => { - let arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); - expect(new Vec4(arr)).toBeVec(arr); - }); - }); - - describe("static", () => { - let out: Vec4Like; - let vecA: Vec4Like; - let vecB: Vec4Like; - let result: any; - - beforeEach(() => { - vecA = new Vec4(1, 2, 3, 4); - vecB = new Vec4(5, 6, 7, 8); - out = new Vec4(0, 0, 0, 0); - }); - - describe("create", () => { - beforeEach(() => { result = Vec4.create(); }); - it("should return a 4 element array initialized to 0s", () => { expect(result).toBeVec(0, 0, 0, 0); }); - }); - - describe("clone", () => { - beforeEach(() => { result = Vec4.clone(vecA); }); - it("should return a 4 element array initialized to the values in vecA", () => { expect(result).toBeVec(vecA); }); - }); - - describe("fromValues", () => { - beforeEach(() => { result = Vec4.fromValues(1, 2, 3, 4); }); - it("should return a 4 element array initialized to the values passed", () => { expect(result).toBeVec(1, 2, 3, 4); }); - }); - - describe("copy", () => { - beforeEach(() => { result = Vec4.copy(out, vecA); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("set", () => { - beforeEach(() => { result = Vec4.set(out, 1, 2, 3, 4); }); - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("add", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.add(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(6, 8, 10, 12); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.add(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(6, 8, 10, 12); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.add(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(6, 8, 10, 12); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("subtract", () => { - it("should have an alias called 'sub'", () => { expect(Vec4.sub).toEqual(Vec4.subtract); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.subtract(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(-4, -4, -4, -4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.subtract(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-4, -4, -4, -4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.subtract(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(-4, -4, -4, -4); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("multiply", () => { - it("should have an alias called 'mul'", () => { expect(Vec4.mul).toEqual(Vec4.multiply); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.multiply(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(5, 12, 21, 32); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.multiply(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(5, 12, 21, 32); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.multiply(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(5, 12, 21, 32); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("divide", () => { - it("should have an alias called 'div'", () => { expect(Vec4.div).toEqual(Vec4.divide); }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.divide(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(0.2, 0.333333, 0.428571, 0.5); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.divide(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(0.2, 0.333333, 0.428571, 0.5); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.divide(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(0.2, 0.333333, 0.428571, 0.5); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("ceil", () => { - beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.ceil(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4, 2, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.ceil(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 4, 2, 1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("floor", () => { - beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.floor(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 3, 1, 0); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.floor(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 3, 1, 0); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("min", () => { - beforeEach(() => { vecA = [1, 3, 1, 3]; vecB = [3, 1, 3, 1]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.min(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 1, 1, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3, 1); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.min(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 1, 1, 1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3, 1); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.min(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(1, 1, 1, 1); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1, 3); }); - }); - }); - - describe("max", () => { - beforeEach(() => { vecA = [1, 3, 1, 3]; vecB = [3, 1, 3, 1]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.max(out, vecA, vecB); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 3, 3, 3); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3, 1); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.max(vecA, vecA, vecB); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 3, 3, 3); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(3, 1, 3, 1); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.max(vecB, vecA, vecB); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3, 3, 3, 3); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 3, 1, 3); }); - }); - }); - - describe("round", () => { - beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.round(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 3, 1, 1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.round(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 3, 1, 1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("scale", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.scale(out, vecA, 2); }); - - it("should place values into out", () => { expect(out).toBeVec(2, 4, 6, 8); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.scale(vecA, vecA, 2); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(2, 4, 6, 8); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("scaleAndAdd", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.scaleAndAdd(out, vecA, vecB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(3.5, 5, 6.5, 8); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.scaleAndAdd(vecA, vecA, vecB, 0.5); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3.5, 5, 6.5, 8); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.scaleAndAdd(vecB, vecA, vecB, 0.5); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3.5, 5, 6.5, 8); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - }); - - describe("distance", () => { - it("should have an alias called 'dist'", () => { expect(Vec4.dist).toEqual(Vec4.distance); }); - - beforeEach(() => { result = Vec4.distance(vecA, vecB); }); - - it("should return the distance", () => { expect(result).toBeCloseTo(8); }); - }); - - describe("squaredDistance", () => { - it("should have an alias called 'sqrDist'", () => { expect(Vec4.sqrDist).toEqual(Vec4.squaredDistance); }); - - beforeEach(() => { result = Vec4.squaredDistance(vecA, vecB); }); - - it("should return the squared distance", () => { expect(result).toEqual(64); }); - }); - - describe("length", () => { - it("should have an alias called 'len'", () => { expect(Vec4.len).toEqual(Vec4.length); }); - - beforeEach(() => { result = Vec4.len(vecA); }); - - it("should return the length", () => { expect(result).toBeCloseTo(5.477225); }); - }); - - describe("squaredLength", () => { - it("should have an alias called 'sqrLen'", () => { expect(Vec4.sqrLen).toEqual(Vec4.squaredLength); }); - - beforeEach(() => { result = Vec4.squaredLength(vecA); }); - - it("should return the squared length", () => { expect(result).toEqual(30); }); - }); - - describe("negate", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.negate(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(-1, -2, -3, -4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.negate(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(-1, -2, -3, -4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("inverse", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.inverse(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 1/2, 1/3, 1/4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.inverse(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 1/2, 1/3, 1/4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("abs", () => { - beforeEach(() => { vecA = [-1, -2, -3, -4]; }); - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.abs(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 2, 3, 4); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(-1, -2, -3, -4); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.abs(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("normalize", () => { - beforeEach(() => { vecA = [5, 0, 0, 0]; }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.normalize(out, vecA); }); - - it("should place values into out", () => { expect(out).toBeVec(1, 0, 0, 0); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(5, 0, 0, 0); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.normalize(vecA, vecA); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(1, 0, 0, 0); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - }); - }); - - describe("dot", () => { - beforeEach(() => { result = Vec4.dot(vecA, vecB); }); - - it("should return the dot product", () => { expect(result).toEqual(70); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("lerp", () => { - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.lerp(out, vecA, vecB, 0.5); }); - - it("should place values into out", () => { expect(out).toBeVec(3, 4, 5, 6); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.lerp(vecA, vecA, vecB, 0.5); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(3, 4, 5, 6); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(5, 6, 7, 8); }); - }); - - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.lerp(vecB, vecA, vecB, 0.5); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(3, 4, 5, 6); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - }); - - /*describe("random", () => { - describe("with no scale", () => { - beforeEach(() => { result = Vec4.random(out); }); - - it("should result in a unit length vector", () => { expect(Vec4.len(out)).toBeCloseTo(1.0); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - - describe("with a scale", () => { - beforeEach(() => { result = Vec4.random(out, 5.0); }); - - it("should result in a unit length vector", () => { expect(Vec4.len(out)).toBeCloseTo(5.0); }); - it("should return out", () => { expect(result).toBe(out); }); - }); - });*/ - - describe("cross", () => { - let vecC: Vec4Like; - beforeEach(() => { - vecA = new Vec4(1, 0, 0, 0); - vecB = new Vec4(0, 1, 0, 0); - vecC = [0, 0, 1, 0]; - }); - - describe("with a separate output vector", () => { - beforeEach(() => { result = Vec4.cross(out, vecA,vecB,vecC); }); - - it("should place values into out", () => { expect(out).toBeVec(0, 0, 0, -1); }); - it("should return out", () => { expect(result).toBe(out); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 0, 0, 0); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 0, 0); }); - it("should not modify vecC", () => { expect(vecC).toBeVec(0, 0, 1, 0); }); - }); - - describe("when vecA is the output vector", () => { - beforeEach(() => { result = Vec4.cross(vecA, vecA,vecB,vecC); }); - - it("should place values into vecA", () => { expect(vecA).toBeVec(0, 0, 0,-1); }); - it("should return vecA", () => { expect(result).toBe(vecA); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 0, 0); }); - it("should not modify vecC", () => { expect(vecC).toBeVec(0, 0, 1, 0); }); - }); - describe("when vecB is the output vector", () => { - beforeEach(() => { result = Vec4.cross(vecB, vecA,vecB,vecC); }); - - it("should place values into vecB", () => { expect(vecB).toBeVec(0, 0, 0,-1); }); - it("should return vecB", () => { expect(result).toBe(vecB); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 0, 0, 0); }); - it("should not modify vecC", () => { expect(vecC).toBeVec(0, 0, 1, 0); }); - }); - describe("when vecC is the output vector", () => { - beforeEach(() => { result = Vec4.cross(vecC, vecA,vecB,vecC); }); - - it("should place values into vecC", () => { expect(vecC).toBeVec(0, 0, 0,-1); }); - it("should return vecC", () => { expect(result).toBe(vecC); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 0, 0, 0); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 0, 0); }); - }); - }); - - /*describe("forEach", () => { - let vecArray; - - beforeEach(() => { - vecArray = [ - 1, 2, 3, 4, - 5, 6, 7, 8, - 0, 0, 0, 0 - ]; - }); - - describe("when performing operations that take no extra arguments", () => { - beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 0, Vec4.normalize); }); - - it("should update all values", () => { - expect(vecArray).toBeEqualish([ - 0.182574, 0.365148, 0.547722, 0.730296, - 0.379049, 0.454858, 0.530668, 0.606478, - 0, 0, 0, 0 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - }); - - describe("when performing operations that takes one extra arguments", () => { - beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 0, Vec4.add, vecA); }); - - it("should update all values", () => { - expect(vecArray).toBeEqualish([ - 2, 4, 6, 8, - 6, 8, 10, 12, - 1, 2, 3, 4 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when specifying an offset", () => { - beforeEach(() => { result = Vec4.forEach(vecArray, 0, 4, 0, Vec4.add, vecA); }); - - it("should update all values except the first vector", () => { - expect(vecArray).toBeEqualish([ - 1, 2, 3, 4, - 6, 8, 10, 12, - 1, 2, 3, 4 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when specifying a count", () => { - beforeEach(() => { result = Vec4.forEach(vecArray, 0, 0, 2, Vec4.add, vecA); }); - - it("should update all values except the last vector", () => { - expect(vecArray).toBeEqualish([ - 2, 4, 6, 8, - 6, 8, 10, 12, - 0, 0, 0, 0 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when specifying a stride", () => { - beforeEach(() => { result = Vec4.forEach(vecArray, 8, 0, 0, Vec4.add, vecA); }); - - it("should update all values except the second vector", () => { - expect(vecArray).toBeEqualish([ - 2, 4, 6, 8, - 5, 6, 7, 8, - 1, 2, 3, 4 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(1, 2, 3, 4); }); - }); - - describe("when calling a function that does not modify the out variable", () => { - beforeEach(() => { - result = vec3.forEach(vecArray, 0, 0, 0, function(out, vec) {}); - }); - - it("values should remain unchanged", () => { - expect(vecArray).toBeEqualish([ - 1, 2, 3, 4, - 5, 6, 7, 8, - 0, 0, 0, 0 - ]); - }); - it("should return vecArray", () => { expect(result).toBe(vecArray); }); - }); - });*/ - - describe("str", () => { - it("should return a string representation of the vector", () => { expect(Vec4.str(vecA)).toEqual("Vec4(1, 2, 3, 4)"); }); - }); - - describe("exactEquals", () => { - let vecC: Vec4Like, r0: boolean, r1: boolean; - beforeEach(() => { - vecA = [0, 1, 2, 3]; - vecB = [0, 1, 2, 3]; - vecC = [1, 2, 3, 4]; - r0 = Vec4.exactEquals(vecA, vecB); - r1 = Vec4.exactEquals(vecA, vecC); - }); - - it("should return true for identical vectors", () => { expect(r0).toBe(true); }); - it("should return false for different vectors", () => { expect(r1).toBe(false); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(0, 1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 2, 3); }); - }); - - describe("equals", () => { - let vecC: Vec4Like, vecD: Vec4Like, r0: boolean, r1: boolean, r2: boolean; - beforeEach(() => { - vecA = [0, 1, 2, 3]; - vecB = [0, 1, 2, 3]; - vecC = [1, 2, 3, 4]; - vecD = [1e-16, 1, 2, 3]; - r0 = Vec4.equals(vecA, vecB); - r1 = Vec4.equals(vecA, vecC); - r2 = Vec4.equals(vecA, vecD); - }); - it("should return true for identical vectors", () => { expect(r0).toBe(true); }); - it("should return false for different vectors", () => { expect(r1).toBe(false); }); - it("should return true for close but not identical vectors", () => { expect(r2).toBe(true); }); - it("should not modify vecA", () => { expect(vecA).toBeVec(0, 1, 2, 3); }); - it("should not modify vecB", () => { expect(vecB).toBeVec(0, 1, 2, 3); }); - }); - - describe("zero", () => { - beforeEach(() => { - vecA = [1, 2, 3, 4]; - result = Vec4.zero(vecA); - }); - it("should result in a 4 element vector with zeros", () => { expect(result).toBeVec(0, 0, 0, 0); }); - }); - }); -}); \ No newline at end of file diff --git a/tests/vitest.d.ts b/tests/vitest.d.ts new file mode 100644 index 00000000..30105e74 --- /dev/null +++ b/tests/vitest.d.ts @@ -0,0 +1,13 @@ +import type { FloatArray, Quat2Like, Vec2Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; + +/** + * Defines custom matchers set in `./setupExtend.ts` via `expect.extend`. + */ +interface CustomMatchers { + toBeVec: (...expected: number[] | [FloatArray] | [Vec2Like] | [Vec3Like] | [Vec4Like]) => R + toBeQuat2: (...expected: number[] | [FloatArray] | [Quat2Like]) => R +} + +declare module 'vitest' { + interface Assertion extends CustomMatchers {} +} diff --git a/tsconfig-build.json b/tsconfig-build.json new file mode 100644 index 00000000..024795c3 --- /dev/null +++ b/tsconfig-build.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "skipLibCheck": true + }, + "include": ["src/**/*"] +} diff --git a/tsconfig.json b/tsconfig.json index c01e450f..dc348943 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,16 @@ { "compilerOptions": { - "target": "esnext", - "module": "esnext", - "lib": ["esnext", "dom"], - "outDir": "dist/esm", + "target": "ESNext", + "module": "NodeNext", + "lib": ["ESNext", "DOM"], + "outDir": "dist", "rootDir": "./src", "sourceMap": true, - "moduleResolution": "node", - "esModuleInterop": true, - "declaration": true + "moduleResolution": "NodeNext", + "declaration": false }, - "include": ["src/**/*"], -} \ No newline at end of file + "include": [ + "src/**/*", + "tests/**/*" + ] +} diff --git a/tsconfig64.json b/tsconfig64.json deleted file mode 100644 index a13d9c70..00000000 --- a/tsconfig64.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "lib": ["esnext", "dom"], - "outDir": "dist/esm/f64", - "rootDir": "./f64/src", - "sourceMap": true, - "moduleResolution": "node", - "esModuleInterop": true, - "declaration": true - }, - "include": ["f64/src/**/*"], -} \ No newline at end of file diff --git a/typedoc.json b/typedoc.json deleted file mode 100644 index ea39c572..00000000 --- a/typedoc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "out": "docs", - "readme": "README.md", - "defaultCategory": "Instance", - "categoryOrder": [ - "Vector components", - "Color components", - "Swizzle", - "*" - ], - "sort": ["instance-first", "source-order"], - "sidebarLinks": { - "GitHub Repo": "https://github.com/toji/gl-matrix" - } -} \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 00000000..1738f122 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,20 @@ +import { + configDefaults, + defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + exclude: [...configDefaults.exclude], + include: ['./tests/**/*.spec.ts'], + coverage: { + include: ['src/**'], + exclude: ['test/**'], + provider: 'v8', + reporter: ['text', 'json', 'html'] + }, + environment: 'node', + reporters: ['default', 'html'], + setupFiles: './tests/setupExtend.ts', // Extends `expect` with custom matchers. + globalSetup: './tests/setupGlobal.js' // Generate F64 source / tests once before tests runs. + } +}); From d8afed81943aedd7232a4e0a1d3729f876a8a1be Mon Sep 17 00:00:00 2001 From: typhonrt Date: Fri, 14 Jun 2024 17:48:10 -0700 Subject: [PATCH 02/16] TypeDoc categories --- package.json | 13 - scripts/gen-swizzle.js | 19 +- src/_lib/f32/Mat2.ts | 4 + src/_lib/f32/Mat2d.ts | 4 + src/_lib/f32/Mat3.ts | 4 + src/_lib/f32/Mat4.ts | 4 + src/_lib/f32/Quat.ts | 4 + src/_lib/f32/Quat2.ts | 4 + src/_lib/f32/Vec2.ts | 4 + src/_lib/f32/Vec3.ts | 4 + src/_lib/f32/Vec4.ts | 4 + src/_lib/f64/Mat2.ts | 4 + src/_lib/f64/Mat2d.ts | 4 + src/_lib/f64/Mat3.ts | 4 + src/_lib/f64/Mat4.ts | 4 + src/_lib/f64/Quat.ts | 4 + src/_lib/f64/Quat2.ts | 4 + src/_lib/f64/Vec2.ts | 4 + src/_lib/f64/Vec3.ts | 4 + src/_lib/f64/Vec4.ts | 4 + src/types/swizzle/f64/index.ts | 4810 +++++++++++++++++++++++++------- src/types/swizzle/index.ts | 4810 +++++++++++++++++++++++++------- typedoc.json | 15 + 23 files changed, 7796 insertions(+), 1943 deletions(-) create mode 100644 typedoc.json diff --git a/package.json b/package.json index e70fc481..d9355541 100644 --- a/package.json +++ b/package.json @@ -115,18 +115,5 @@ "typedoc": "0.25.12", "typescript": "^5.4.0", "vitest": "^1.6.0" - }, - "typedocOptions": { - "dmtLinksIcon": [ - { - "icon": "./assets/icon/gl-matrix-icon-mono-64.webp", - "title": "Homepage", - "url": "https://glmatrix.net/" - } - ], - "dmtLinksService": { - "GitHub": "https://github.com/toji/gl-matrix", - "NPM": "https://www.npmjs.com/package/gl-matrix" - } } } diff --git a/scripts/gen-swizzle.js b/scripts/gen-swizzle.js index 9359e17d..d9db32c9 100644 --- a/scripts/gen-swizzle.js +++ b/scripts/gen-swizzle.js @@ -103,6 +103,13 @@ const swizzleTypeAlias = { 4: 'Vec4Alias' } +const accessorDocs = (length) => { + return ` /** + * @category Swizzle API + * @returns New instance of swizzled Vec${length} + */`; +}; + let swizzleTypes = ` /** * Vec2 swizzle extension accessors. @@ -110,7 +117,7 @@ let swizzleTypes = ` interface Vec2 { `; -uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ +uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += `${accessorDocs(key.length)} get ${key}(): ${swizzleTypeAlias[key.length]};\n`) swizzleTypes += ` }\n`; @@ -122,10 +129,10 @@ swizzleTypes += ` interface Vec3 { `; -uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ +uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += `${accessorDocs(key.length)} get ${key}(): ${swizzleTypeAlias[key.length]};\n`) -uniqueSwizzlesByComponentCount[3].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ +uniqueSwizzlesByComponentCount[3].forEach((key) => swizzleTypes += `${accessorDocs(key.length)} get ${key}(): ${swizzleTypeAlias[key.length]};\n`) swizzleTypes += ` }\n`; @@ -137,13 +144,13 @@ swizzleTypes += ` interface Vec4 { `; -uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ +uniqueSwizzlesByComponentCount[2].forEach((key) => swizzleTypes += `${accessorDocs(key.length)} get ${key}(): ${swizzleTypeAlias[key.length]};\n`) -uniqueSwizzlesByComponentCount[3].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ +uniqueSwizzlesByComponentCount[3].forEach((key) => swizzleTypes += `${accessorDocs(key.length)} get ${key}(): ${swizzleTypeAlias[key.length]};\n`) -uniqueSwizzlesByComponentCount[4].forEach((key) => swizzleTypes += ` /** @return New instance of swizzled Vec${key.length} */ +uniqueSwizzlesByComponentCount[4].forEach((key) => swizzleTypes += `${accessorDocs(key.length)} get ${key}(): ${swizzleTypeAlias[key.length]};\n`) swizzleTypes += ` }\n`; diff --git a/src/_lib/f32/Mat2.ts b/src/_lib/f32/Mat2.ts index f096f13d..e9dec4a2 100644 --- a/src/_lib/f32/Mat2.ts +++ b/src/_lib/f32/Mat2.ts @@ -13,6 +13,8 @@ export class Mat2 extends Float32Array { /** * Create a {@link Mat2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -138,6 +140,8 @@ export class Mat2 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat2}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Mat2d.ts b/src/_lib/f32/Mat2d.ts index 4ccd26d6..15e35e3d 100644 --- a/src/_lib/f32/Mat2d.ts +++ b/src/_lib/f32/Mat2d.ts @@ -14,6 +14,8 @@ export class Mat2d extends Float32Array { /** * Create a {@link Mat2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -131,6 +133,8 @@ export class Mat2d extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat2d}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Mat3.ts b/src/_lib/f32/Mat3.ts index db7def3e..14777441 100644 --- a/src/_lib/f32/Mat3.ts +++ b/src/_lib/f32/Mat3.ts @@ -14,6 +14,8 @@ export class Mat3 extends Float32Array { /** * Create a {@link Mat3}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -151,6 +153,8 @@ export class Mat3 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat3}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Mat4.ts b/src/_lib/f32/Mat4.ts index a74dd401..5b544dd9 100644 --- a/src/_lib/f32/Mat4.ts +++ b/src/_lib/f32/Mat4.ts @@ -21,6 +21,8 @@ export class Mat4 extends Float32Array { /** * Create a {@link Mat4}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -263,6 +265,8 @@ export class Mat4 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat4}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Quat.ts b/src/_lib/f32/Quat.ts index 33b355b3..4c134aba 100644 --- a/src/_lib/f32/Quat.ts +++ b/src/_lib/f32/Quat.ts @@ -23,6 +23,8 @@ export class Quat extends Float32Array { /** * Create a {@link Quat}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -230,6 +232,8 @@ export class Quat extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Quat}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Quat2.ts b/src/_lib/f32/Quat2.ts index 0c1c14d4..e4ba5583 100644 --- a/src/_lib/f32/Quat2.ts +++ b/src/_lib/f32/Quat2.ts @@ -16,6 +16,8 @@ export class Quat2 extends Float32Array { /** * Create a {@link Quat2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -71,6 +73,8 @@ export class Quat2 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Quat2}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Vec2.ts b/src/_lib/f32/Vec2.ts index 0050a25d..4f785525 100644 --- a/src/_lib/f32/Vec2.ts +++ b/src/_lib/f32/Vec2.ts @@ -8,6 +8,8 @@ import type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matr export class Vec2 extends Float32Array { /** * Create a {@link Vec2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -310,6 +312,8 @@ export class Vec2 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Vec2}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Vec3.ts b/src/_lib/f32/Vec3.ts index d6a54676..d0d6186b 100644 --- a/src/_lib/f32/Vec3.ts +++ b/src/_lib/f32/Vec3.ts @@ -8,6 +8,8 @@ import type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types'; export class Vec3 extends Float32Array { /** * Create a {@link Vec3}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -332,6 +334,8 @@ export class Vec3 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Vec3}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f32/Vec4.ts b/src/_lib/f32/Vec4.ts index 59a2c1d1..907372be 100644 --- a/src/_lib/f32/Vec4.ts +++ b/src/_lib/f32/Vec4.ts @@ -8,6 +8,8 @@ import type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types'; export class Vec4 extends Float32Array { /** * Create a {@link Vec4}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -342,6 +344,8 @@ export class Vec4 extends Float32Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Vec4}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Mat2.ts b/src/_lib/f64/Mat2.ts index f572031e..6940e8d8 100644 --- a/src/_lib/f64/Mat2.ts +++ b/src/_lib/f64/Mat2.ts @@ -13,6 +13,8 @@ export class Mat2 extends Float64Array { /** * Create a {@link Mat2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -138,6 +140,8 @@ export class Mat2 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat2}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Mat2d.ts b/src/_lib/f64/Mat2d.ts index 890838c8..56dbeffc 100644 --- a/src/_lib/f64/Mat2d.ts +++ b/src/_lib/f64/Mat2d.ts @@ -14,6 +14,8 @@ export class Mat2d extends Float64Array { /** * Create a {@link Mat2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -131,6 +133,8 @@ export class Mat2d extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat2d}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Mat3.ts b/src/_lib/f64/Mat3.ts index e62dd4ac..431cf5c1 100644 --- a/src/_lib/f64/Mat3.ts +++ b/src/_lib/f64/Mat3.ts @@ -14,6 +14,8 @@ export class Mat3 extends Float64Array { /** * Create a {@link Mat3}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -151,6 +153,8 @@ export class Mat3 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat3}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Mat4.ts b/src/_lib/f64/Mat4.ts index 780313fe..97ba6b79 100644 --- a/src/_lib/f64/Mat4.ts +++ b/src/_lib/f64/Mat4.ts @@ -21,6 +21,8 @@ export class Mat4 extends Float64Array { /** * Create a {@link Mat4}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { switch(values.length) { @@ -263,6 +265,8 @@ export class Mat4 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Mat4}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Quat.ts b/src/_lib/f64/Quat.ts index 729f3cb0..edde87c8 100644 --- a/src/_lib/f64/Quat.ts +++ b/src/_lib/f64/Quat.ts @@ -23,6 +23,8 @@ export class Quat extends Float64Array { /** * Create a {@link Quat}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -230,6 +232,8 @@ export class Quat extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Quat}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Quat2.ts b/src/_lib/f64/Quat2.ts index eab86a7c..4c9d6c03 100644 --- a/src/_lib/f64/Quat2.ts +++ b/src/_lib/f64/Quat2.ts @@ -16,6 +16,8 @@ export class Quat2 extends Float64Array { /** * Create a {@link Quat2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -71,6 +73,8 @@ export class Quat2 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Quat2}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Vec2.ts b/src/_lib/f64/Vec2.ts index 022451f1..a00cbcb2 100644 --- a/src/_lib/f64/Vec2.ts +++ b/src/_lib/f64/Vec2.ts @@ -8,6 +8,8 @@ import type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matr export class Vec2 extends Float64Array { /** * Create a {@link Vec2}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -310,6 +312,8 @@ export class Vec2 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Vec2}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Vec3.ts b/src/_lib/f64/Vec3.ts index f93023fa..cdbe924a 100644 --- a/src/_lib/f64/Vec3.ts +++ b/src/_lib/f64/Vec3.ts @@ -8,6 +8,8 @@ import type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types'; export class Vec3 extends Float64Array { /** * Create a {@link Vec3}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -332,6 +334,8 @@ export class Vec3 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Vec3}. */ static get BYTE_LENGTH(): number { diff --git a/src/_lib/f64/Vec4.ts b/src/_lib/f64/Vec4.ts index 95b97851..b879e4f2 100644 --- a/src/_lib/f64/Vec4.ts +++ b/src/_lib/f64/Vec4.ts @@ -8,6 +8,8 @@ import type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types'; export class Vec4 extends Float64Array { /** * Create a {@link Vec4}. + * + * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { switch(values.length) { @@ -342,6 +344,8 @@ export class Vec4 extends Float64Array { //=================== /** + * @category Static + * * @returns The number of bytes in a {@link Vec4}. */ static get BYTE_LENGTH(): number { diff --git a/src/types/swizzle/f64/index.ts b/src/types/swizzle/f64/index.ts index 52861ea4..7ee8f113 100644 --- a/src/types/swizzle/f64/index.ts +++ b/src/types/swizzle/f64/index.ts @@ -53,117 +53,285 @@ declare module '#gl-matrix/f64' { * Vec2 swizzle extension accessors. */ interface Vec2 { - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yy(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyy(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyy(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gg(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggg(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggg(): Vec4Alias; } @@ -171,473 +339,1175 @@ declare module '#gl-matrix/f64' { * Vec3 swizzle extension accessors. */ interface Vec3 { - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yy(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyy(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyy(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gg(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggg(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggg(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zz(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzz(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzz(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get br(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bb(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbb(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbb(): Vec4Alias; } @@ -645,1349 +1515,3365 @@ declare module '#gl-matrix/f64' { * Vec4 swizzle extension accessors. */ interface Vec4 { - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yy(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyy(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyy(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gg(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggg(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggg(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zz(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzz(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzz(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get br(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bb(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbb(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbb(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xw(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yw(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zw(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get wx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get wy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get wz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ww(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xwx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xwy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xwz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xww(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ywx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ywy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ywz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yww(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zwx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zwy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zwz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zww(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wwx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wwy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wwz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get www(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwww(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ra(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ga(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ba(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ar(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ag(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ab(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get aa(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rra(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get raa(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gra(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gaa(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bra(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get baa(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get arr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get arg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get arb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ara(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get agr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get agg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get agb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get abr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get abg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get abb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aaa(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rraa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rarr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rarg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rarb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ragr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ragg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ragb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rabr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rabg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rabb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get graa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get garr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get garg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get garb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gagr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gagg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gagb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gabr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gabg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gabb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get braa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get barr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get barg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get barb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bagr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bagg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bagb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get babr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get babg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get babb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get argr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get argg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get argb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get araa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aarr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aarg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aarb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aagr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aagg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aagb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aabr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aabg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aabb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaaa(): Vec4Alias; } diff --git a/src/types/swizzle/index.ts b/src/types/swizzle/index.ts index 4712c29f..26a58758 100644 --- a/src/types/swizzle/index.ts +++ b/src/types/swizzle/index.ts @@ -53,117 +53,285 @@ declare module '#gl-matrix' { * Vec2 swizzle extension accessors. */ interface Vec2 { - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yy(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyy(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyy(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gg(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggg(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggg(): Vec4Alias; } @@ -171,473 +339,1175 @@ declare module '#gl-matrix' { * Vec3 swizzle extension accessors. */ interface Vec3 { - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yy(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyy(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyy(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gg(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggg(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggg(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zz(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzz(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzz(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get br(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bb(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbb(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbb(): Vec4Alias; } @@ -645,1349 +1515,3365 @@ declare module '#gl-matrix' { * Vec4 swizzle extension accessors. */ interface Vec4 { - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yy(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyy(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyy(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gr(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gg(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggg(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggg(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zz(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzz(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzz(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get rb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get gb(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get br(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bg(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get bb(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rrb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get grb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ggb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gbb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get brb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bgb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bbb(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbbb(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get xw(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get yw(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get zw(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get wx(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get wy(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get wz(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ww(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xwx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xwy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xwz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get xww(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ywx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ywy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ywz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get yww(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zwx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zwy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zwz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get zww(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wxw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wyw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wzw(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wwx(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wwy(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get wwz(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get www(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get xwww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get yzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ywww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get zwww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wxww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wywx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wywy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wywz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wyww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wzww(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwxw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwyw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwzw(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwwx(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwwy(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwwz(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get wwww(): Vec4Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ra(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ga(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ba(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ar(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ag(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get ab(): Vec2Alias; - /** @return New instance of swizzled Vec2 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec2 + */ get aa(): Vec2Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rra(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get rab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get raa(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gra(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get gaa(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bra(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get bab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get baa(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get arr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get arg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get arb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get ara(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get agr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get agg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get agb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aga(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get abr(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get abg(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get abb(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aba(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aar(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aag(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aab(): Vec3Alias; - /** @return New instance of swizzled Vec3 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec3 + */ get aaa(): Vec3Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rrab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rraa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rgaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rbaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rarr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rarg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rarb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ragr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ragg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ragb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rabr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rabg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get rabb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get raaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get grab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get graa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get ggaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gbaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get garr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get garg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get garb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gagr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gagg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gagb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gabr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gabg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gabb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get gaaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get brab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get braa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bgaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bbaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get barr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get barg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get barb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bagr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bagg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get bagb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get babr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get babg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get babb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get baaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get argr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get argg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get argb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get arab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get araa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aggr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aggg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aggb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get agaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abrr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abrg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abrb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abra(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abgr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abgg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abgb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abbr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abbg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abbb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get abaa(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aarr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aarg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aarb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aara(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aagr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aagg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aagb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaga(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aabr(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aabg(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aabb(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaba(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaar(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaag(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaab(): Vec4Alias; - /** @return New instance of swizzled Vec4 */ + /** + * @category Swizzle API + * @returns New instance of swizzled Vec4 + */ get aaaa(): Vec4Alias; } diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000..3b77397a --- /dev/null +++ b/typedoc.json @@ -0,0 +1,15 @@ +{ + "categoryOrder": ["Constructor", "Static", "Member", "*", "Swizzle API"], + "defaultCategory": "Member", + "dmtLinksIcon": [ + { + "icon": "./assets/icon/gl-matrix-icon-mono-64.webp", + "title": "Homepage", + "url": "https://glmatrix.net/" + } + ], + "dmtLinksService": { + "GitHub": "https://github.com/toji/gl-matrix", + "NPM": "https://www.npmjs.com/package/gl-matrix" + } +} From 208ced8c75941bdf0df04ca8c9a3365ed2d03b8e Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sat, 15 Jun 2024 17:26:26 -0700 Subject: [PATCH 03/16] Improved `@category` support. --- scripts/gen-swizzle.js | 2 +- src/_lib/f32/Mat2.ts | 62 +- src/_lib/f32/Mat2d.ts | 37 +- src/_lib/f32/Mat3.ts | 48 +- src/_lib/f32/Mat4.ts | 84 +- src/_lib/f32/Quat.ts | 54 +- src/_lib/f32/Quat2.ts | 7 +- src/_lib/f32/Vec2.ts | 89 +- src/_lib/f32/Vec3.ts | 98 +- src/_lib/f32/Vec4.ts | 83 +- src/_lib/f64/Mat2.ts | 62 +- src/_lib/f64/Mat2d.ts | 37 +- src/_lib/f64/Mat3.ts | 48 +- src/_lib/f64/Mat4.ts | 84 +- src/_lib/f64/Quat.ts | 54 +- src/_lib/f64/Quat2.ts | 7 +- src/_lib/f64/Vec2.ts | 89 +- src/_lib/f64/Vec3.ts | 98 +- src/_lib/f64/Vec4.ts | 83 +- src/types/swizzle/f64/index.ts | 1924 ++++++++++++++++---------------- src/types/swizzle/index.ts | 1924 ++++++++++++++++---------------- typedoc.json | 14 +- 22 files changed, 2673 insertions(+), 2315 deletions(-) diff --git a/scripts/gen-swizzle.js b/scripts/gen-swizzle.js index d9db32c9..6610839c 100644 --- a/scripts/gen-swizzle.js +++ b/scripts/gen-swizzle.js @@ -105,7 +105,7 @@ const swizzleTypeAlias = { const accessorDocs = (length) => { return ` /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec${length} */`; }; diff --git a/src/_lib/f32/Mat2.ts b/src/_lib/f32/Mat2.ts index e9dec4a2..faf9bf9c 100644 --- a/src/_lib/f32/Mat2.ts +++ b/src/_lib/f32/Mat2.ts @@ -38,14 +38,16 @@ export class Mat2 extends Float32Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat2.str(this); } @@ -58,8 +60,9 @@ export class Mat2 extends Float32Array { * * @param a the source vector * @returns `this` + * @category Methods */ - copy(a: Readonly): Mat2 { + copy(a: Readonly): this { this.set(a); return this; } @@ -69,8 +72,9 @@ export class Mat2 extends Float32Array { * Equivalent to Mat2.identity(this) * * @returns `this` + * @category Methods */ - identity(): Mat2 { + identity(): this { this.set(Mat2.#IDENTITY_2X2); return this; } @@ -79,28 +83,29 @@ export class Mat2 extends Float32Array { * Multiplies this {@link Mat2} against another one * Equivalent to `Mat2.multiply(this, this, b);` * - * @param out - The receiving Matrix - * @param a - The first operand * @param b - The second operand * @returns `this` + * @category Methods */ - multiply(b: Readonly): Mat2 { - return Mat2.multiply(this, this, b) as Mat2; + multiply(b: Readonly): this { + return Mat2.multiply(this, this, b) as this; } /** * Alias for {@link Mat2.multiply} + * @category Methods */ - mul(b: Readonly): Mat2 { return this; } + mul(b: Readonly): this { return this; } /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` * * @returns `this` + * @category Methods */ - transpose(): Mat2 { - return Mat2.transpose(this, this) as Mat2; + transpose(): this { + return Mat2.transpose(this, this) as this; } /** @@ -108,9 +113,10 @@ export class Mat2 extends Float32Array { * Equivalent to `Mat4.invert(this, this);` * * @returns `this` + * @category Methods */ - invert(): Mat2 { - return Mat2.invert(this, this) as Mat2; + invert(): this { + return Mat2.invert(this, this) as this; } /** @@ -119,9 +125,10 @@ export class Mat2 extends Float32Array { * * @param v - The {@link Vec2} to scale the matrix by * @returns `this` + * @category Methods */ - scale(v: Readonly): Mat2 { - return Mat2.scale(this, this, v) as Mat2; + scale(v: Readonly): this { + return Mat2.scale(this, this, v) as this; } /** @@ -129,10 +136,11 @@ export class Mat2 extends Float32Array { * Equivalent to `Mat2.rotate(this, this, rad);` * * @param rad - the angle to rotate the matrix by - * @returns `out` + * @returns `this` + * @category Methods */ - rotate(rad: number): Mat2 { - return Mat2.rotate(this, this, rad) as Mat2; + rotate(rad: number): this { + return Mat2.rotate(this, this, rad) as this; } //=================== @@ -435,9 +443,10 @@ export class Mat2 extends Float32Array { /** * Creates a {@link Mat2} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.rotate(dest, dest, rad); + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2} receiving operation result @@ -457,9 +466,10 @@ export class Mat2 extends Float32Array { /** * Creates a {@link Mat2} from a vector scaling * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.scale(dest, dest, vec); + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2} receiving operation result @@ -539,7 +549,7 @@ export class Mat2 extends Float32Array { } /** - * Returns whether or not two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first matrix. @@ -556,7 +566,7 @@ export class Mat2 extends Float32Array { } /** - * Returns whether or not two {@link Mat2}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. diff --git a/src/_lib/f32/Mat2d.ts b/src/_lib/f32/Mat2d.ts index 15e35e3d..0d374f9f 100644 --- a/src/_lib/f32/Mat2d.ts +++ b/src/_lib/f32/Mat2d.ts @@ -40,14 +40,16 @@ export class Mat2d extends Float32Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat2d.str(this); } @@ -57,11 +59,12 @@ export class Mat2d extends Float32Array { /** * Copy the values from another {@link Mat2d} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Mat2d { + copy(a: Readonly): this { this.set(a); return this; } @@ -69,10 +72,11 @@ export class Mat2d extends Float32Array { /** * Set `this` to the identity matrix * Equivalent to Mat2d.identity(this) + * @category Methods * * @returns `this` */ - identity(): Mat2d { + identity(): this { this.set(Mat2d.#IDENTITY_2X3); return this; } @@ -80,52 +84,57 @@ export class Mat2d extends Float32Array { /** * Multiplies this {@link Mat2d} against another one * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods * * @param out - The receiving Matrix * @param a - The first operand * @param b - The second operand * @returns `this` */ - multiply(b: Readonly): Mat2d { - return Mat2d.multiply(this, this, b) as Mat2d; + multiply(b: Readonly): this { + return Mat2d.multiply(this, this, b) as this; } /** * Alias for {@link Mat2d.multiply} + * @category Methods */ - mul(b: Readonly): Mat2d { return this; } + mul(b: Readonly): this { return this; } /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to translate by * @returns `this` */ - translate(v: Readonly): Mat2d { - return Mat2d.translate(this, this, v) as Mat2d; + translate(v: Readonly): this { + return Mat2d.translate(this, this, v) as this; } /** * Rotates this {@link Mat2d} by the given angle around the given axis * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by - * @returns `out` + * @returns `this` */ - rotate(rad: number): Mat2d { - return Mat2d.rotate(this, this, rad) as Mat2d; + rotate(rad: number): this { + return Mat2d.rotate(this, this, rad) as this; } /** * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to scale the matrix by * @returns `this` */ - scale(v: Readonly): Mat2d { - return Mat2d.scale(this, this, v) as Mat2d; + scale(v: Readonly): this { + return Mat2d.scale(this, this, v) as this; } //=================== diff --git a/src/_lib/f32/Mat3.ts b/src/_lib/f32/Mat3.ts index 14777441..e774deb0 100644 --- a/src/_lib/f32/Mat3.ts +++ b/src/_lib/f32/Mat3.ts @@ -40,14 +40,16 @@ export class Mat3 extends Float32Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat3.str(this); } @@ -57,11 +59,12 @@ export class Mat3 extends Float32Array { /** * Copy the values from another {@link Mat3} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Mat3 { + copy(a: Readonly): this { this.set(a); return this; } @@ -69,10 +72,11 @@ export class Mat3 extends Float32Array { /** * Set `this` to the identity matrix * Equivalent to Mat3.identity(this) + * @category Methods * * @returns `this` */ - identity(): Mat3 { + identity(): this { this.set(Mat3.#IDENTITY_3X3); return this; } @@ -80,72 +84,79 @@ export class Mat3 extends Float32Array { /** * Multiplies this {@link Mat3} against another one * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods * * @param out - The receiving Matrix * @param a - The first operand * @param b - The second operand * @returns `this` */ - multiply(b: Readonly): Mat3 { - return Mat3.multiply(this, this, b) as Mat3; + multiply(b: Readonly): this { + return Mat3.multiply(this, this, b) as this; } /** * Alias for {@link Mat3.multiply} + * @category Methods */ - mul(b: Readonly): Mat3 { return this; } + mul(b: Readonly): this { return this; } /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` + * @category Methods * * @returns `this` */ - transpose(): Mat3 { - return Mat3.transpose(this, this) as Mat3; + transpose(): this { + return Mat3.transpose(this, this) as this; } /** * Inverts this {@link Mat3} * Equivalent to `Mat4.invert(this, this);` + * @category Methods * * @returns `this` */ - invert(): Mat3 { - return Mat3.invert(this, this) as Mat3; + invert(): this { + return Mat3.invert(this, this) as this; } /** * Translate this {@link Mat3} by the given vector * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to translate by * @returns `this` */ - translate(v: Readonly): Mat3 { - return Mat3.translate(this, this, v) as Mat3; + translate(v: Readonly): this { + return Mat3.translate(this, this, v) as this; } /** * Rotates this {@link Mat3} by the given angle around the given axis * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by - * @returns `out` + * @returns `this` */ - rotate(rad: number): Mat3 { - return Mat3.rotate(this, this, rad) as Mat3; + rotate(rad: number): this { + return Mat3.rotate(this, this, rad) as this; } /** * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to scale the matrix by * @returns `this` */ - scale(v: Readonly): Mat3 { - return Mat3.scale(this, this, v) as Mat3; + scale(v: Readonly): this { + return Mat3.scale(this, this, v) as this; } //=================== @@ -699,6 +710,7 @@ export class Mat3 extends Float32Array { /** * Calculates a {@link Mat3} from the given quaternion + * @category Static * * @param out - {@link Mat3} receiving operation result * @param q - {@link Quat} to create matrix from diff --git a/src/_lib/f32/Mat4.ts b/src/_lib/f32/Mat4.ts index 5b544dd9..8e893659 100644 --- a/src/_lib/f32/Mat4.ts +++ b/src/_lib/f32/Mat4.ts @@ -48,14 +48,16 @@ export class Mat4 extends Float32Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat4.str(this); } @@ -65,11 +67,12 @@ export class Mat4 extends Float32Array { /** * Copy the values from another {@link Mat4} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Mat4 { + copy(a: Readonly): this { this.set(a); return this; } @@ -77,10 +80,11 @@ export class Mat4 extends Float32Array { /** * Set `this` to the identity matrix * Equivalent to Mat4.identity(this) + * @category Methods * * @returns `this` */ - identity(): Mat4 { + identity(): this { this.set(Mat4.#IDENTITY_4X4); return this; } @@ -88,106 +92,114 @@ export class Mat4 extends Float32Array { /** * Multiplies this {@link Mat4} against another one * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods * - * @param out - The receiving Matrix - * @param a - The first operand * @param b - The second operand * @returns `this` */ - multiply(b: Readonly): Mat4 { - return Mat4.multiply(this, this, b) as Mat4; + multiply(b: Readonly): this { + return Mat4.multiply(this, this, b) as this; } /** * Alias for {@link Mat4.multiply} + * @category Methods */ - mul(b: Readonly): Mat4 { return this; } + mul(b: Readonly): this { return this; } /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` + * @category Methods * * @returns `this` */ - transpose(): Mat4 { - return Mat4.transpose(this, this) as Mat4; + transpose(): this { + return Mat4.transpose(this, this) as this; } /** * Inverts this {@link Mat4} * Equivalent to `Mat4.invert(this, this);` + * @category Methods * * @returns `this` */ - invert(): Mat4 { - return Mat4.invert(this, this) as Mat4; + invert(): this { + return Mat4.invert(this, this) as this; } /** * Translate this {@link Mat4} by the given vector * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods * * @param v - The {@link Vec3} to translate by * @returns `this` */ - translate(v: Readonly): Mat4 { - return Mat4.translate(this, this, v) as Mat4; + translate(v: Readonly): this { + return Mat4.translate(this, this, v) as this; } /** * Rotates this {@link Mat4} by the given angle around the given axis * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @param axis - the axis to rotate around - * @returns `out` + * @returns `this` */ - rotate(rad: number, axis: Readonly): Mat4 { - return Mat4.rotate(this, this, rad, axis) as Mat4; + rotate(rad: number, axis: Readonly): this { + return Mat4.rotate(this, this, rad, axis) as this; } /** * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods * * @param v - The {@link Vec3} to scale the matrix by * @returns `this` */ - scale(v: Readonly): Mat4 { - return Mat4.scale(this, this, v) as Mat4; + scale(v: Readonly): this { + return Mat4.scale(this, this, v) as this; } /** * Rotates this {@link Mat4} by the given angle around the X axis * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @returns `this` */ - rotateX(rad: number): Mat4 { - return Mat4.rotateX(this, this, rad) as Mat4; + rotateX(rad: number): this { + return Mat4.rotateX(this, this, rad) as this; } /** * Rotates this {@link Mat4} by the given angle around the Y axis * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @returns `this` */ - rotateY(rad: number): Mat4 { - return Mat4.rotateY(this, this, rad) as Mat4; + rotateY(rad: number): this { + return Mat4.rotateY(this, this, rad) as this; } /** * Rotates this {@link Mat4} by the given angle around the Z axis * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @returns `this` */ - rotateZ(rad: number): Mat4 { - return Mat4.rotateZ(this, this, rad) as Mat4; + rotateZ(rad: number): this { + return Mat4.rotateZ(this, this, rad) as this; } /** @@ -196,6 +208,7 @@ export class Mat4 extends Float32Array { * which matches WebGL/OpenGL's clip volume. * Passing null/undefined/no value for far will generate infinite projection matrix. * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods * * @param fovy - Vertical field of view in radians * @param aspect - Aspect ratio. typically viewport width/height @@ -203,8 +216,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `this` */ - perspectiveNO(fovy: number, aspect: number, near: number, far: number): Mat4 { - return Mat4.perspectiveNO(this, fovy, aspect, near, far) as Mat4; + perspectiveNO(fovy: number, aspect: number, near: number, far: number): this { + return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this; } /** @@ -213,6 +226,7 @@ export class Mat4 extends Float32Array { * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. * Passing null/undefined/no value for far will generate infinite projection matrix. * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods * * @param fovy - Vertical field of view in radians * @param aspect - Aspect ratio. typically viewport width/height @@ -220,8 +234,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `this` */ - perspectiveZO(fovy: number, aspect: number, near: number, far: number): Mat4 { - return Mat4.perspectiveZO(this, fovy, aspect, near, far) as Mat4; + perspectiveZO(fovy: number, aspect: number, near: number, far: number): this { + return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this; } /** @@ -229,6 +243,7 @@ export class Mat4 extends Float32Array { * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], * which matches WebGL/OpenGL's clip volume. * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods * * @param left - Left bound of the frustum * @param right - Right bound of the frustum @@ -238,8 +253,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum * @returns `this` */ - orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4 { - return Mat4.orthoNO(this, left, right, bottom, top, near, far) as Mat4; + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this { + return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this; } /** @@ -247,6 +262,7 @@ export class Mat4 extends Float32Array { * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods * * @param left - Left bound of the frustum * @param right - Right bound of the frustum @@ -256,8 +272,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum * @returns `this` */ - orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4 { - return Mat4.orthoZO(this, left, right, bottom, top, near, far) as Mat4; + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this { + return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this; } //=================== diff --git a/src/_lib/f32/Quat.ts b/src/_lib/f32/Quat.ts index 4c134aba..75ea911c 100644 --- a/src/_lib/f32/Quat.ts +++ b/src/_lib/f32/Quat.ts @@ -49,7 +49,7 @@ export class Quat extends Float32Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -57,28 +57,28 @@ export class Quat extends Float32Array { /** * The x component of the quaternion. Equivalent to `this[0];` - * @category Quaternion components + * @category Quaternion Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the quaternion. Equivalent to `this[1];` - * @category Quaternion components + * @category Quaternion Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } /** * The z component of the quaternion. Equivalent to `this[2];` - * @category Quaternion components + * @category Quaternion Components */ get z(): number { return this[2]; } set z(value: number) { this[2] = value; } /** * The w component of the quaternion. Equivalent to `this[3];` - * @category Quaternion components + * @category Quaternion Components */ get w(): number { return this[3]; } set w(value: number) { this[3] = value; } @@ -89,6 +89,8 @@ export class Quat extends Float32Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { const x = this[0]; @@ -100,12 +102,16 @@ export class Quat extends Float32Array { /** * Alias for {@link Quat.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * A string representation of `this` * Equivalent to `Quat.str(this);` + * + * @category Accessors */ get str(): string { return Quat.str(this); @@ -117,11 +123,12 @@ export class Quat extends Float32Array { /** * Copy the values from another {@link Quat} into `this`. + * @category Methods * * @param a the source quaternion * @returns `this` */ - copy(a: Readonly): Quat { + copy(a: Readonly): this { super.set(a); return this; } @@ -129,10 +136,11 @@ export class Quat extends Float32Array { /** * Set `this` to the identity quaternion * Equivalent to Quat.identity(this) + * @category Methods * * @returns `this` */ - identity(): Quat { + identity(): this { this[0] = 0; this[1] = 0; this[2] = 0; @@ -143,68 +151,73 @@ export class Quat extends Float32Array { /** * Multiplies `this` by a {@link Quat}. * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Quat { - return Quat.multiply(this, this, b) as Quat; + multiply(b: Readonly): this { + return Quat.multiply(this, this, b) as this; } /** * Alias for {@link Quat.multiply} + * @category Methods */ - mul(b: Readonly): Quat { return this; } + mul(b: Readonly): this { return this; } /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods * * @param rad - angle (in radians) to rotate * @returns `this` */ - rotateX(rad: number): Quat { - return Quat.rotateX(this, this, rad) as Quat; + rotateX(rad: number): this { + return Quat.rotateX(this, this, rad) as this; } /** * Rotates `this` by the given angle about the Y axis * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods * * @param rad - angle (in radians) to rotate * @returns `this` */ - rotateY(rad: number): Quat { - return Quat.rotateY(this, this, rad) as Quat; + rotateY(rad: number): this { + return Quat.rotateY(this, this, rad) as this; } /** * Rotates `this` by the given angle about the Z axis * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods * * @param rad - angle (in radians) to rotate * @returns `this` */ - rotateZ(rad: number): Quat { - return Quat.rotateZ(this, this, rad) as Quat; + rotateZ(rad: number): this { + return Quat.rotateZ(this, this, rad) as this; } /** * Inverts `this` * Equivalent to `Quat.invert(this, this);` + * @category Methods * * @returns `this` */ - invert(): Quat { - return Quat.invert(this, this) as Quat; + invert(): this { + return Quat.invert(this, this) as this; } /** * Scales `this` by a scalar number * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods * - * @param out - the receiving vector - * @param a - the vector to scale * @param scale - amount to scale the vector by * @returns `this` */ @@ -219,6 +232,7 @@ export class Quat extends Float32Array { /** * Calculates the dot product of `this` and another {@link Quat} * Equivalent to `Quat.dot(this, b);` + * @category Methods * * @param b - the second operand * @returns dot product of `this` and b diff --git a/src/_lib/f32/Quat2.ts b/src/_lib/f32/Quat2.ts index e4ba5583..21330bf0 100644 --- a/src/_lib/f32/Quat2.ts +++ b/src/_lib/f32/Quat2.ts @@ -42,12 +42,14 @@ export class Quat2 extends Float32Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` + * + * @category Accessors */ get str(): string { return Quat2.str(this); @@ -59,11 +61,12 @@ export class Quat2 extends Float32Array { /** * Copy the values from another {@link Quat2} into `this`. + * @category Methods * * @param a the source dual quaternion * @returns `this` */ - copy(a: Readonly): Quat2 { + copy(a: Readonly): this { super.set(a); return this; } diff --git a/src/_lib/f32/Vec2.ts b/src/_lib/f32/Vec2.ts index 4f785525..9d25a672 100644 --- a/src/_lib/f32/Vec2.ts +++ b/src/_lib/f32/Vec2.ts @@ -37,7 +37,7 @@ export class Vec2 extends Float32Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -45,14 +45,14 @@ export class Vec2 extends Float32Array { /** * The x component of the vector. Equivalent to `this[0];` - * @category Vector components + * @category Vector Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the vector. Equivalent to `this[1];` - * @category Vector components + * @category Vector Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } @@ -62,14 +62,14 @@ export class Vec2 extends Float32Array { /** * The r component of the vector. Equivalent to `this[0];` - * @category Color components + * @category Color Components */ get r(): number { return this[0]; } set r(value: number) { this[0] = value; } /** * The g component of the vector. Equivalent to `this[1];` - * @category Color components + * @category Color Components */ get g(): number { return this[1]; } set g(value: number) { this[1] = value; } @@ -80,32 +80,44 @@ export class Vec2 extends Float32Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { return Math.hypot(this[0], this[1]); } + /** * Alias for {@link Vec2.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * The squared magnitude (length) of `this`. * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors */ get squaredMagnitude(): number { const x = this[0]; const y = this[1]; return x * x + y * y; } + /** * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors */ get sqrMag(): number { return this.squaredMagnitude; } /** * A string representation of `this` * Equivalent to `Vec2.str(this);` + * + * @category Accessors */ get str(): string { return Vec2.str(this); @@ -117,11 +129,12 @@ export class Vec2 extends Float32Array { /** * Copy the values from another {@link Vec2} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Vec2 { + copy(a: Readonly): this { this.set(a); return this; } @@ -131,11 +144,12 @@ export class Vec2 extends Float32Array { /** * Adds a {@link Vec2} to `this`. * Equivalent to `Vec2.add(this, this, b);` + * @category Methods * * @param b - The vector to add to `this` * @returns `this` */ - add(b: Readonly): Vec2 { + add(b: Readonly): this { this[0] += b[0]; this[1] += b[1]; return this; @@ -144,11 +158,12 @@ export class Vec2 extends Float32Array { /** * Subtracts a {@link Vec2} from `this`. * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods * * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): Vec2 { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; return this; @@ -156,51 +171,59 @@ export class Vec2 extends Float32Array { /** * Alias for {@link Vec2.subtract} + * @category Methods */ - sub(b: Readonly): Vec2 { return this; } + sub(b: Readonly): this { return this; } /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Vec2 { + multiply(b: Readonly): this { this[0] *= b[0]; this[1] *= b[1]; return this; } + /** * Alias for {@link Vec2.multiply} + * @category Methods */ - mul(b: Readonly): Vec2 { return this; } + mul(b: Readonly): this { return this; } /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods * * @param b - The vector to divide `this` by - * @returns {Vec2} `this` + * @returns `this` */ - divide(b: Readonly): Vec2 { + divide(b: Readonly): this { this[0] /= b[0]; this[1] /= b[1]; return this; } + /** * Alias for {@link Vec2.divide} + * @category Methods */ - div(b: Readonly): Vec2 { return this; } + div(b: Readonly): this { return this; } /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods * * @param b - Amount to scale `this` by * @returns `this` */ - scale(b: number): Vec2 { + scale(b: number): this { this[0] *= b; this[1] *= b; return this; @@ -209,20 +232,22 @@ export class Vec2 extends Float32Array { /** * Calculates `this` scaled by a scalar value then adds the result to `this`. * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods * * @param b - The vector to add to `this` * @param scale - The amount to scale `b` by before adding * @returns `this` */ - scaleAndAdd(b: Readonly, scale: number): Vec2 { + scaleAndAdd(b: Readonly, scale: number): this { this[0] += b[0] * scale; this[1] += b[1] * scale; return this; } /** - * Calculates the euclidian distance between another {@link Vec2} and `this`. + * Calculates the Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.distance(this, b);` + * @category Methods * * @param b - The vector to calculate the distance to * @returns Distance between `this` and `b` @@ -232,12 +257,14 @@ export class Vec2 extends Float32Array { } /** * Alias for {@link Vec2.distance} + * @category Methods */ dist(b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between another {@link Vec2} and `this`. + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods * * @param b The vector to calculate the squared distance to * @returns Squared distance between `this` and `b` @@ -247,16 +274,18 @@ export class Vec2 extends Float32Array { } /** * Alias for {@link Vec2.squaredDistance} + * @category Methods */ sqrDist(b: Readonly): number { return 0; } /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` + * @category Methods * * @returns `this` */ - negate(): Vec2 { + negate(): this { this[0] *= -1; this[1] *= -1; return this; @@ -265,10 +294,11 @@ export class Vec2 extends Float32Array { /** * Inverts the components of `this`. * Equivalent to `Vec2.inverse(this, this);` + * @category Methods * * @returns `this` */ - invert(): Vec2 { + invert(): this { this[0] = 1.0 / this[0]; this[1] = 1.0 / this[1]; return this; @@ -277,10 +307,11 @@ export class Vec2 extends Float32Array { /** * Sets each component of `this` to it's absolute value. * Equivalent to `Vec2.abs(this, this);` + * @category Methods * * @returns `this` */ - abs(): Vec2 { + abs(): this { this[0] = Math.abs(this[0]); this[1] = Math.abs(this[1]); return this; @@ -289,6 +320,7 @@ export class Vec2 extends Float32Array { /** * Calculates the dot product of this and another {@link Vec2}. * Equivalent to `Vec2.dot(this, b);` + * @category Methods * * @param b - The second operand * @returns Dot product of `this` and `b` @@ -300,11 +332,12 @@ export class Vec2 extends Float32Array { /** * Normalize `this`. * Equivalent to `Vec2.normalize(this, this);` + * @category Methods * * @returns `this` */ - normalize(): Vec2 { - return Vec2.normalize(this, this) as Vec2; + normalize(): this { + return Vec2.normalize(this, this) as this; } //=================== @@ -568,7 +601,7 @@ export class Vec2 extends Float32Array { } /** - * Calculates the euclidian distance between two {@link Vec2}s + * Calculates the Euclidean distance between two {@link Vec2}s * @category Static * * @param a - The first operand @@ -586,7 +619,7 @@ export class Vec2 extends Float32Array { static dist(a: Readonly, b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between two {@link Vec2}s + * Calculates the squared Euclidean distance between two {@link Vec2}s * @category Static * * @param a - The first operand @@ -651,8 +684,10 @@ export class Vec2 extends Float32Array { const y = a[1]; return x * x + y * y; } + /** * Alias for {@link Vec2.squaredLength} + * @category Static */ static sqrLen(a: Readonly, b: Readonly): number { return 0; } @@ -774,6 +809,7 @@ export class Vec2 extends Float32Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; @@ -790,6 +826,7 @@ export class Vec2 extends Float32Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; @@ -807,6 +844,7 @@ export class Vec2 extends Float32Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; @@ -825,6 +863,7 @@ export class Vec2 extends Float32Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; diff --git a/src/_lib/f32/Vec3.ts b/src/_lib/f32/Vec3.ts index d0d6186b..720892aa 100644 --- a/src/_lib/f32/Vec3.ts +++ b/src/_lib/f32/Vec3.ts @@ -32,7 +32,7 @@ export class Vec3 extends Float32Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -40,21 +40,21 @@ export class Vec3 extends Float32Array { /** * The x component of the vector. Equivalent to `this[0];` - * @category Vector components + * @category Vector Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the vector. Equivalent to `this[1];` - * @category Vector components + * @category Vector Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } /** * The z component of the vector. Equivalent to `this[2];` - * @category Vector components + * @category Vector Components */ get z(): number { return this[2]; } set z(value: number) { this[2] = value; } @@ -64,21 +64,21 @@ export class Vec3 extends Float32Array { /** * The r component of the vector. Equivalent to `this[0];` - * @category Color components + * @category Color Components */ get r(): number { return this[0]; } set r(value: number) { this[0] = value; } /** * The g component of the vector. Equivalent to `this[1];` - * @category Color components + * @category Color Components */ get g(): number { return this[1]; } set g(value: number) { this[1] = value; } /** * The b component of the vector. Equivalent to `this[2];` - * @category Color components + * @category Color Components */ get b(): number { return this[2]; } set b(value: number) { this[2] = value; } @@ -89,6 +89,8 @@ export class Vec3 extends Float32Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { const x = this[0]; @@ -96,14 +98,19 @@ export class Vec3 extends Float32Array { const z = this[2]; return Math.sqrt(x * x + y * y + z * z); } + /** * Alias for {@link Vec3.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * The squared magnitude (length) of `this`. * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors */ get squaredMagnitude(): number { const x = this[0]; @@ -111,14 +118,19 @@ export class Vec3 extends Float32Array { const z = this[2]; return x * x + y * y + z * z; } + /** * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors */ get sqrMag(): number { return this.squaredMagnitude; } /** * A string representation of `this` * Equivalent to `Vec3.str(this);` + * + * @category Accessors */ get str(): string { return Vec3.str(this); @@ -130,11 +142,12 @@ export class Vec3 extends Float32Array { /** * Copy the values from another {@link Vec3} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Vec3 { + copy(a: Readonly): this { this.set(a); return this; } @@ -142,11 +155,12 @@ export class Vec3 extends Float32Array { /** * Adds a {@link Vec3} to `this`. * Equivalent to `Vec3.add(this, this, b);` + * @category Methods * * @param b - The vector to add to `this` * @returns `this` */ - add(b: Readonly): Vec3 { + add(b: Readonly): this { this[0] += b[0]; this[1] += b[1]; this[2] += b[2]; @@ -156,11 +170,12 @@ export class Vec3 extends Float32Array { /** * Subtracts a {@link Vec3} from `this`. * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods * * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): Vec3 { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; this[2] -= b[2]; @@ -169,17 +184,19 @@ export class Vec3 extends Float32Array { /** * Alias for {@link Vec3.subtract} + * @category Methods */ - sub(b: Readonly): Vec3 { return this; } + sub(b: Readonly): this { return this; } /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Vec3 { + multiply(b: Readonly): this { this[0] *= b[0]; this[1] *= b[1]; this[2] *= b[2]; @@ -188,17 +205,19 @@ export class Vec3 extends Float32Array { /** * Alias for {@link Vec3.multiply} + * @category Methods */ - mul(b: Readonly): Vec3 { return this; } + mul(b: Readonly): this { return this; } /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods * * @param b - The vector to divide `this` by * @returns `this` */ - divide(b: Readonly): Vec3 { + divide(b: Readonly): this { this[0] /= b[0]; this[1] /= b[1]; this[2] /= b[2]; @@ -207,17 +226,19 @@ export class Vec3 extends Float32Array { /** * Alias for {@link Vec3.divide} + * @category Methods */ - div(b: Readonly): Vec3 { return this; } + div(b: Readonly): this { return this; } /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods * * @param b - Amount to scale `this` by * @returns `this` */ - scale(b: number): Vec3 { + scale(b: number): this { this[0] *= b; this[1] *= b; this[2] *= b; @@ -227,12 +248,13 @@ export class Vec3 extends Float32Array { /** * Calculates `this` scaled by a scalar value then adds the result to `this`. * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods * * @param b - The vector to add to `this` * @param scale - The amount to scale `b` by before adding * @returns `this` */ - scaleAndAdd(b: Readonly, scale: number): Vec3 { + scaleAndAdd(b: Readonly, scale: number): this { this[0] += b[0] * scale; this[1] += b[1] * scale; this[2] += b[2] * scale; @@ -240,8 +262,9 @@ export class Vec3 extends Float32Array { } /** - * Calculates the euclidian distance between another {@link Vec3} and `this`. + * Calculates the Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.distance(this, b);` + * @category Methods * * @param b - The vector to calculate the distance to * @returns Distance between `this` and `b` @@ -251,12 +274,14 @@ export class Vec3 extends Float32Array { } /** * Alias for {@link Vec3.distance} + * @category Methods */ dist(b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between another {@link Vec3} and `this`. + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods * * @param b The vector to calculate the squared distance to * @returns Squared distance between `this` and `b` @@ -264,18 +289,21 @@ export class Vec3 extends Float32Array { squaredDistance(b: Readonly): number { return Vec3.squaredDistance(this, b); } + /** * Alias for {@link Vec3.squaredDistance} + * @category Methods */ sqrDist(b: Readonly): number { return 0; } /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` + * @category Methods * * @returns `this` */ - negate(): Vec3 { + negate(): this { this[0] *= -1; this[1] *= -1; this[2] *= -1; @@ -285,10 +313,11 @@ export class Vec3 extends Float32Array { /** * Inverts the components of `this`. * Equivalent to `Vec3.inverse(this, this);` + * @category Methods * * @returns `this` */ - invert(): Vec3 { + invert(): this { this[0] = 1.0 / this[0]; this[1] = 1.0 / this[1]; this[2] = 1.0 / this[2]; @@ -296,12 +325,13 @@ export class Vec3 extends Float32Array { } /** - * Sets each component of `this` to it's absolute value. + * Sets each component of `this` to its absolute value. * Equivalent to `Vec3.abs(this, this);` + * @category Methods * * @returns `this` */ - abs(): Vec3 { + abs(): this { this[0] = Math.abs(this[0]); this[1] = Math.abs(this[1]); this[2] = Math.abs(this[2]); @@ -311,6 +341,7 @@ export class Vec3 extends Float32Array { /** * Calculates the dot product of this and another {@link Vec3}. * Equivalent to `Vec3.dot(this, b);` + * @category Methods * * @param b - The second operand * @returns Dot product of `this` and `b` @@ -322,11 +353,12 @@ export class Vec3 extends Float32Array { /** * Normalize `this`. * Equivalent to `Vec3.normalize(this, this);` + * @category Methods * * @returns `this` */ - normalize(): Vec3 { - return Vec3.normalize(this, this) as Vec3; + normalize(): this { + return Vec3.normalize(this, this) as this; } //=================== @@ -640,7 +672,7 @@ export class Vec3 extends Float32Array { } /** - * Calculates the euclidian distance between two vec3's + * Calculates the Euclidean distance between two vec3's * @category Static * * @param a - the first operand @@ -655,11 +687,12 @@ export class Vec3 extends Float32Array { } /** * Alias for {@link Vec3.distance} + * @category Static */ static dist(a: Readonly, b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between two vec3's + * Calculates the squared Euclidean distance between two vec3's * @category Static * * @param a - the first operand @@ -672,8 +705,10 @@ export class Vec3 extends Float32Array { const z = b[2] - a[2]; return x * x + y * y + z * z; } + /** * Alias for {@link Vec3.squaredDistance} + * @category Static */ static sqrDist(a: Readonly, b: Readonly): number { return 0; } @@ -692,6 +727,7 @@ export class Vec3 extends Float32Array { } /** * Alias for {@link Vec3.squaredLength} + * @category Static */ static sqrLen(a: Readonly, b: Readonly): number { return 0; } @@ -995,6 +1031,8 @@ export class Vec3 extends Float32Array { /** * Rotate a 3D vector around the x-axis + * @category Static + * * @param out - The receiving vec3 * @param a - The vec3 point to rotate * @param b - The origin of the rotation @@ -1020,6 +1058,8 @@ export class Vec3 extends Float32Array { /** * Rotate a 3D vector around the y-axis + * @category Static + * * @param out - The receiving vec3 * @param a - The vec3 point to rotate * @param b - The origin of the rotation @@ -1045,6 +1085,8 @@ export class Vec3 extends Float32Array { /** * Rotate a 3D vector around the z-axis + * @category Static + * * @param out - The receiving vec3 * @param a - The vec3 point to rotate * @param b - The origin of the rotation @@ -1070,6 +1112,8 @@ export class Vec3 extends Float32Array { /** * Get the angle between two 3D vectors + * @category Static + * * @param a - The first operand * @param b - The second operand * @returns The angle in radians diff --git a/src/_lib/f32/Vec4.ts b/src/_lib/f32/Vec4.ts index 907372be..dbe969f9 100644 --- a/src/_lib/f32/Vec4.ts +++ b/src/_lib/f32/Vec4.ts @@ -32,7 +32,7 @@ export class Vec4 extends Float32Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -40,28 +40,28 @@ export class Vec4 extends Float32Array { /** * The x component of the vector. Equivalent to `this[0];` - * @category Vector components + * @category Vector Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the vector. Equivalent to `this[1];` - * @category Vector components + * @category Vector Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } /** * The z component of the vector. Equivalent to `this[2];` - * @category Vector components + * @category Vector Components */ get z(): number { return this[2]; } set z(value: number) { this[2] = value; } /** * The w component of the vector. Equivalent to `this[3];` - * @category Vector components + * @category Vector Components */ get w(): number { return this[3]; } set w(value: number) { this[3] = value; } @@ -71,28 +71,28 @@ export class Vec4 extends Float32Array { /** * The r component of the vector. Equivalent to `this[0];` - * @category Color components + * @category Color Components */ get r(): number { return this[0]; } set r(value: number) { this[0] = value; } /** * The g component of the vector. Equivalent to `this[1];` - * @category Color components + * @category Color Components */ get g(): number { return this[1]; } set g(value: number) { this[1] = value; } /** * The b component of the vector. Equivalent to `this[2];` - * @category Color components + * @category Color Components */ get b(): number { return this[2]; } set b(value: number) { this[2] = value; } /** * The a component of the vector. Equivalent to `this[3];` - * @category Color components + * @category Color Components */ get a(): number { return this[3]; } set a(value: number) { this[3] = value; } @@ -103,6 +103,8 @@ export class Vec4 extends Float32Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { const x = this[0]; @@ -114,12 +116,16 @@ export class Vec4 extends Float32Array { /** * Alias for {@link Vec4.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * A string representation of `this` * Equivalent to `Vec4.str(this);` + * + * @category Accessors */ get str(): string { return Vec4.str(this); @@ -131,11 +137,12 @@ export class Vec4 extends Float32Array { /** * Copy the values from another {@link Vec4} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Vec4 { + copy(a: Readonly): this { super.set(a); return this; } @@ -143,11 +150,12 @@ export class Vec4 extends Float32Array { /** * Adds a {@link Vec4} to `this`. * Equivalent to `Vec4.add(this, this, b);` + * @category Methods * * @param b - The vector to add to `this` * @returns `this` */ - add(b: Readonly): Vec4 { + add(b: Readonly): this { this[0] += b[0]; this[1] += b[1]; this[2] += b[2]; @@ -158,11 +166,12 @@ export class Vec4 extends Float32Array { /** * Subtracts a {@link Vec4} from `this`. * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods * * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): Vec4 { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; this[2] -= b[2]; @@ -172,17 +181,19 @@ export class Vec4 extends Float32Array { /** * Alias for {@link Vec4.subtract} + * @category Methods */ - sub(b: Readonly): Vec4 { return this; } + sub(b: Readonly): this { return this; } /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Vec4 { + multiply(b: Readonly): this { this[0] *= b[0]; this[1] *= b[1]; this[2] *= b[2]; @@ -192,17 +203,19 @@ export class Vec4 extends Float32Array { /** * Alias for {@link Vec4.multiply} + * @category Methods */ - mul(b: Readonly): Vec4 { return this; } + mul(b: Readonly): this { return this; } /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods * * @param b - The vector to divide `this` by * @returns `this` */ - divide(b: Readonly): Vec4 { + divide(b: Readonly): this { this[0] /= b[0]; this[1] /= b[1]; this[2] /= b[2]; @@ -212,17 +225,19 @@ export class Vec4 extends Float32Array { /** * Alias for {@link Vec4.divide} + * @category Methods */ - div(b: Readonly): Vec4 { return this; } + div(b: Readonly): this { return this; } /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods * * @param b - Amount to scale `this` by * @returns `this` */ - scale(b: number): Vec4 { + scale(b: number): this { this[0] *= b; this[1] *= b; this[2] *= b; @@ -233,12 +248,13 @@ export class Vec4 extends Float32Array { /** * Calculates `this` scaled by a scalar value then adds the result to `this`. * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods * * @param b - The vector to add to `this` * @param scale - The amount to scale `b` by before adding * @returns `this` */ - scaleAndAdd(b: Readonly, scale: number): Vec4 { + scaleAndAdd(b: Readonly, scale: number): this { this[0] += b[0] * scale; this[1] += b[1] * scale; this[2] += b[2] * scale; @@ -247,8 +263,9 @@ export class Vec4 extends Float32Array { } /** - * Calculates the euclidian distance between another {@link Vec4} and `this`. + * Calculates the Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.distance(this, b);` + * @category Methods * * @param b - The vector to calculate the distance to * @returns Distance between `this` and `b` @@ -256,14 +273,17 @@ export class Vec4 extends Float32Array { distance(b: Readonly): number { return Vec4.distance(this, b); } + /** * Alias for {@link Vec4.distance} + * @category Methods */ dist(b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between another {@link Vec4} and `this`. + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods * * @param b The vector to calculate the squared distance to * @returns Squared distance between `this` and `b` @@ -271,18 +291,21 @@ export class Vec4 extends Float32Array { squaredDistance(b: Readonly): number { return Vec4.squaredDistance(this, b); } + /** * Alias for {@link Vec4.squaredDistance} + * @category Methods */ sqrDist(b: Readonly): number { return 0; } /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` + * @category Methods * * @returns `this` */ - negate(): Vec4 { + negate(): this { this[0] *= -1; this[1] *= -1; this[2] *= -1; @@ -293,10 +316,11 @@ export class Vec4 extends Float32Array { /** * Inverts the components of `this`. * Equivalent to `Vec4.inverse(this, this);` + * @category Methods * * @returns `this` */ - invert(): Vec4 { + invert(): this { this[0] = 1.0 / this[0]; this[1] = 1.0 / this[1]; this[2] = 1.0 / this[2]; @@ -307,10 +331,11 @@ export class Vec4 extends Float32Array { /** * Sets each component of `this` to it's absolute value. * Equivalent to `Vec4.abs(this, this);` + * @category Methods * * @returns `this` */ - abs(): Vec4 { + abs(): this { this[0] = Math.abs(this[0]); this[1] = Math.abs(this[1]); this[2] = Math.abs(this[2]); @@ -321,6 +346,7 @@ export class Vec4 extends Float32Array { /** * Calculates the dot product of this and another {@link Vec4}. * Equivalent to `Vec4.dot(this, b);` + * @category Methods * * @param b - The second operand * @returns Dot product of `this` and `b` @@ -332,11 +358,12 @@ export class Vec4 extends Float32Array { /** * Normalize `this`. * Equivalent to `Vec4.normalize(this, this);` + * @category Methods * * @returns `this` */ - normalize(): Vec4 { - return Vec4.normalize(this, this) as Vec4; + normalize(): this { + return Vec4.normalize(this, this) as this; } //=================== @@ -630,7 +657,7 @@ export class Vec4 extends Float32Array { } /** - * Calculates the euclidian distance between two {@link Vec4}'s + * Calculates the Euclidean distance between two {@link Vec4}'s * @category Static * * @param a - the first operand @@ -651,7 +678,7 @@ export class Vec4 extends Float32Array { static dist(a: Readonly, b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between two {@link Vec4}'s + * Calculates the squared Euclidean distance between two {@link Vec4}'s * @category Static * * @param a - the first operand diff --git a/src/_lib/f64/Mat2.ts b/src/_lib/f64/Mat2.ts index 6940e8d8..30e12abd 100644 --- a/src/_lib/f64/Mat2.ts +++ b/src/_lib/f64/Mat2.ts @@ -38,14 +38,16 @@ export class Mat2 extends Float64Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat2.str(this); } @@ -58,8 +60,9 @@ export class Mat2 extends Float64Array { * * @param a the source vector * @returns `this` + * @category Methods */ - copy(a: Readonly): Mat2 { + copy(a: Readonly): this { this.set(a); return this; } @@ -69,8 +72,9 @@ export class Mat2 extends Float64Array { * Equivalent to Mat2.identity(this) * * @returns `this` + * @category Methods */ - identity(): Mat2 { + identity(): this { this.set(Mat2.#IDENTITY_2X2); return this; } @@ -79,28 +83,29 @@ export class Mat2 extends Float64Array { * Multiplies this {@link Mat2} against another one * Equivalent to `Mat2.multiply(this, this, b);` * - * @param out - The receiving Matrix - * @param a - The first operand * @param b - The second operand * @returns `this` + * @category Methods */ - multiply(b: Readonly): Mat2 { - return Mat2.multiply(this, this, b) as Mat2; + multiply(b: Readonly): this { + return Mat2.multiply(this, this, b) as this; } /** * Alias for {@link Mat2.multiply} + * @category Methods */ - mul(b: Readonly): Mat2 { return this; } + mul(b: Readonly): this { return this; } /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` * * @returns `this` + * @category Methods */ - transpose(): Mat2 { - return Mat2.transpose(this, this) as Mat2; + transpose(): this { + return Mat2.transpose(this, this) as this; } /** @@ -108,9 +113,10 @@ export class Mat2 extends Float64Array { * Equivalent to `Mat4.invert(this, this);` * * @returns `this` + * @category Methods */ - invert(): Mat2 { - return Mat2.invert(this, this) as Mat2; + invert(): this { + return Mat2.invert(this, this) as this; } /** @@ -119,9 +125,10 @@ export class Mat2 extends Float64Array { * * @param v - The {@link Vec2} to scale the matrix by * @returns `this` + * @category Methods */ - scale(v: Readonly): Mat2 { - return Mat2.scale(this, this, v) as Mat2; + scale(v: Readonly): this { + return Mat2.scale(this, this, v) as this; } /** @@ -129,10 +136,11 @@ export class Mat2 extends Float64Array { * Equivalent to `Mat2.rotate(this, this, rad);` * * @param rad - the angle to rotate the matrix by - * @returns `out` + * @returns `this` + * @category Methods */ - rotate(rad: number): Mat2 { - return Mat2.rotate(this, this, rad) as Mat2; + rotate(rad: number): this { + return Mat2.rotate(this, this, rad) as this; } //=================== @@ -435,9 +443,10 @@ export class Mat2 extends Float64Array { /** * Creates a {@link Mat2} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.rotate(dest, dest, rad); + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2} receiving operation result @@ -457,9 +466,10 @@ export class Mat2 extends Float64Array { /** * Creates a {@link Mat2} from a vector scaling * This is equivalent to (but much faster than): - * - * mat2.identity(dest); - * mat2.scale(dest, dest, vec); + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2} receiving operation result @@ -539,7 +549,7 @@ export class Mat2 extends Float64Array { } /** - * Returns whether or not two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first matrix. @@ -556,7 +566,7 @@ export class Mat2 extends Float64Array { } /** - * Returns whether or not two {@link Mat2}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. diff --git a/src/_lib/f64/Mat2d.ts b/src/_lib/f64/Mat2d.ts index 56dbeffc..3056e3e1 100644 --- a/src/_lib/f64/Mat2d.ts +++ b/src/_lib/f64/Mat2d.ts @@ -40,14 +40,16 @@ export class Mat2d extends Float64Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat2d.str(this); } @@ -57,11 +59,12 @@ export class Mat2d extends Float64Array { /** * Copy the values from another {@link Mat2d} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Mat2d { + copy(a: Readonly): this { this.set(a); return this; } @@ -69,10 +72,11 @@ export class Mat2d extends Float64Array { /** * Set `this` to the identity matrix * Equivalent to Mat2d.identity(this) + * @category Methods * * @returns `this` */ - identity(): Mat2d { + identity(): this { this.set(Mat2d.#IDENTITY_2X3); return this; } @@ -80,52 +84,57 @@ export class Mat2d extends Float64Array { /** * Multiplies this {@link Mat2d} against another one * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods * * @param out - The receiving Matrix * @param a - The first operand * @param b - The second operand * @returns `this` */ - multiply(b: Readonly): Mat2d { - return Mat2d.multiply(this, this, b) as Mat2d; + multiply(b: Readonly): this { + return Mat2d.multiply(this, this, b) as this; } /** * Alias for {@link Mat2d.multiply} + * @category Methods */ - mul(b: Readonly): Mat2d { return this; } + mul(b: Readonly): this { return this; } /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to translate by * @returns `this` */ - translate(v: Readonly): Mat2d { - return Mat2d.translate(this, this, v) as Mat2d; + translate(v: Readonly): this { + return Mat2d.translate(this, this, v) as this; } /** * Rotates this {@link Mat2d} by the given angle around the given axis * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by - * @returns `out` + * @returns `this` */ - rotate(rad: number): Mat2d { - return Mat2d.rotate(this, this, rad) as Mat2d; + rotate(rad: number): this { + return Mat2d.rotate(this, this, rad) as this; } /** * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to scale the matrix by * @returns `this` */ - scale(v: Readonly): Mat2d { - return Mat2d.scale(this, this, v) as Mat2d; + scale(v: Readonly): this { + return Mat2d.scale(this, this, v) as this; } //=================== diff --git a/src/_lib/f64/Mat3.ts b/src/_lib/f64/Mat3.ts index 431cf5c1..795cbb3f 100644 --- a/src/_lib/f64/Mat3.ts +++ b/src/_lib/f64/Mat3.ts @@ -40,14 +40,16 @@ export class Mat3 extends Float64Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat3.str(this); } @@ -57,11 +59,12 @@ export class Mat3 extends Float64Array { /** * Copy the values from another {@link Mat3} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Mat3 { + copy(a: Readonly): this { this.set(a); return this; } @@ -69,10 +72,11 @@ export class Mat3 extends Float64Array { /** * Set `this` to the identity matrix * Equivalent to Mat3.identity(this) + * @category Methods * * @returns `this` */ - identity(): Mat3 { + identity(): this { this.set(Mat3.#IDENTITY_3X3); return this; } @@ -80,72 +84,79 @@ export class Mat3 extends Float64Array { /** * Multiplies this {@link Mat3} against another one * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods * * @param out - The receiving Matrix * @param a - The first operand * @param b - The second operand * @returns `this` */ - multiply(b: Readonly): Mat3 { - return Mat3.multiply(this, this, b) as Mat3; + multiply(b: Readonly): this { + return Mat3.multiply(this, this, b) as this; } /** * Alias for {@link Mat3.multiply} + * @category Methods */ - mul(b: Readonly): Mat3 { return this; } + mul(b: Readonly): this { return this; } /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` + * @category Methods * * @returns `this` */ - transpose(): Mat3 { - return Mat3.transpose(this, this) as Mat3; + transpose(): this { + return Mat3.transpose(this, this) as this; } /** * Inverts this {@link Mat3} * Equivalent to `Mat4.invert(this, this);` + * @category Methods * * @returns `this` */ - invert(): Mat3 { - return Mat3.invert(this, this) as Mat3; + invert(): this { + return Mat3.invert(this, this) as this; } /** * Translate this {@link Mat3} by the given vector * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to translate by * @returns `this` */ - translate(v: Readonly): Mat3 { - return Mat3.translate(this, this, v) as Mat3; + translate(v: Readonly): this { + return Mat3.translate(this, this, v) as this; } /** * Rotates this {@link Mat3} by the given angle around the given axis * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by - * @returns `out` + * @returns `this` */ - rotate(rad: number): Mat3 { - return Mat3.rotate(this, this, rad) as Mat3; + rotate(rad: number): this { + return Mat3.rotate(this, this, rad) as this; } /** * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods * * @param v - The {@link Vec2} to scale the matrix by * @returns `this` */ - scale(v: Readonly): Mat3 { - return Mat3.scale(this, this, v) as Mat3; + scale(v: Readonly): this { + return Mat3.scale(this, this, v) as this; } //=================== @@ -699,6 +710,7 @@ export class Mat3 extends Float64Array { /** * Calculates a {@link Mat3} from the given quaternion + * @category Static * * @param out - {@link Mat3} receiving operation result * @param q - {@link Quat} to create matrix from diff --git a/src/_lib/f64/Mat4.ts b/src/_lib/f64/Mat4.ts index 97ba6b79..d5d6bc12 100644 --- a/src/_lib/f64/Mat4.ts +++ b/src/_lib/f64/Mat4.ts @@ -48,14 +48,16 @@ export class Mat4 extends Float64Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` + * + * @category Accessors */ - get str(): string { + get str(): string { return Mat4.str(this); } @@ -65,11 +67,12 @@ export class Mat4 extends Float64Array { /** * Copy the values from another {@link Mat4} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Mat4 { + copy(a: Readonly): this { this.set(a); return this; } @@ -77,10 +80,11 @@ export class Mat4 extends Float64Array { /** * Set `this` to the identity matrix * Equivalent to Mat4.identity(this) + * @category Methods * * @returns `this` */ - identity(): Mat4 { + identity(): this { this.set(Mat4.#IDENTITY_4X4); return this; } @@ -88,106 +92,114 @@ export class Mat4 extends Float64Array { /** * Multiplies this {@link Mat4} against another one * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods * - * @param out - The receiving Matrix - * @param a - The first operand * @param b - The second operand * @returns `this` */ - multiply(b: Readonly): Mat4 { - return Mat4.multiply(this, this, b) as Mat4; + multiply(b: Readonly): this { + return Mat4.multiply(this, this, b) as this; } /** * Alias for {@link Mat4.multiply} + * @category Methods */ - mul(b: Readonly): Mat4 { return this; } + mul(b: Readonly): this { return this; } /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` + * @category Methods * * @returns `this` */ - transpose(): Mat4 { - return Mat4.transpose(this, this) as Mat4; + transpose(): this { + return Mat4.transpose(this, this) as this; } /** * Inverts this {@link Mat4} * Equivalent to `Mat4.invert(this, this);` + * @category Methods * * @returns `this` */ - invert(): Mat4 { - return Mat4.invert(this, this) as Mat4; + invert(): this { + return Mat4.invert(this, this) as this; } /** * Translate this {@link Mat4} by the given vector * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods * * @param v - The {@link Vec3} to translate by * @returns `this` */ - translate(v: Readonly): Mat4 { - return Mat4.translate(this, this, v) as Mat4; + translate(v: Readonly): this { + return Mat4.translate(this, this, v) as this; } /** * Rotates this {@link Mat4} by the given angle around the given axis * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @param axis - the axis to rotate around - * @returns `out` + * @returns `this` */ - rotate(rad: number, axis: Readonly): Mat4 { - return Mat4.rotate(this, this, rad, axis) as Mat4; + rotate(rad: number, axis: Readonly): this { + return Mat4.rotate(this, this, rad, axis) as this; } /** * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods * * @param v - The {@link Vec3} to scale the matrix by * @returns `this` */ - scale(v: Readonly): Mat4 { - return Mat4.scale(this, this, v) as Mat4; + scale(v: Readonly): this { + return Mat4.scale(this, this, v) as this; } /** * Rotates this {@link Mat4} by the given angle around the X axis * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @returns `this` */ - rotateX(rad: number): Mat4 { - return Mat4.rotateX(this, this, rad) as Mat4; + rotateX(rad: number): this { + return Mat4.rotateX(this, this, rad) as this; } /** * Rotates this {@link Mat4} by the given angle around the Y axis * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @returns `this` */ - rotateY(rad: number): Mat4 { - return Mat4.rotateY(this, this, rad) as Mat4; + rotateY(rad: number): this { + return Mat4.rotateY(this, this, rad) as this; } /** * Rotates this {@link Mat4} by the given angle around the Z axis * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods * * @param rad - the angle to rotate the matrix by * @returns `this` */ - rotateZ(rad: number): Mat4 { - return Mat4.rotateZ(this, this, rad) as Mat4; + rotateZ(rad: number): this { + return Mat4.rotateZ(this, this, rad) as this; } /** @@ -196,6 +208,7 @@ export class Mat4 extends Float64Array { * which matches WebGL/OpenGL's clip volume. * Passing null/undefined/no value for far will generate infinite projection matrix. * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods * * @param fovy - Vertical field of view in radians * @param aspect - Aspect ratio. typically viewport width/height @@ -203,8 +216,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `this` */ - perspectiveNO(fovy: number, aspect: number, near: number, far: number): Mat4 { - return Mat4.perspectiveNO(this, fovy, aspect, near, far) as Mat4; + perspectiveNO(fovy: number, aspect: number, near: number, far: number): this { + return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this; } /** @@ -213,6 +226,7 @@ export class Mat4 extends Float64Array { * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. * Passing null/undefined/no value for far will generate infinite projection matrix. * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods * * @param fovy - Vertical field of view in radians * @param aspect - Aspect ratio. typically viewport width/height @@ -220,8 +234,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `this` */ - perspectiveZO(fovy: number, aspect: number, near: number, far: number): Mat4 { - return Mat4.perspectiveZO(this, fovy, aspect, near, far) as Mat4; + perspectiveZO(fovy: number, aspect: number, near: number, far: number): this { + return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this; } /** @@ -229,6 +243,7 @@ export class Mat4 extends Float64Array { * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], * which matches WebGL/OpenGL's clip volume. * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods * * @param left - Left bound of the frustum * @param right - Right bound of the frustum @@ -238,8 +253,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum * @returns `this` */ - orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4 { - return Mat4.orthoNO(this, left, right, bottom, top, near, far) as Mat4; + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this { + return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this; } /** @@ -247,6 +262,7 @@ export class Mat4 extends Float64Array { * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods * * @param left - Left bound of the frustum * @param right - Right bound of the frustum @@ -256,8 +272,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum * @returns `this` */ - orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4 { - return Mat4.orthoZO(this, left, right, bottom, top, near, far) as Mat4; + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this { + return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this; } //=================== diff --git a/src/_lib/f64/Quat.ts b/src/_lib/f64/Quat.ts index edde87c8..57e6a9e9 100644 --- a/src/_lib/f64/Quat.ts +++ b/src/_lib/f64/Quat.ts @@ -49,7 +49,7 @@ export class Quat extends Float64Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -57,28 +57,28 @@ export class Quat extends Float64Array { /** * The x component of the quaternion. Equivalent to `this[0];` - * @category Quaternion components + * @category Quaternion Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the quaternion. Equivalent to `this[1];` - * @category Quaternion components + * @category Quaternion Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } /** * The z component of the quaternion. Equivalent to `this[2];` - * @category Quaternion components + * @category Quaternion Components */ get z(): number { return this[2]; } set z(value: number) { this[2] = value; } /** * The w component of the quaternion. Equivalent to `this[3];` - * @category Quaternion components + * @category Quaternion Components */ get w(): number { return this[3]; } set w(value: number) { this[3] = value; } @@ -89,6 +89,8 @@ export class Quat extends Float64Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { const x = this[0]; @@ -100,12 +102,16 @@ export class Quat extends Float64Array { /** * Alias for {@link Quat.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * A string representation of `this` * Equivalent to `Quat.str(this);` + * + * @category Accessors */ get str(): string { return Quat.str(this); @@ -117,11 +123,12 @@ export class Quat extends Float64Array { /** * Copy the values from another {@link Quat} into `this`. + * @category Methods * * @param a the source quaternion * @returns `this` */ - copy(a: Readonly): Quat { + copy(a: Readonly): this { super.set(a); return this; } @@ -129,10 +136,11 @@ export class Quat extends Float64Array { /** * Set `this` to the identity quaternion * Equivalent to Quat.identity(this) + * @category Methods * * @returns `this` */ - identity(): Quat { + identity(): this { this[0] = 0; this[1] = 0; this[2] = 0; @@ -143,68 +151,73 @@ export class Quat extends Float64Array { /** * Multiplies `this` by a {@link Quat}. * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Quat { - return Quat.multiply(this, this, b) as Quat; + multiply(b: Readonly): this { + return Quat.multiply(this, this, b) as this; } /** * Alias for {@link Quat.multiply} + * @category Methods */ - mul(b: Readonly): Quat { return this; } + mul(b: Readonly): this { return this; } /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods * * @param rad - angle (in radians) to rotate * @returns `this` */ - rotateX(rad: number): Quat { - return Quat.rotateX(this, this, rad) as Quat; + rotateX(rad: number): this { + return Quat.rotateX(this, this, rad) as this; } /** * Rotates `this` by the given angle about the Y axis * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods * * @param rad - angle (in radians) to rotate * @returns `this` */ - rotateY(rad: number): Quat { - return Quat.rotateY(this, this, rad) as Quat; + rotateY(rad: number): this { + return Quat.rotateY(this, this, rad) as this; } /** * Rotates `this` by the given angle about the Z axis * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods * * @param rad - angle (in radians) to rotate * @returns `this` */ - rotateZ(rad: number): Quat { - return Quat.rotateZ(this, this, rad) as Quat; + rotateZ(rad: number): this { + return Quat.rotateZ(this, this, rad) as this; } /** * Inverts `this` * Equivalent to `Quat.invert(this, this);` + * @category Methods * * @returns `this` */ - invert(): Quat { - return Quat.invert(this, this) as Quat; + invert(): this { + return Quat.invert(this, this) as this; } /** * Scales `this` by a scalar number * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods * - * @param out - the receiving vector - * @param a - the vector to scale * @param scale - amount to scale the vector by * @returns `this` */ @@ -219,6 +232,7 @@ export class Quat extends Float64Array { /** * Calculates the dot product of `this` and another {@link Quat} * Equivalent to `Quat.dot(this, b);` + * @category Methods * * @param b - the second operand * @returns dot product of `this` and b diff --git a/src/_lib/f64/Quat2.ts b/src/_lib/f64/Quat2.ts index 4c9d6c03..ad997163 100644 --- a/src/_lib/f64/Quat2.ts +++ b/src/_lib/f64/Quat2.ts @@ -42,12 +42,14 @@ export class Quat2 extends Float64Array { } //============ - // Attributes + // Accessors //============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` + * + * @category Accessors */ get str(): string { return Quat2.str(this); @@ -59,11 +61,12 @@ export class Quat2 extends Float64Array { /** * Copy the values from another {@link Quat2} into `this`. + * @category Methods * * @param a the source dual quaternion * @returns `this` */ - copy(a: Readonly): Quat2 { + copy(a: Readonly): this { super.set(a); return this; } diff --git a/src/_lib/f64/Vec2.ts b/src/_lib/f64/Vec2.ts index a00cbcb2..5df3b2fb 100644 --- a/src/_lib/f64/Vec2.ts +++ b/src/_lib/f64/Vec2.ts @@ -37,7 +37,7 @@ export class Vec2 extends Float64Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -45,14 +45,14 @@ export class Vec2 extends Float64Array { /** * The x component of the vector. Equivalent to `this[0];` - * @category Vector components + * @category Vector Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the vector. Equivalent to `this[1];` - * @category Vector components + * @category Vector Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } @@ -62,14 +62,14 @@ export class Vec2 extends Float64Array { /** * The r component of the vector. Equivalent to `this[0];` - * @category Color components + * @category Color Components */ get r(): number { return this[0]; } set r(value: number) { this[0] = value; } /** * The g component of the vector. Equivalent to `this[1];` - * @category Color components + * @category Color Components */ get g(): number { return this[1]; } set g(value: number) { this[1] = value; } @@ -80,32 +80,44 @@ export class Vec2 extends Float64Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { return Math.hypot(this[0], this[1]); } + /** * Alias for {@link Vec2.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * The squared magnitude (length) of `this`. * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors */ get squaredMagnitude(): number { const x = this[0]; const y = this[1]; return x * x + y * y; } + /** * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors */ get sqrMag(): number { return this.squaredMagnitude; } /** * A string representation of `this` * Equivalent to `Vec2.str(this);` + * + * @category Accessors */ get str(): string { return Vec2.str(this); @@ -117,11 +129,12 @@ export class Vec2 extends Float64Array { /** * Copy the values from another {@link Vec2} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Vec2 { + copy(a: Readonly): this { this.set(a); return this; } @@ -131,11 +144,12 @@ export class Vec2 extends Float64Array { /** * Adds a {@link Vec2} to `this`. * Equivalent to `Vec2.add(this, this, b);` + * @category Methods * * @param b - The vector to add to `this` * @returns `this` */ - add(b: Readonly): Vec2 { + add(b: Readonly): this { this[0] += b[0]; this[1] += b[1]; return this; @@ -144,11 +158,12 @@ export class Vec2 extends Float64Array { /** * Subtracts a {@link Vec2} from `this`. * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods * * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): Vec2 { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; return this; @@ -156,51 +171,59 @@ export class Vec2 extends Float64Array { /** * Alias for {@link Vec2.subtract} + * @category Methods */ - sub(b: Readonly): Vec2 { return this; } + sub(b: Readonly): this { return this; } /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Vec2 { + multiply(b: Readonly): this { this[0] *= b[0]; this[1] *= b[1]; return this; } + /** * Alias for {@link Vec2.multiply} + * @category Methods */ - mul(b: Readonly): Vec2 { return this; } + mul(b: Readonly): this { return this; } /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods * * @param b - The vector to divide `this` by - * @returns {Vec2} `this` + * @returns `this` */ - divide(b: Readonly): Vec2 { + divide(b: Readonly): this { this[0] /= b[0]; this[1] /= b[1]; return this; } + /** * Alias for {@link Vec2.divide} + * @category Methods */ - div(b: Readonly): Vec2 { return this; } + div(b: Readonly): this { return this; } /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods * * @param b - Amount to scale `this` by * @returns `this` */ - scale(b: number): Vec2 { + scale(b: number): this { this[0] *= b; this[1] *= b; return this; @@ -209,20 +232,22 @@ export class Vec2 extends Float64Array { /** * Calculates `this` scaled by a scalar value then adds the result to `this`. * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods * * @param b - The vector to add to `this` * @param scale - The amount to scale `b` by before adding * @returns `this` */ - scaleAndAdd(b: Readonly, scale: number): Vec2 { + scaleAndAdd(b: Readonly, scale: number): this { this[0] += b[0] * scale; this[1] += b[1] * scale; return this; } /** - * Calculates the euclidian distance between another {@link Vec2} and `this`. + * Calculates the Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.distance(this, b);` + * @category Methods * * @param b - The vector to calculate the distance to * @returns Distance between `this` and `b` @@ -232,12 +257,14 @@ export class Vec2 extends Float64Array { } /** * Alias for {@link Vec2.distance} + * @category Methods */ dist(b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between another {@link Vec2} and `this`. + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods * * @param b The vector to calculate the squared distance to * @returns Squared distance between `this` and `b` @@ -247,16 +274,18 @@ export class Vec2 extends Float64Array { } /** * Alias for {@link Vec2.squaredDistance} + * @category Methods */ sqrDist(b: Readonly): number { return 0; } /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` + * @category Methods * * @returns `this` */ - negate(): Vec2 { + negate(): this { this[0] *= -1; this[1] *= -1; return this; @@ -265,10 +294,11 @@ export class Vec2 extends Float64Array { /** * Inverts the components of `this`. * Equivalent to `Vec2.inverse(this, this);` + * @category Methods * * @returns `this` */ - invert(): Vec2 { + invert(): this { this[0] = 1.0 / this[0]; this[1] = 1.0 / this[1]; return this; @@ -277,10 +307,11 @@ export class Vec2 extends Float64Array { /** * Sets each component of `this` to it's absolute value. * Equivalent to `Vec2.abs(this, this);` + * @category Methods * * @returns `this` */ - abs(): Vec2 { + abs(): this { this[0] = Math.abs(this[0]); this[1] = Math.abs(this[1]); return this; @@ -289,6 +320,7 @@ export class Vec2 extends Float64Array { /** * Calculates the dot product of this and another {@link Vec2}. * Equivalent to `Vec2.dot(this, b);` + * @category Methods * * @param b - The second operand * @returns Dot product of `this` and `b` @@ -300,11 +332,12 @@ export class Vec2 extends Float64Array { /** * Normalize `this`. * Equivalent to `Vec2.normalize(this, this);` + * @category Methods * * @returns `this` */ - normalize(): Vec2 { - return Vec2.normalize(this, this) as Vec2; + normalize(): this { + return Vec2.normalize(this, this) as this; } //=================== @@ -568,7 +601,7 @@ export class Vec2 extends Float64Array { } /** - * Calculates the euclidian distance between two {@link Vec2}s + * Calculates the Euclidean distance between two {@link Vec2}s * @category Static * * @param a - The first operand @@ -586,7 +619,7 @@ export class Vec2 extends Float64Array { static dist(a: Readonly, b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between two {@link Vec2}s + * Calculates the squared Euclidean distance between two {@link Vec2}s * @category Static * * @param a - The first operand @@ -651,8 +684,10 @@ export class Vec2 extends Float64Array { const y = a[1]; return x * x + y * y; } + /** * Alias for {@link Vec2.squaredLength} + * @category Static */ static sqrLen(a: Readonly, b: Readonly): number { return 0; } @@ -774,6 +809,7 @@ export class Vec2 extends Float64Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; @@ -790,6 +826,7 @@ export class Vec2 extends Float64Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; @@ -807,6 +844,7 @@ export class Vec2 extends Float64Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; @@ -825,6 +863,7 @@ export class Vec2 extends Float64Array { * @param a - The vector to transform * @param m - Matrix to transform with * @returns `out` + * @category Static */ static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like { const x = a[0]; diff --git a/src/_lib/f64/Vec3.ts b/src/_lib/f64/Vec3.ts index cdbe924a..3813dea9 100644 --- a/src/_lib/f64/Vec3.ts +++ b/src/_lib/f64/Vec3.ts @@ -32,7 +32,7 @@ export class Vec3 extends Float64Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -40,21 +40,21 @@ export class Vec3 extends Float64Array { /** * The x component of the vector. Equivalent to `this[0];` - * @category Vector components + * @category Vector Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the vector. Equivalent to `this[1];` - * @category Vector components + * @category Vector Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } /** * The z component of the vector. Equivalent to `this[2];` - * @category Vector components + * @category Vector Components */ get z(): number { return this[2]; } set z(value: number) { this[2] = value; } @@ -64,21 +64,21 @@ export class Vec3 extends Float64Array { /** * The r component of the vector. Equivalent to `this[0];` - * @category Color components + * @category Color Components */ get r(): number { return this[0]; } set r(value: number) { this[0] = value; } /** * The g component of the vector. Equivalent to `this[1];` - * @category Color components + * @category Color Components */ get g(): number { return this[1]; } set g(value: number) { this[1] = value; } /** * The b component of the vector. Equivalent to `this[2];` - * @category Color components + * @category Color Components */ get b(): number { return this[2]; } set b(value: number) { this[2] = value; } @@ -89,6 +89,8 @@ export class Vec3 extends Float64Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { const x = this[0]; @@ -96,14 +98,19 @@ export class Vec3 extends Float64Array { const z = this[2]; return Math.sqrt(x * x + y * y + z * z); } + /** * Alias for {@link Vec3.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * The squared magnitude (length) of `this`. * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors */ get squaredMagnitude(): number { const x = this[0]; @@ -111,14 +118,19 @@ export class Vec3 extends Float64Array { const z = this[2]; return x * x + y * y + z * z; } + /** * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors */ get sqrMag(): number { return this.squaredMagnitude; } /** * A string representation of `this` * Equivalent to `Vec3.str(this);` + * + * @category Accessors */ get str(): string { return Vec3.str(this); @@ -130,11 +142,12 @@ export class Vec3 extends Float64Array { /** * Copy the values from another {@link Vec3} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Vec3 { + copy(a: Readonly): this { this.set(a); return this; } @@ -142,11 +155,12 @@ export class Vec3 extends Float64Array { /** * Adds a {@link Vec3} to `this`. * Equivalent to `Vec3.add(this, this, b);` + * @category Methods * * @param b - The vector to add to `this` * @returns `this` */ - add(b: Readonly): Vec3 { + add(b: Readonly): this { this[0] += b[0]; this[1] += b[1]; this[2] += b[2]; @@ -156,11 +170,12 @@ export class Vec3 extends Float64Array { /** * Subtracts a {@link Vec3} from `this`. * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods * * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): Vec3 { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; this[2] -= b[2]; @@ -169,17 +184,19 @@ export class Vec3 extends Float64Array { /** * Alias for {@link Vec3.subtract} + * @category Methods */ - sub(b: Readonly): Vec3 { return this; } + sub(b: Readonly): this { return this; } /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Vec3 { + multiply(b: Readonly): this { this[0] *= b[0]; this[1] *= b[1]; this[2] *= b[2]; @@ -188,17 +205,19 @@ export class Vec3 extends Float64Array { /** * Alias for {@link Vec3.multiply} + * @category Methods */ - mul(b: Readonly): Vec3 { return this; } + mul(b: Readonly): this { return this; } /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods * * @param b - The vector to divide `this` by * @returns `this` */ - divide(b: Readonly): Vec3 { + divide(b: Readonly): this { this[0] /= b[0]; this[1] /= b[1]; this[2] /= b[2]; @@ -207,17 +226,19 @@ export class Vec3 extends Float64Array { /** * Alias for {@link Vec3.divide} + * @category Methods */ - div(b: Readonly): Vec3 { return this; } + div(b: Readonly): this { return this; } /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods * * @param b - Amount to scale `this` by * @returns `this` */ - scale(b: number): Vec3 { + scale(b: number): this { this[0] *= b; this[1] *= b; this[2] *= b; @@ -227,12 +248,13 @@ export class Vec3 extends Float64Array { /** * Calculates `this` scaled by a scalar value then adds the result to `this`. * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods * * @param b - The vector to add to `this` * @param scale - The amount to scale `b` by before adding * @returns `this` */ - scaleAndAdd(b: Readonly, scale: number): Vec3 { + scaleAndAdd(b: Readonly, scale: number): this { this[0] += b[0] * scale; this[1] += b[1] * scale; this[2] += b[2] * scale; @@ -240,8 +262,9 @@ export class Vec3 extends Float64Array { } /** - * Calculates the euclidian distance between another {@link Vec3} and `this`. + * Calculates the Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.distance(this, b);` + * @category Methods * * @param b - The vector to calculate the distance to * @returns Distance between `this` and `b` @@ -251,12 +274,14 @@ export class Vec3 extends Float64Array { } /** * Alias for {@link Vec3.distance} + * @category Methods */ dist(b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between another {@link Vec3} and `this`. + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods * * @param b The vector to calculate the squared distance to * @returns Squared distance between `this` and `b` @@ -264,18 +289,21 @@ export class Vec3 extends Float64Array { squaredDistance(b: Readonly): number { return Vec3.squaredDistance(this, b); } + /** * Alias for {@link Vec3.squaredDistance} + * @category Methods */ sqrDist(b: Readonly): number { return 0; } /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` + * @category Methods * * @returns `this` */ - negate(): Vec3 { + negate(): this { this[0] *= -1; this[1] *= -1; this[2] *= -1; @@ -285,10 +313,11 @@ export class Vec3 extends Float64Array { /** * Inverts the components of `this`. * Equivalent to `Vec3.inverse(this, this);` + * @category Methods * * @returns `this` */ - invert(): Vec3 { + invert(): this { this[0] = 1.0 / this[0]; this[1] = 1.0 / this[1]; this[2] = 1.0 / this[2]; @@ -296,12 +325,13 @@ export class Vec3 extends Float64Array { } /** - * Sets each component of `this` to it's absolute value. + * Sets each component of `this` to its absolute value. * Equivalent to `Vec3.abs(this, this);` + * @category Methods * * @returns `this` */ - abs(): Vec3 { + abs(): this { this[0] = Math.abs(this[0]); this[1] = Math.abs(this[1]); this[2] = Math.abs(this[2]); @@ -311,6 +341,7 @@ export class Vec3 extends Float64Array { /** * Calculates the dot product of this and another {@link Vec3}. * Equivalent to `Vec3.dot(this, b);` + * @category Methods * * @param b - The second operand * @returns Dot product of `this` and `b` @@ -322,11 +353,12 @@ export class Vec3 extends Float64Array { /** * Normalize `this`. * Equivalent to `Vec3.normalize(this, this);` + * @category Methods * * @returns `this` */ - normalize(): Vec3 { - return Vec3.normalize(this, this) as Vec3; + normalize(): this { + return Vec3.normalize(this, this) as this; } //=================== @@ -640,7 +672,7 @@ export class Vec3 extends Float64Array { } /** - * Calculates the euclidian distance between two vec3's + * Calculates the Euclidean distance between two vec3's * @category Static * * @param a - the first operand @@ -655,11 +687,12 @@ export class Vec3 extends Float64Array { } /** * Alias for {@link Vec3.distance} + * @category Static */ static dist(a: Readonly, b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between two vec3's + * Calculates the squared Euclidean distance between two vec3's * @category Static * * @param a - the first operand @@ -672,8 +705,10 @@ export class Vec3 extends Float64Array { const z = b[2] - a[2]; return x * x + y * y + z * z; } + /** * Alias for {@link Vec3.squaredDistance} + * @category Static */ static sqrDist(a: Readonly, b: Readonly): number { return 0; } @@ -692,6 +727,7 @@ export class Vec3 extends Float64Array { } /** * Alias for {@link Vec3.squaredLength} + * @category Static */ static sqrLen(a: Readonly, b: Readonly): number { return 0; } @@ -995,6 +1031,8 @@ export class Vec3 extends Float64Array { /** * Rotate a 3D vector around the x-axis + * @category Static + * * @param out - The receiving vec3 * @param a - The vec3 point to rotate * @param b - The origin of the rotation @@ -1020,6 +1058,8 @@ export class Vec3 extends Float64Array { /** * Rotate a 3D vector around the y-axis + * @category Static + * * @param out - The receiving vec3 * @param a - The vec3 point to rotate * @param b - The origin of the rotation @@ -1045,6 +1085,8 @@ export class Vec3 extends Float64Array { /** * Rotate a 3D vector around the z-axis + * @category Static + * * @param out - The receiving vec3 * @param a - The vec3 point to rotate * @param b - The origin of the rotation @@ -1070,6 +1112,8 @@ export class Vec3 extends Float64Array { /** * Get the angle between two 3D vectors + * @category Static + * * @param a - The first operand * @param b - The second operand * @returns The angle in radians diff --git a/src/_lib/f64/Vec4.ts b/src/_lib/f64/Vec4.ts index b879e4f2..9c462532 100644 --- a/src/_lib/f64/Vec4.ts +++ b/src/_lib/f64/Vec4.ts @@ -32,7 +32,7 @@ export class Vec4 extends Float64Array { } //============ - // Attributes + // Accessors //============ // Getters and setters to make component access read better. @@ -40,28 +40,28 @@ export class Vec4 extends Float64Array { /** * The x component of the vector. Equivalent to `this[0];` - * @category Vector components + * @category Vector Components */ get x(): number { return this[0]; } set x(value: number) { this[0] = value; } /** * The y component of the vector. Equivalent to `this[1];` - * @category Vector components + * @category Vector Components */ get y(): number { return this[1]; } set y(value: number) { this[1] = value; } /** * The z component of the vector. Equivalent to `this[2];` - * @category Vector components + * @category Vector Components */ get z(): number { return this[2]; } set z(value: number) { this[2] = value; } /** * The w component of the vector. Equivalent to `this[3];` - * @category Vector components + * @category Vector Components */ get w(): number { return this[3]; } set w(value: number) { this[3] = value; } @@ -71,28 +71,28 @@ export class Vec4 extends Float64Array { /** * The r component of the vector. Equivalent to `this[0];` - * @category Color components + * @category Color Components */ get r(): number { return this[0]; } set r(value: number) { this[0] = value; } /** * The g component of the vector. Equivalent to `this[1];` - * @category Color components + * @category Color Components */ get g(): number { return this[1]; } set g(value: number) { this[1] = value; } /** * The b component of the vector. Equivalent to `this[2];` - * @category Color components + * @category Color Components */ get b(): number { return this[2]; } set b(value: number) { this[2] = value; } /** * The a component of the vector. Equivalent to `this[3];` - * @category Color components + * @category Color Components */ get a(): number { return this[3]; } set a(value: number) { this[3] = value; } @@ -103,6 +103,8 @@ export class Vec4 extends Float64Array { * * Magnitude is used because the `length` attribute is already defined by * TypedArrays to mean the number of elements in the array. + * + * @category Accessors */ get magnitude(): number { const x = this[0]; @@ -114,12 +116,16 @@ export class Vec4 extends Float64Array { /** * Alias for {@link Vec4.magnitude} + * + * @category Accessors */ get mag(): number { return this.magnitude; } /** * A string representation of `this` * Equivalent to `Vec4.str(this);` + * + * @category Accessors */ get str(): string { return Vec4.str(this); @@ -131,11 +137,12 @@ export class Vec4 extends Float64Array { /** * Copy the values from another {@link Vec4} into `this`. + * @category Methods * * @param a the source vector * @returns `this` */ - copy(a: Readonly): Vec4 { + copy(a: Readonly): this { super.set(a); return this; } @@ -143,11 +150,12 @@ export class Vec4 extends Float64Array { /** * Adds a {@link Vec4} to `this`. * Equivalent to `Vec4.add(this, this, b);` + * @category Methods * * @param b - The vector to add to `this` * @returns `this` */ - add(b: Readonly): Vec4 { + add(b: Readonly): this { this[0] += b[0]; this[1] += b[1]; this[2] += b[2]; @@ -158,11 +166,12 @@ export class Vec4 extends Float64Array { /** * Subtracts a {@link Vec4} from `this`. * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods * * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): Vec4 { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; this[2] -= b[2]; @@ -172,17 +181,19 @@ export class Vec4 extends Float64Array { /** * Alias for {@link Vec4.subtract} + * @category Methods */ - sub(b: Readonly): Vec4 { return this; } + sub(b: Readonly): this { return this; } /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods * * @param b - The vector to multiply `this` by * @returns `this` */ - multiply(b: Readonly): Vec4 { + multiply(b: Readonly): this { this[0] *= b[0]; this[1] *= b[1]; this[2] *= b[2]; @@ -192,17 +203,19 @@ export class Vec4 extends Float64Array { /** * Alias for {@link Vec4.multiply} + * @category Methods */ - mul(b: Readonly): Vec4 { return this; } + mul(b: Readonly): this { return this; } /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods * * @param b - The vector to divide `this` by * @returns `this` */ - divide(b: Readonly): Vec4 { + divide(b: Readonly): this { this[0] /= b[0]; this[1] /= b[1]; this[2] /= b[2]; @@ -212,17 +225,19 @@ export class Vec4 extends Float64Array { /** * Alias for {@link Vec4.divide} + * @category Methods */ - div(b: Readonly): Vec4 { return this; } + div(b: Readonly): this { return this; } /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods * * @param b - Amount to scale `this` by * @returns `this` */ - scale(b: number): Vec4 { + scale(b: number): this { this[0] *= b; this[1] *= b; this[2] *= b; @@ -233,12 +248,13 @@ export class Vec4 extends Float64Array { /** * Calculates `this` scaled by a scalar value then adds the result to `this`. * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods * * @param b - The vector to add to `this` * @param scale - The amount to scale `b` by before adding * @returns `this` */ - scaleAndAdd(b: Readonly, scale: number): Vec4 { + scaleAndAdd(b: Readonly, scale: number): this { this[0] += b[0] * scale; this[1] += b[1] * scale; this[2] += b[2] * scale; @@ -247,8 +263,9 @@ export class Vec4 extends Float64Array { } /** - * Calculates the euclidian distance between another {@link Vec4} and `this`. + * Calculates the Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.distance(this, b);` + * @category Methods * * @param b - The vector to calculate the distance to * @returns Distance between `this` and `b` @@ -256,14 +273,17 @@ export class Vec4 extends Float64Array { distance(b: Readonly): number { return Vec4.distance(this, b); } + /** * Alias for {@link Vec4.distance} + * @category Methods */ dist(b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between another {@link Vec4} and `this`. + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods * * @param b The vector to calculate the squared distance to * @returns Squared distance between `this` and `b` @@ -271,18 +291,21 @@ export class Vec4 extends Float64Array { squaredDistance(b: Readonly): number { return Vec4.squaredDistance(this, b); } + /** * Alias for {@link Vec4.squaredDistance} + * @category Methods */ sqrDist(b: Readonly): number { return 0; } /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` + * @category Methods * * @returns `this` */ - negate(): Vec4 { + negate(): this { this[0] *= -1; this[1] *= -1; this[2] *= -1; @@ -293,10 +316,11 @@ export class Vec4 extends Float64Array { /** * Inverts the components of `this`. * Equivalent to `Vec4.inverse(this, this);` + * @category Methods * * @returns `this` */ - invert(): Vec4 { + invert(): this { this[0] = 1.0 / this[0]; this[1] = 1.0 / this[1]; this[2] = 1.0 / this[2]; @@ -307,10 +331,11 @@ export class Vec4 extends Float64Array { /** * Sets each component of `this` to it's absolute value. * Equivalent to `Vec4.abs(this, this);` + * @category Methods * * @returns `this` */ - abs(): Vec4 { + abs(): this { this[0] = Math.abs(this[0]); this[1] = Math.abs(this[1]); this[2] = Math.abs(this[2]); @@ -321,6 +346,7 @@ export class Vec4 extends Float64Array { /** * Calculates the dot product of this and another {@link Vec4}. * Equivalent to `Vec4.dot(this, b);` + * @category Methods * * @param b - The second operand * @returns Dot product of `this` and `b` @@ -332,11 +358,12 @@ export class Vec4 extends Float64Array { /** * Normalize `this`. * Equivalent to `Vec4.normalize(this, this);` + * @category Methods * * @returns `this` */ - normalize(): Vec4 { - return Vec4.normalize(this, this) as Vec4; + normalize(): this { + return Vec4.normalize(this, this) as this; } //=================== @@ -630,7 +657,7 @@ export class Vec4 extends Float64Array { } /** - * Calculates the euclidian distance between two {@link Vec4}'s + * Calculates the Euclidean distance between two {@link Vec4}'s * @category Static * * @param a - the first operand @@ -651,7 +678,7 @@ export class Vec4 extends Float64Array { static dist(a: Readonly, b: Readonly): number { return 0; } /** - * Calculates the squared euclidian distance between two {@link Vec4}'s + * Calculates the squared Euclidean distance between two {@link Vec4}'s * @category Static * * @param a - the first operand diff --git a/src/types/swizzle/f64/index.ts b/src/types/swizzle/f64/index.ts index 7ee8f113..73997ed5 100644 --- a/src/types/swizzle/f64/index.ts +++ b/src/types/swizzle/f64/index.ts @@ -54,282 +54,282 @@ declare module '#gl-matrix/f64' { */ interface Vec2 { /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; @@ -340,1172 +340,1172 @@ declare module '#gl-matrix/f64' { */ interface Vec3 { /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; @@ -1516,3362 +1516,3362 @@ declare module '#gl-matrix/f64' { */ interface Vec4 { /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xw(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yw(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zw(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ww(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xww(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yww(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zww(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get www(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ra(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ga(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ba(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ar(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ag(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ab(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get aa(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rra(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get raa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gra(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gaa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bra(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get baa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ara(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aaa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rraa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get graa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get braa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get araa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaaa(): Vec4Alias; diff --git a/src/types/swizzle/index.ts b/src/types/swizzle/index.ts index 26a58758..0d56f8ba 100644 --- a/src/types/swizzle/index.ts +++ b/src/types/swizzle/index.ts @@ -54,282 +54,282 @@ declare module '#gl-matrix' { */ interface Vec2 { /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; @@ -340,1172 +340,1172 @@ declare module '#gl-matrix' { */ interface Vec3 { /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; @@ -1516,3362 +1516,3362 @@ declare module '#gl-matrix' { */ interface Vec4 { /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xw(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yw(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zw(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wx(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wy(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wz(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ww(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xww(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yww(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zww(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzw(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwx(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwy(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwz(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get www(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzw(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwx(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwy(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwz(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwww(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ra(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ga(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ba(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ar(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ag(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ab(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get aa(): Vec2Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rra(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get raa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gra(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gaa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bra(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get baa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ara(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aga(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abr(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abg(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abb(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aba(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aar(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aag(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aab(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aaa(): Vec3Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rraa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get graa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get braa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get araa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abra(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abaa(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aara(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaga(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabr(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabg(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabb(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaba(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaar(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaag(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaab(): Vec4Alias; /** - * @category Swizzle API + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaaa(): Vec4Alias; diff --git a/typedoc.json b/typedoc.json index 3b77397a..ee8044df 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,6 +1,16 @@ { - "categoryOrder": ["Constructor", "Static", "Member", "*", "Swizzle API"], - "defaultCategory": "Member", + "categoryOrder": [ + "Constructor", + "Static", + "Accessors", + "Methods", + "Color Components", + "Vector Components", + "Quaternion Components", + "Swizzle Accessors (Optional)", + "*" + ], + "defaultCategory": "Inherited", "dmtLinksIcon": [ { "icon": "./assets/icon/gl-matrix-icon-mono-64.webp", From a229443bd2b21187b0c59681e8053af9e80f9816 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sat, 15 Jun 2024 22:12:01 -0700 Subject: [PATCH 04/16] Added CDN bundles. --- .gitignore | 1 - dist-cdn/esm/2016/gl-matrix-f32.js | 9433 ++++++++++++++++ dist-cdn/esm/2016/gl-matrix-f32.js.map | 7 + dist-cdn/esm/2016/gl-matrix-f32.min.js | 3 + dist-cdn/esm/2016/gl-matrix-f32.min.js.map | 7 + dist-cdn/esm/2016/gl-matrix-f64.js | 9424 ++++++++++++++++ dist-cdn/esm/2016/gl-matrix-f64.js.map | 7 + dist-cdn/esm/2016/gl-matrix-f64.min.js | 3 + dist-cdn/esm/2016/gl-matrix-f64.min.js.map | 7 + dist-cdn/esm/2022/gl-matrix-f32.js | 9401 ++++++++++++++++ dist-cdn/esm/2022/gl-matrix-f32.js.map | 7 + dist-cdn/esm/2022/gl-matrix-f32.min.js | 3 + dist-cdn/esm/2022/gl-matrix-f32.min.js.map | 7 + dist-cdn/esm/2022/gl-matrix-f64.js | 9392 ++++++++++++++++ dist-cdn/esm/2022/gl-matrix-f64.js.map | 7 + dist-cdn/esm/2022/gl-matrix-f64.min.js | 3 + dist-cdn/esm/2022/gl-matrix-f64.min.js.map | 7 + dist-cdn/types/gl-matrix-f32.d.mts | 9891 +++++++++++++++++ dist-cdn/types/gl-matrix-f64.d.mts | 9883 +++++++++++++++++ dist-cdn/umd/gl-matrix-f32.cjs | 10679 +++++++++++++++++++ dist-cdn/umd/gl-matrix-f32.cjs.map | 1 + dist-cdn/umd/gl-matrix-f32.min.cjs | 4445 ++++++++ dist-cdn/umd/gl-matrix-f32.min.cjs.map | 1 + dist-cdn/umd/gl-matrix-f64.cjs | 10670 ++++++++++++++++++ dist-cdn/umd/gl-matrix-f64.cjs.map | 1 + dist-cdn/umd/gl-matrix-f64.min.cjs | 4436 ++++++++ dist-cdn/umd/gl-matrix-f64.min.cjs.map | 1 + esm-d-ts.config.js | 6 +- package-lock.json | 8994 +++++++++++----- package.json | 16 +- scripts/bundle.js | 157 - scripts/bundle/bundle.js | 368 + scripts/bundle/cdn-entry-f32.ts | 12 + scripts/bundle/cdn-entry-f64.ts | 11 + 34 files changed, 94418 insertions(+), 2873 deletions(-) create mode 100644 dist-cdn/esm/2016/gl-matrix-f32.js create mode 100644 dist-cdn/esm/2016/gl-matrix-f32.js.map create mode 100644 dist-cdn/esm/2016/gl-matrix-f32.min.js create mode 100644 dist-cdn/esm/2016/gl-matrix-f32.min.js.map create mode 100644 dist-cdn/esm/2016/gl-matrix-f64.js create mode 100644 dist-cdn/esm/2016/gl-matrix-f64.js.map create mode 100644 dist-cdn/esm/2016/gl-matrix-f64.min.js create mode 100644 dist-cdn/esm/2016/gl-matrix-f64.min.js.map create mode 100644 dist-cdn/esm/2022/gl-matrix-f32.js create mode 100644 dist-cdn/esm/2022/gl-matrix-f32.js.map create mode 100644 dist-cdn/esm/2022/gl-matrix-f32.min.js create mode 100644 dist-cdn/esm/2022/gl-matrix-f32.min.js.map create mode 100644 dist-cdn/esm/2022/gl-matrix-f64.js create mode 100644 dist-cdn/esm/2022/gl-matrix-f64.js.map create mode 100644 dist-cdn/esm/2022/gl-matrix-f64.min.js create mode 100644 dist-cdn/esm/2022/gl-matrix-f64.min.js.map create mode 100644 dist-cdn/types/gl-matrix-f32.d.mts create mode 100644 dist-cdn/types/gl-matrix-f64.d.mts create mode 100644 dist-cdn/umd/gl-matrix-f32.cjs create mode 100644 dist-cdn/umd/gl-matrix-f32.cjs.map create mode 100644 dist-cdn/umd/gl-matrix-f32.min.cjs create mode 100644 dist-cdn/umd/gl-matrix-f32.min.cjs.map create mode 100644 dist-cdn/umd/gl-matrix-f64.cjs create mode 100644 dist-cdn/umd/gl-matrix-f64.cjs.map create mode 100644 dist-cdn/umd/gl-matrix-f64.min.cjs create mode 100644 dist-cdn/umd/gl-matrix-f64.min.cjs.map delete mode 100644 scripts/bundle.js create mode 100644 scripts/bundle/bundle.js create mode 100644 scripts/bundle/cdn-entry-f32.ts create mode 100644 scripts/bundle/cdn-entry-f64.ts diff --git a/.gitignore b/.gitignore index 74f19e2d..517f95a3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ npm-debug.log /.dts /coverage /dist -/dist-cdn /docs /html /node_modules diff --git a/dist-cdn/esm/2016/gl-matrix-f32.js b/dist-cdn/esm/2016/gl-matrix-f32.js new file mode 100644 index 00000000..6c393051 --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f32.js @@ -0,0 +1,9433 @@ +// glMatrix - v4.0.0-beta.3 +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); + +// src/common/index.ts +var GLM_EPSILON = 1e-6; + +// src/_lib/f32/Mat2.ts +var _IDENTITY_2X2; +var _Mat2 = class _Mat2 extends Float32Array { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v + ]); + } else { + super(v, 0, 4); + } + break; + default: + super(__privateGet(_Mat2, _IDENTITY_2X2)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity() { + this.set(__privateGet(_Mat2, _IDENTITY_2X2)); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values) { + return new _Mat2(...values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + let a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + let det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2(${a.join(", ")})`; + } +}; +_IDENTITY_2X2 = new WeakMap(); +__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([ + 1, + 0, + 0, + 1 +])); +var Mat2 = _Mat2; +Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; + +// src/_lib/f32/Mat2d.ts +var _IDENTITY_2X3; +var _Mat2d = class _Mat2d extends Float32Array { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 6: + super(values); + break; + case 2: + super(values[0], values[1], 6); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 6); + } + break; + default: + super(__privateGet(_Mat2d, _IDENTITY_2X3)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2d.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(__privateGet(_Mat2d, _IDENTITY_2X3)); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat2d.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH() { + return 6 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values) { + return new _Mat2d(...values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2d(${a.join(", ")})`; + } +}; +_IDENTITY_2X3 = new WeakMap(); +__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([ + 1, + 0, + 0, + 1, + 0, + 0 +])); +var Mat2d = _Mat2d; +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; + +// src/_lib/f32/Mat3.ts +var _IDENTITY_3X3; +var _Mat3 = class _Mat3 extends Float32Array { + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 9: + super(values); + break; + case 2: + super(values[0], values[1], 9); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 9); + } + break; + default: + super(__privateGet(_Mat3, _IDENTITY_3X3)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat3.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(__privateGet(_Mat3, _IDENTITY_3X3)); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat3.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH() { + return 9 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values) { + return new _Mat3(...values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2]; + const a10 = a[3], a11 = a[4], a12 = a[5]; + const a20 = a[6], a21 = a[7], a22 = a[8]; + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + let det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + ); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat3(${a.join(", ")})`; + } +}; +_IDENTITY_3X3 = new WeakMap(); +__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 +])); +var Mat3 = _Mat3; +Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; + +// src/_lib/f32/Mat4.ts +var _IDENTITY_4X4, _TMP_VEC3; +var _Mat4 = class _Mat4 extends Float32Array { + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 16: + super(values); + break; + case 2: + super(values[0], values[1], 16); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 16); + } + break; + default: + super(__privateGet(_Mat4, _IDENTITY_4X4)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat4.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(__privateGet(_Mat4, _IDENTITY_4X4)); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH() { + return 16 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values) { + return new _Mat4(...values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a03 = a[3]; + const a12 = a[6], a13 = a[7]; + const a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out, a, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, v) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out, a) { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + let magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3)); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out, mat) { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out, mat) { + _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat); + const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0]; + const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1]; + const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2]; + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out, q, v, s) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out, q, v, s, o) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out, left, right, bottom, top, near, far = Infinity) { + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out, fovy, aspect, near, far = Infinity) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out, fov, near, far) { + const upTan = Math.tan(fov.upDegrees * Math.PI / 180); + const downTan = Math.tan(fov.downDegrees * Math.PI / 180); + const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + const xScale = 2 / (leftTan + rightTan); + const yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out, eye, center, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out, eye, target, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15] + ); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat4(${a.join(", ")})`; + } +}; +_IDENTITY_4X4 = new WeakMap(); +_TMP_VEC3 = new WeakMap(); +__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 +])); +/** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ +__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3)); +var Mat4 = _Mat4; +Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; + +// src/_lib/f32/Vec3.ts +var Vec3 = class _Vec3 extends Float32Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 3: + super(values); + break; + case 2: + super(values[0], values[1], 3); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v]); + } else { + super(v, 0, 3); + } + break; + } + default: + super(3); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec3.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec3.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH() { + return 3 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + let z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a) { + return 0; + } + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out, a, b) { + const ax = a[0], ay = a[1], az = a[2]; + const bx = b[0], by = b[1], bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out, a, b, c, d, t) { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out, a, b, c, d, t) { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out, a, m) { + let x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + const uvx = qy * z - qz * y; + const uvy = qz * x - qx * z; + const uvz = qx * y - qy * x; + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out, a, b, rad) { + const by = b[1]; + const bz = b[2]; + const py = a[1] - by; + const pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out, a, b, rad) { + const bx = b[0]; + const bz = b[2]; + const px = a[0] - bx; + const pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out, a, b, rad) { + const bx = b[0]; + const by = b[1]; + const px = a[0] - bx; + const py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec3(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } +}; +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; + +// src/_lib/f32/Vec4.ts +var Vec4 = class _Vec4 extends Float32Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a() { + return this[3]; + } + set a(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec4.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec4.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out, u, v, w) { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec4(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } +}; +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; + +// src/_lib/f32/Quat.ts +var _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3; +var _Quat = class _Quat extends Float32Array { + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale) { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b) { + return _Quat.dot(this, b); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis, q) { + const rad = Math.acos(q[3]) * 2; + const s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a, b) { + const dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + 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]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out, a) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const ax = a[0], ay = a[1], az = a[2], aw = a[3]; + let bx = b[0], by = b[1], bz = b[2], bw = b[3]; + let scale0; + let scale1; + let cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out, m) { + const fTrace = m[0] + m[4] + m[8]; + let fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + let i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + let j = (i + 1) % 3; + let k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) { + let halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + let sx = Math.sin(x); + let cx = Math.cos(x); + let sy = Math.sin(y); + let cy = Math.cos(y); + let sz = Math.sin(z); + let cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error("Unknown angle order " + order); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat(${a.join(", ")})`; + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + return out; + } + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return false; + } + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out, a, b) { + let dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); + _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b); + out[0] = __privateGet(_Quat, _TMP_VEC32)[0]; + out[1] = __privateGet(_Quat, _TMP_VEC32)[1]; + out[2] = __privateGet(_Quat, _TMP_VEC32)[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out, a, b, c, d, t) { + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t); + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t); + _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out, view, right, up) { + __privateGet(_Quat, _TMP_MAT3)[0] = right[0]; + __privateGet(_Quat, _TMP_MAT3)[3] = right[1]; + __privateGet(_Quat, _TMP_MAT3)[6] = right[2]; + __privateGet(_Quat, _TMP_MAT3)[1] = up[0]; + __privateGet(_Quat, _TMP_MAT3)[4] = up[1]; + __privateGet(_Quat, _TMP_MAT3)[7] = up[2]; + __privateGet(_Quat, _TMP_MAT3)[2] = -view[0]; + __privateGet(_Quat, _TMP_MAT3)[5] = -view[1]; + __privateGet(_Quat, _TMP_MAT3)[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3))); + } +}; +_DEFAULT_ANGLE_ORDER = new WeakMap(); +_TMP_QUAT1 = new WeakMap(); +_TMP_QUAT2 = new WeakMap(); +_TMP_MAT3 = new WeakMap(); +_TMP_VEC32 = new WeakMap(); +_X_UNIT_VEC3 = new WeakMap(); +_Y_UNIT_VEC3 = new WeakMap(); +__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, "zyx"); +// Temporary variables to prevent repeated allocations in the algorithms within Quat. +// These are declared as TypedArrays to aid in tree-shaking. +__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4)); +__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4)); +__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9)); +__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3)); +__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0])); +__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0])); +var Quat = _Quat; +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; +Quat.prototype.mul = Quat.prototype.multiply; +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; + +// src/_lib/f32/Quat2.ts +var _TMP_QUAT, _TMP_VEC33; +var _Quat2 = class _Quat2 extends Float32Array { + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 8: + super(values); + break; + case 2: + super(values[0], values[1], 8); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v, v, v, v, v]); + } else { + super(v, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH() { + return 8 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + return new _Quat2( + x1, + y1, + z1, + w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1 + ); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, t) { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out, a) { + Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a); + Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a); + return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33)); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out, a) { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out, q, a) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad = rad * 0.5; + const s = Math.sin(rad); + const bx = s * axis[0] / axisLength; + const by = s * axis[1] / axisLength; + const bz = s * axis[2] / axisLength; + const bw = Math.cos(rad); + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out, a, b) { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const mt = 1 - t; + if (_Quat2.dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + let magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat2(${a.join(", ")})`; + } + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } +}; +_TMP_QUAT = new WeakMap(); +_TMP_VEC33 = new WeakMap(); +// Temporary variables to prevent repeated allocations in the algorithms within Quat2. +// These are declared as TypedArrays to aid in tree-shaking. +__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4)); +__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3)); +var Quat2 = _Quat2; +Quat2.dot = Quat.dot; +Quat2.squaredLength = Quat.squaredLength; +Quat2.sqrLen = Quat.squaredLength; +Quat2.mag = Quat.magnitude; +Quat2.length = Quat.magnitude; +Quat2.len = Quat.magnitude; +Quat2.mul = Quat2.multiply; + +// src/_lib/f32/Vec2.ts +var Vec2 = class _Vec2 extends Float32Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 2: { + const v = values[0]; + if (typeof v === "number") { + super([v, values[1]]); + } else { + super(v, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v]); + } else { + super(v, 0, 2); + } + break; + } + default: + super(2); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec2.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH() { + return 2 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out, a, b) { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out, a, b, rad) { + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a, b) { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a) { + return `Vec2(${a.join(", ")})`; + } +}; +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; + +// src/swizzle/index.ts +var GLM_SWIZZLES_ENABLED_F32 = false; +function EnableSwizzles() { + if (GLM_SWIZZLES_ENABLED_F32) { + return; + } + const VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + const VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + const VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + const SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function() { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function() { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + }; + case 4: + return function() { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; + } + } + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + GLM_SWIZZLES_ENABLED_F32 = true; +} + +// src/util/angleConversion.ts +var GLM_DEG_TO_RAD = Math.PI / 180; +var GLM_RAD_TO_DEG = 180 / Math.PI; +function toDegree(value) { + return value * GLM_RAD_TO_DEG; +} +function toRadian(value) { + return value * GLM_DEG_TO_RAD; +} +export { + EnableSwizzles, + Mat2, + Mat2d, + Mat3, + Mat4, + Quat, + Quat2, + Vec2, + Vec3, + Vec4, + Mat2 as mat2, + Mat2d as mat2d, + Mat3 as mat3, + Mat4 as mat4, + Quat as quat, + Quat2 as quat2, + toDegree, + toRadian, + Vec2 as vec2, + Vec3 as vec3, + Vec4 as vec4 +}; +//# sourceMappingURL=gl-matrix-f32.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f32.js.map b/dist-cdn/esm/2016/gl-matrix-f32.js.map new file mode 100644 index 00000000..63bac3da --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f32.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;;;;AASO,IAAM,cAAsB;;;ACTnC;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GAAsB,GAAG,CAAC;AAAA,QAClC;AACA;AAAA,MACF;AACE,cAAM,oBAAK,cAAa;AAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,IAAI,MAAc;AAChB,WAAO,MAAK,IAAI,IAAI;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAK,GAA6B;AAChC,SAAK,IAAI,CAAC;AACV,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAiB;AACf,SAAK,IAAI,oBAAK,cAAa;AAC3B,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,SAAS,GAA6B;AACpC,WAAO,MAAK,SAAS,MAAM,MAAM,CAAC;AAAA,EACpC;AAAA;AAAA;AAAA;AA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AAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC1HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", + "names": ["_TMP_VEC3", "_TMP_VEC3"] +} diff --git a/dist-cdn/esm/2016/gl-matrix-f32.min.js b/dist-cdn/esm/2016/gl-matrix-f32.min.js new file mode 100644 index 00000000..7f94d32c --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f32.min.js @@ -0,0 +1,3 @@ +// glMatrix - v4.0.0-beta.3 +var de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(xe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(r*F-s*P-a*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(M*g-l*S-h*z)*Q,e[4]=(y*p-i*P-L*N)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(m*R-b*S-x*o)*Q,e[7]=(k*S-M*R+h*o)*Q,e[8]=(i*F-c*p+L*B)*Q,e[9]=(s*p-n*F-a*B)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*N-i*Y-y*B)*Q,e[13]=(n*Y-s*N+r*B)*Q,e[14]=(d*o-b*z-m*V)*Q,e[15]=(k*z-l*o+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m;return e[0]=c*P-y*F+L*Y,e[1]=r*F-s*P-a*Y,e[2]=d*S-m*g+x*z,e[3]=M*g-l*S-h*z,e[4]=y*p-i*P-L*N,e[5]=n*P-r*p+a*N,e[6]=m*R-b*S-x*o,e[7]=k*S-M*R+h*o,e[8]=i*F-c*p+L*B,e[9]=s*p-n*F-a*B,e[10]=b*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-i*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-b*z-m*V,e[15]=k*z-l*o+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],x=t*i-n*a,V=t*c-s*a,o=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,S=t*g-n*z+s*R,B=a*g-i*z+c*R,N=L*o-k*V+l*x,p=h*o-b*V+d*x;return y*S-r*B+m*N-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4}; +//# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f32.min.js.map b/dist-cdn/esm/2016/gl-matrix-f32.min.js.map new file mode 100644 index 00000000..f8a4bec9 --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f32.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";sQAAA,IAAAA,GAOaC,EAAN,MAAMA,UAAa,YAAa,CAWrC,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA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"b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "__privateAdd", "Mat2", "_IDENTITY_2X3", "_Mat2d", "values", "v", "__privateGet", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "__privateAdd", "Mat2d", "_IDENTITY_3X3", "_Mat3", "values", "v", "__privateGet", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "__privateAdd", "Mat3", "_IDENTITY_4X4", "_TMP_VEC3", "_Mat4", "values", "v", "__privateGet", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "__privateAdd", "Mat4", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "_DEFAULT_ANGLE_ORDER", "_TMP_QUAT1", "_TMP_QUAT2", "_TMP_MAT3", "_TMP_VEC3", "_X_UNIT_VEC3", "_Y_UNIT_VEC3", "_Quat", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "__privateGet", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "__privateAdd", "Quat", "Vec4", "_TMP_QUAT", "_TMP_VEC3", "_Quat2", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "__privateGet", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "__privateAdd", "Quat2", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] +} diff --git a/dist-cdn/esm/2016/gl-matrix-f64.js b/dist-cdn/esm/2016/gl-matrix-f64.js new file mode 100644 index 00000000..f665b3ef --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f64.js @@ -0,0 +1,9424 @@ +// glMatrix - v4.0.0-beta.3 +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); + +// src/common/index.ts +var GLM_EPSILON = 1e-6; + +// src/_lib/f64/Mat2.ts +var _IDENTITY_2X2; +var _Mat2 = class _Mat2 extends Float64Array { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v + ]); + } else { + super(v, 0, 4); + } + break; + default: + super(__privateGet(_Mat2, _IDENTITY_2X2)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity() { + this.set(__privateGet(_Mat2, _IDENTITY_2X2)); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values) { + return new _Mat2(...values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + let a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + let det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2(${a.join(", ")})`; + } +}; +_IDENTITY_2X2 = new WeakMap(); +__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([ + 1, + 0, + 0, + 1 +])); +var Mat2 = _Mat2; +Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; + +// src/_lib/f64/Mat2d.ts +var _IDENTITY_2X3; +var _Mat2d = class _Mat2d extends Float64Array { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 6: + super(values); + break; + case 2: + super(values[0], values[1], 6); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 6); + } + break; + default: + super(__privateGet(_Mat2d, _IDENTITY_2X3)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2d.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(__privateGet(_Mat2d, _IDENTITY_2X3)); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat2d.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH() { + return 6 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values) { + return new _Mat2d(...values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2d(${a.join(", ")})`; + } +}; +_IDENTITY_2X3 = new WeakMap(); +__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([ + 1, + 0, + 0, + 1, + 0, + 0 +])); +var Mat2d = _Mat2d; +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; + +// src/_lib/f64/Mat3.ts +var _IDENTITY_3X3; +var _Mat3 = class _Mat3 extends Float64Array { + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 9: + super(values); + break; + case 2: + super(values[0], values[1], 9); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 9); + } + break; + default: + super(__privateGet(_Mat3, _IDENTITY_3X3)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat3.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(__privateGet(_Mat3, _IDENTITY_3X3)); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat3.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH() { + return 9 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values) { + return new _Mat3(...values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2]; + const a10 = a[3], a11 = a[4], a12 = a[5]; + const a20 = a[6], a21 = a[7], a22 = a[8]; + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + let det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + ); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat3(${a.join(", ")})`; + } +}; +_IDENTITY_3X3 = new WeakMap(); +__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 +])); +var Mat3 = _Mat3; +Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; + +// src/_lib/f64/Mat4.ts +var _IDENTITY_4X4, _TMP_VEC3; +var _Mat4 = class _Mat4 extends Float64Array { + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 16: + super(values); + break; + case 2: + super(values[0], values[1], 16); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 16); + } + break; + default: + super(__privateGet(_Mat4, _IDENTITY_4X4)); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat4.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(__privateGet(_Mat4, _IDENTITY_4X4)); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH() { + return 16 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values) { + return new _Mat4(...values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a03 = a[3]; + const a12 = a[6], a13 = a[7]; + const a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out, a, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, v) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out, a) { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + let magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3)); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out, mat) { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out, mat) { + _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat); + const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0]; + const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1]; + const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2]; + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out, q, v, s) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out, q, v, s, o) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out, left, right, bottom, top, near, far = Infinity) { + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out, fovy, aspect, near, far = Infinity) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out, fov, near, far) { + const upTan = Math.tan(fov.upDegrees * Math.PI / 180); + const downTan = Math.tan(fov.downDegrees * Math.PI / 180); + const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + const xScale = 2 / (leftTan + rightTan); + const yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out, eye, center, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out, eye, target, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15] + ); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat4(${a.join(", ")})`; + } +}; +_IDENTITY_4X4 = new WeakMap(); +_TMP_VEC3 = new WeakMap(); +__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 +])); +/** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ +__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3)); +var Mat4 = _Mat4; +Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; + +// src/_lib/f64/Vec3.ts +var Vec3 = class _Vec3 extends Float64Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 3: + super(values); + break; + case 2: + super(values[0], values[1], 3); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v]); + } else { + super(v, 0, 3); + } + break; + } + default: + super(3); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec3.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec3.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH() { + return 3 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + let z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a) { + return 0; + } + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out, a, b) { + const ax = a[0], ay = a[1], az = a[2]; + const bx = b[0], by = b[1], bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out, a, b, c, d, t) { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out, a, b, c, d, t) { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out, a, m) { + let x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + const uvx = qy * z - qz * y; + const uvy = qz * x - qx * z; + const uvz = qx * y - qy * x; + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out, a, b, rad) { + const by = b[1]; + const bz = b[2]; + const py = a[1] - by; + const pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out, a, b, rad) { + const bx = b[0]; + const bz = b[2]; + const px = a[0] - bx; + const pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out, a, b, rad) { + const bx = b[0]; + const by = b[1]; + const px = a[0] - bx; + const py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec3(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } +}; +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; + +// src/_lib/f64/Vec4.ts +var Vec4 = class _Vec4 extends Float64Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a() { + return this[3]; + } + set a(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec4.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec4.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out, u, v, w) { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec4(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } +}; +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; + +// src/_lib/f64/Quat.ts +var _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3; +var _Quat = class _Quat extends Float64Array { + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale) { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b) { + return _Quat.dot(this, b); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis, q) { + const rad = Math.acos(q[3]) * 2; + const s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a, b) { + const dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + 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]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out, a) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const ax = a[0], ay = a[1], az = a[2], aw = a[3]; + let bx = b[0], by = b[1], bz = b[2], bw = b[3]; + let scale0; + let scale1; + let cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out, m) { + const fTrace = m[0] + m[4] + m[8]; + let fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + let i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + let j = (i + 1) % 3; + let k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) { + let halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + let sx = Math.sin(x); + let cx = Math.cos(x); + let sy = Math.sin(y); + let cy = Math.cos(y); + let sz = Math.sin(z); + let cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error("Unknown angle order " + order); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat(${a.join(", ")})`; + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + return out; + } + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return false; + } + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out, a, b) { + let dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); + _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b); + out[0] = __privateGet(_Quat, _TMP_VEC32)[0]; + out[1] = __privateGet(_Quat, _TMP_VEC32)[1]; + out[2] = __privateGet(_Quat, _TMP_VEC32)[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out, a, b, c, d, t) { + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t); + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t); + _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out, view, right, up) { + __privateGet(_Quat, _TMP_MAT3)[0] = right[0]; + __privateGet(_Quat, _TMP_MAT3)[3] = right[1]; + __privateGet(_Quat, _TMP_MAT3)[6] = right[2]; + __privateGet(_Quat, _TMP_MAT3)[1] = up[0]; + __privateGet(_Quat, _TMP_MAT3)[4] = up[1]; + __privateGet(_Quat, _TMP_MAT3)[7] = up[2]; + __privateGet(_Quat, _TMP_MAT3)[2] = -view[0]; + __privateGet(_Quat, _TMP_MAT3)[5] = -view[1]; + __privateGet(_Quat, _TMP_MAT3)[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3))); + } +}; +_DEFAULT_ANGLE_ORDER = new WeakMap(); +_TMP_QUAT1 = new WeakMap(); +_TMP_QUAT2 = new WeakMap(); +_TMP_MAT3 = new WeakMap(); +_TMP_VEC32 = new WeakMap(); +_X_UNIT_VEC3 = new WeakMap(); +_Y_UNIT_VEC3 = new WeakMap(); +__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, "zyx"); +// Temporary variables to prevent repeated allocations in the algorithms within Quat. +// These are declared as TypedArrays to aid in tree-shaking. +__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4)); +__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4)); +__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9)); +__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3)); +__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0])); +__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0])); +var Quat = _Quat; +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; +Quat.prototype.mul = Quat.prototype.multiply; +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; + +// src/_lib/f64/Quat2.ts +var _TMP_QUAT, _TMP_VEC33; +var _Quat2 = class _Quat2 extends Float64Array { + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 8: + super(values); + break; + case 2: + super(values[0], values[1], 8); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v, v, v, v, v]); + } else { + super(v, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH() { + return 8 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + return new _Quat2( + x1, + y1, + z1, + w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1 + ); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, t) { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out, a) { + Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a); + Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a); + return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33)); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out, a) { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out, q, a) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad = rad * 0.5; + const s = Math.sin(rad); + const bx = s * axis[0] / axisLength; + const by = s * axis[1] / axisLength; + const bz = s * axis[2] / axisLength; + const bw = Math.cos(rad); + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out, a, b) { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const mt = 1 - t; + if (_Quat2.dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + let magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat2(${a.join(", ")})`; + } + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } +}; +_TMP_QUAT = new WeakMap(); +_TMP_VEC33 = new WeakMap(); +// Temporary variables to prevent repeated allocations in the algorithms within Quat2. +// These are declared as TypedArrays to aid in tree-shaking. +__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4)); +__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3)); +var Quat2 = _Quat2; +Quat2.dot = Quat.dot; +Quat2.squaredLength = Quat.squaredLength; +Quat2.sqrLen = Quat.squaredLength; +Quat2.mag = Quat.magnitude; +Quat2.length = Quat.magnitude; +Quat2.len = Quat.magnitude; +Quat2.mul = Quat2.multiply; + +// src/_lib/f64/Vec2.ts +var Vec2 = class _Vec2 extends Float64Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 2: { + const v = values[0]; + if (typeof v === "number") { + super([v, values[1]]); + } else { + super(v, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v]); + } else { + super(v, 0, 2); + } + break; + } + default: + super(2); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec2.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH() { + return 2 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out, a, b) { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out, a, b, rad) { + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a, b) { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a) { + return `Vec2(${a.join(", ")})`; + } +}; +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; + +// src/swizzle/f64/index.ts +var GLM_SWIZZLES_ENABLED_F64 = false; +function EnableSwizzlesF64() { + if (GLM_SWIZZLES_ENABLED_F64) { + return; + } + const VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + const VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + const VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + const SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function() { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function() { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + }; + case 4: + return function() { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; + } + } + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + GLM_SWIZZLES_ENABLED_F64 = true; +} + +// src/util/angleConversion.ts +var GLM_DEG_TO_RAD = Math.PI / 180; +var GLM_RAD_TO_DEG = 180 / Math.PI; +function toDegree(value) { + return value * GLM_RAD_TO_DEG; +} +function toRadian(value) { + return value * GLM_DEG_TO_RAD; +} +export { + EnableSwizzlesF64, + Mat2, + Mat2d, + Mat3, + Mat4, + Quat, + Quat2, + Vec2, + Vec3, + Vec4, + toDegree, + toRadian +}; +//# sourceMappingURL=gl-matrix-f64.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f64.js.map b/dist-cdn/esm/2016/gl-matrix-f64.js.map new file mode 100644 index 00000000..f778c8b5 --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f64.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r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AW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC3HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", + "names": ["_TMP_VEC3", "_TMP_VEC3"] +} diff --git a/dist-cdn/esm/2016/gl-matrix-f64.min.js b/dist-cdn/esm/2016/gl-matrix-f64.min.js new file mode 100644 index 00000000..61d1fdb5 --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f64.min.js @@ -0,0 +1,3 @@ +// glMatrix - v4.0.0-beta.3 +var de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(xe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-i*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(b*g-l*S-h*z)*Q,e[4]=(y*p-a*P-L*N)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(m*R-M*S-x*o)*Q,e[7]=(k*S-b*R+h*o)*Q,e[8]=(a*I-c*p+L*B)*Q,e[9]=(s*p-n*I-i*B)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*N-a*Y-y*B)*Q,e[13]=(n*Y-s*N+r*B)*Q,e[14]=(d*o-M*z-m*V)*Q,e[15]=(k*z-l*o+b*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-i*Y,e[2]=d*S-m*g+x*z,e[3]=b*g-l*S-h*z,e[4]=y*p-a*P-L*N,e[5]=n*P-r*p+i*N,e[6]=m*R-M*S-x*o,e[7]=k*S-b*R+h*o,e[8]=a*I-c*p+L*B,e[9]=s*p-n*I-i*B,e[10]=M*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-a*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-M*z-m*V,e[15]=k*z-l*o+b*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],b=e[11],h=e[12],M=e[13],d=e[14],m=e[15],x=t*a-n*i,V=t*c-s*i,o=n*c-s*a,R=L*M-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,k=s*c,l=s*y,b=s*L,h=r*y,M=r*L,d=i*L,m=a*c,x=a*y,V=a*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=b-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=M+m,e[7]=0,e[8]=b+x,e[9]=M-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+i*i;return k>0?(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2/k,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2/k):(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=0,e[4]=(r*I-s*P-i*Y)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(s*p-n*I-i*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-M*S-x*o)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case"xzy":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case"yxz":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case"yzx":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case"zxy":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case"zyx":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(", ")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian}; +//# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f64.min.js.map b/dist-cdn/esm/2016/gl-matrix-f64.min.js.map new file mode 100644 index 00000000..157a0472 --- /dev/null +++ b/dist-cdn/esm/2016/gl-matrix-f64.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";sQAAA,IAAAA,GAOaC,EAAN,MAAMA,UAAa,YAAa,CAWrC,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,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AAQ,CAAC,CAAC,CAAC,CAAC,CAAG,EAC1I,IAAK,GACH,OAAO,UAAW,CAAE,OAAO,IAAIG,EAAK,KAAKL,EAAcE,EAAQ,CAAC,CAAC,CAAC,EAAG,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,EAAG,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,EAAG,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,CAAC,CAAG,CAC7K,CACF,CAEA,QAAWA,KAAWL,EAAe,CACnC,IAAMS,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeC,EAAK,UAAWD,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeF,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,GAA2B,EAC7B,CC3HA,IAAMY,GAAyB,KAAK,GAAK,IAKnCC,GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", + "names": ["_IDENTITY_2X2", "_Mat2", "values", "v", "__privateGet", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "__privateAdd", "Mat2", "_IDENTITY_2X3", "_Mat2d", "values", "v", "__privateGet", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "__privateAdd", "Mat2d", "_IDENTITY_3X3", "_Mat3", "values", "v", "__privateGet", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "__privateAdd", "Mat3", "_IDENTITY_4X4", "_TMP_VEC3", "_Mat4", "values", "v", "__privateGet", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "__privateAdd", "Mat4", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "_DEFAULT_ANGLE_ORDER", "_TMP_QUAT1", "_TMP_QUAT2", "_TMP_MAT3", "_TMP_VEC3", "_X_UNIT_VEC3", "_Y_UNIT_VEC3", "_Quat", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "__privateGet", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "__privateAdd", "Quat", "Vec4", "_TMP_QUAT", "_TMP_VEC3", "_Quat2", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "__privateGet", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "__privateAdd", "Quat2", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] +} diff --git a/dist-cdn/esm/2022/gl-matrix-f32.js b/dist-cdn/esm/2022/gl-matrix-f32.js new file mode 100644 index 00000000..458dc71b --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f32.js @@ -0,0 +1,9401 @@ +// glMatrix - v4.0.0-beta.3 + +// src/common/index.ts +var GLM_EPSILON = 1e-6; + +// src/_lib/f32/Mat2.ts +var Mat2 = class _Mat2 extends Float32Array { + static #IDENTITY_2X2 = new Float32Array([ + 1, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v + ]); + } else { + super(v, 0, 4); + } + break; + default: + super(_Mat2.#IDENTITY_2X2); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity() { + this.set(_Mat2.#IDENTITY_2X2); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values) { + return new _Mat2(...values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + let a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + let det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2(${a.join(", ")})`; + } +}; +Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; + +// src/_lib/f32/Mat2d.ts +var Mat2d = class _Mat2d extends Float32Array { + static #IDENTITY_2X3 = new Float32Array([ + 1, + 0, + 0, + 1, + 0, + 0 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 6: + super(values); + break; + case 2: + super(values[0], values[1], 6); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 6); + } + break; + default: + super(_Mat2d.#IDENTITY_2X3); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2d.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat2d.#IDENTITY_2X3); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat2d.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH() { + return 6 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values) { + return new _Mat2d(...values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2d(${a.join(", ")})`; + } +}; +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; + +// src/_lib/f32/Mat3.ts +var Mat3 = class _Mat3 extends Float32Array { + static #IDENTITY_3X3 = new Float32Array([ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 9: + super(values); + break; + case 2: + super(values[0], values[1], 9); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 9); + } + break; + default: + super(_Mat3.#IDENTITY_3X3); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat3.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat3.#IDENTITY_3X3); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat3.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH() { + return 9 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values) { + return new _Mat3(...values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2]; + const a10 = a[3], a11 = a[4], a12 = a[5]; + const a20 = a[6], a21 = a[7], a22 = a[8]; + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + let det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + ); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat3(${a.join(", ")})`; + } +}; +Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; + +// src/_lib/f32/Mat4.ts +var Mat4 = class _Mat4 extends Float32Array { + static #IDENTITY_4X4 = new Float32Array([ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ]); + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + static #TMP_VEC3 = new Float32Array(3); + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 16: + super(values); + break; + case 2: + super(values[0], values[1], 16); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 16); + } + break; + default: + super(_Mat4.#IDENTITY_4X4); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat4.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat4.#IDENTITY_4X4); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH() { + return 16 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values) { + return new _Mat4(...values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a03 = a[3]; + const a12 = a[6], a13 = a[7]; + const a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out, a, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, v) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out, a) { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + let magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, _Mat4.#TMP_VEC3); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out, mat) { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out, mat) { + _Mat4.getScaling(_Mat4.#TMP_VEC3, mat); + const is1 = 1 / _Mat4.#TMP_VEC3[0]; + const is2 = 1 / _Mat4.#TMP_VEC3[1]; + const is3 = 1 / _Mat4.#TMP_VEC3[2]; + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out, q, v, s) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out, q, v, s, o) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out, left, right, bottom, top, near, far = Infinity) { + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out, fovy, aspect, near, far = Infinity) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out, fov, near, far) { + const upTan = Math.tan(fov.upDegrees * Math.PI / 180); + const downTan = Math.tan(fov.downDegrees * Math.PI / 180); + const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + const xScale = 2 / (leftTan + rightTan); + const yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out, eye, center, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out, eye, target, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15] + ); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat4(${a.join(", ")})`; + } +}; +Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; + +// src/_lib/f32/Vec3.ts +var Vec3 = class _Vec3 extends Float32Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 3: + super(values); + break; + case 2: + super(values[0], values[1], 3); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v]); + } else { + super(v, 0, 3); + } + break; + } + default: + super(3); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec3.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec3.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH() { + return 3 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + let z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a) { + return 0; + } + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out, a, b) { + const ax = a[0], ay = a[1], az = a[2]; + const bx = b[0], by = b[1], bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out, a, b, c, d, t) { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out, a, b, c, d, t) { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out, a, m) { + let x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + const uvx = qy * z - qz * y; + const uvy = qz * x - qx * z; + const uvz = qx * y - qy * x; + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out, a, b, rad) { + const by = b[1]; + const bz = b[2]; + const py = a[1] - by; + const pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out, a, b, rad) { + const bx = b[0]; + const bz = b[2]; + const px = a[0] - bx; + const pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out, a, b, rad) { + const bx = b[0]; + const by = b[1]; + const px = a[0] - bx; + const py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec3(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } +}; +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; + +// src/_lib/f32/Vec4.ts +var Vec4 = class _Vec4 extends Float32Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a() { + return this[3]; + } + set a(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec4.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec4.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out, u, v, w) { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec4(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } +}; +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; + +// src/_lib/f32/Quat.ts +var Quat = class _Quat extends Float32Array { + static #DEFAULT_ANGLE_ORDER = "zyx"; + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT1 = new Float32Array(4); + static #TMP_QUAT2 = new Float32Array(4); + static #TMP_MAT3 = new Float32Array(9); + static #TMP_VEC3 = new Float32Array(3); + static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]); + static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]); + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale) { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b) { + return _Quat.dot(this, b); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis, q) { + const rad = Math.acos(q[3]) * 2; + const s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a, b) { + const dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + 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]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out, a) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const ax = a[0], ay = a[1], az = a[2], aw = a[3]; + let bx = b[0], by = b[1], bz = b[2], bw = b[3]; + let scale0; + let scale1; + let cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out, m) { + const fTrace = m[0] + m[4] + m[8]; + let fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + let i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + let j = (i + 1) % 3; + let k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) { + let halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + let sx = Math.sin(x); + let cx = Math.cos(x); + let sy = Math.sin(y); + let cy = Math.cos(y); + let sz = Math.sin(z); + let cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error("Unknown angle order " + order); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat(${a.join(", ")})`; + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + return out; + } + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return false; + } + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out, a, b) { + let dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a); + if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3); + _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(_Quat.#TMP_VEC3, a, b); + out[0] = _Quat.#TMP_VEC3[0]; + out[1] = _Quat.#TMP_VEC3[1]; + out[2] = _Quat.#TMP_VEC3[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out, a, b, c, d, t) { + _Quat.slerp(_Quat.#TMP_QUAT1, a, d, t); + _Quat.slerp(_Quat.#TMP_QUAT2, b, c, t); + _Quat.slerp(out, _Quat.#TMP_QUAT1, _Quat.#TMP_QUAT2, 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out, view, right, up) { + _Quat.#TMP_MAT3[0] = right[0]; + _Quat.#TMP_MAT3[3] = right[1]; + _Quat.#TMP_MAT3[6] = right[2]; + _Quat.#TMP_MAT3[1] = up[0]; + _Quat.#TMP_MAT3[4] = up[1]; + _Quat.#TMP_MAT3[7] = up[2]; + _Quat.#TMP_MAT3[2] = -view[0]; + _Quat.#TMP_MAT3[5] = -view[1]; + _Quat.#TMP_MAT3[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, _Quat.#TMP_MAT3)); + } +}; +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; +Quat.prototype.mul = Quat.prototype.multiply; +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; + +// src/_lib/f32/Quat2.ts +var Quat2 = class _Quat2 extends Float32Array { + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT = new Float32Array(4); + static #TMP_VEC3 = new Float32Array(3); + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 8: + super(values); + break; + case 2: + super(values[0], values[1], 8); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v, v, v, v, v]); + } else { + super(v, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH() { + return 8 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + return new _Quat2( + x1, + y1, + z1, + w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1 + ); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, t) { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out, a) { + Mat4.getRotation(_Quat2.#TMP_QUAT, a); + Mat4.getTranslation(_Quat2.#TMP_VEC3, a); + return _Quat2.fromRotationTranslation(out, _Quat2.#TMP_QUAT, _Quat2.#TMP_VEC3); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out, a) { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out, q, a) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad = rad * 0.5; + const s = Math.sin(rad); + const bx = s * axis[0] / axisLength; + const by = s * axis[1] / axisLength; + const bz = s * axis[2] / axisLength; + const bw = Math.cos(rad); + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out, a, b) { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const mt = 1 - t; + if (_Quat2.dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + let magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat2(${a.join(", ")})`; + } + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } +}; +Quat2.dot = Quat.dot; +Quat2.squaredLength = Quat.squaredLength; +Quat2.sqrLen = Quat.squaredLength; +Quat2.mag = Quat.magnitude; +Quat2.length = Quat.magnitude; +Quat2.len = Quat.magnitude; +Quat2.mul = Quat2.multiply; + +// src/_lib/f32/Vec2.ts +var Vec2 = class _Vec2 extends Float32Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 2: { + const v = values[0]; + if (typeof v === "number") { + super([v, values[1]]); + } else { + super(v, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v]); + } else { + super(v, 0, 2); + } + break; + } + default: + super(2); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec2.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH() { + return 2 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out, a, b) { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out, a, b, rad) { + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a, b) { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a) { + return `Vec2(${a.join(", ")})`; + } +}; +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; + +// src/swizzle/index.ts +var GLM_SWIZZLES_ENABLED_F32 = false; +function EnableSwizzles() { + if (GLM_SWIZZLES_ENABLED_F32) { + return; + } + const VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + const VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + const VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + const SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function() { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function() { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + }; + case 4: + return function() { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; + } + } + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + GLM_SWIZZLES_ENABLED_F32 = true; +} + +// src/util/angleConversion.ts +var GLM_DEG_TO_RAD = Math.PI / 180; +var GLM_RAD_TO_DEG = 180 / Math.PI; +function toDegree(value) { + return value * GLM_RAD_TO_DEG; +} +function toRadian(value) { + return value * GLM_DEG_TO_RAD; +} +export { + EnableSwizzles, + Mat2, + Mat2d, + Mat3, + Mat4, + Quat, + Quat2, + Vec2, + Vec3, + Vec4, + Mat2 as mat2, + Mat2d as mat2d, + Mat3 as mat3, + Mat4 as mat4, + Quat as quat, + Quat2 as quat2, + toDegree, + toRadian, + Vec2 as vec2, + Vec3 as vec3, + Vec4 as vec4 +}; +//# sourceMappingURL=gl-matrix-f32.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f32.js.map b/dist-cdn/esm/2022/gl-matrix-f32.js.map new file mode 100644 index 00000000..e787aeb5 --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f32.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;AASO,IAAM,cAAsB;;;ACF5B,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB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[] +} diff --git a/dist-cdn/esm/2022/gl-matrix-f32.min.js b/dist-cdn/esm/2022/gl-matrix-f32.min.js new file mode 100644 index 00000000..a089a337 --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f32.min.js @@ -0,0 +1,3 @@ +// glMatrix - v4.0.0-beta.3 +var Z=class b extends Float32Array{static#t=new Float32Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float32Array{static#t=new Float32Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[3]=k-o,e[6]=M+x,e[1]=k+o,e[4]=1-L-d,e[7]=h-m,e[2]=M-x,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=(r*D-s*N-a*F)*Q,e[4]=(n*N-r*f+a*B)*Q,e[5]=(s*f-n*D-a*A)*Q,e[6]=(m*T-x*V+o*w)*Q,e[7]=(x*g-d*T-o*R)*Q,e[8]=(d*V-m*g+o*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(r*D-s*N-a*F)*Q,e[2]=(m*T-x*V+o*w)*Q,e[3]=(M*V-l*T-h*w)*Q,e[4]=(y*f-i*N-L*B)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(x*g-d*T-o*R)*Q,e[7]=(k*T-M*g+h*R)*Q,e[8]=(i*D-c*f+L*A)*Q,e[9]=(s*f-n*D-a*A)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=(l*g-k*V-h*z)*Q,e[12]=(c*B-i*F-y*A)*Q,e[13]=(n*F-s*B+r*A)*Q,e[14]=(m*R-d*w-x*z)*Q,e[15]=(k*w-l*R+M*z)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x;return e[0]=c*N-y*D+L*F,e[1]=r*D-s*N-a*F,e[2]=m*T-x*V+o*w,e[3]=M*V-l*T-h*w,e[4]=y*f-i*N-L*B,e[5]=n*N-r*f+a*B,e[6]=x*g-d*T-o*R,e[7]=k*T-M*g+h*R,e[8]=i*D-c*f+L*A,e[9]=s*f-n*D-a*A,e[10]=d*V-m*g+o*z,e[11]=l*g-k*V-h*z,e[12]=c*B-i*F-y*A,e[13]=n*F-s*B+r*A,e[14]=m*R-d*w-x*z,e[15]=k*w-l*R+M*z,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],x=e[15],o=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,B=L*R-k*z+l*o,f=h*R-d*z+m*o;return y*T-r*A+x*B-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],x=t[13],o=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*x,e[2]=R*a+g*L+w*h+V*o,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*x,e[6]=R*a+g*L+w*h+V*o,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*x,e[10]=R*a+g*L+w*h+V*o,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*x,e[14]=R*a+g*L+w*h+V*o,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],x=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=x,e[11]=o,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+x*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,B=i*r*k-a*y,f=r*a*k-i*y,F=a*a*k+L,D=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*B,e[1]=M*T+x*A+g*B,e[2]=h*T+o*A+w*B,e[3]=d*T+z*A+V*B,e[4]=l*f+m*F+R*D,e[5]=M*f+x*F+g*D,e[6]=h*f+o*F+w*D,e[7]=d*f+z*F+V*D,e[8]=l*N+m*Q+R*Y,e[9]=M*N+x*Q+g*Y,e[10]=h*N+o*Q+w*Y,e[11]=d*N+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,x=i*c,o=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-o,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+x,e[7]=0,e[8]=M+o,e[9]=d-x,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=0,e[4]=(r*D-s*N-a*F)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(s*f-n*D-a*A)*Q,e[7]=0,e[8]=(m*T-x*V+o*w)*Q,e[9]=(x*g-d*T-o*R)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],x=r*h,o=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,B=x+g+A,f=0;return B>0?(f=Math.sqrt(B+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(o-R)/f):x>g&&x>A?(f=Math.sqrt(1+x-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(o+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-x-A)*2,e[3]=(V-z)/f,e[0]=(o+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-x-g)*2,e[3]=(o-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,x=i*k,o=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+x))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+x))*w,e[6]=(m+o)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-o)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,x=i*l,o=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],B=r[1],f=r[2],F=(1-(m+o))*w,D=(h+g)*w,N=(d-R)*w,Q=(h-g)*V,Y=(1-(M+o))*V,X=(x+z)*V,C=(d+R)*T,H=(x-z)*T,$=(1-(M+m))*T;return e[0]=F,e[1]=D,e[2]=N,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+A-(F*A+Q*B+C*f),e[13]=n[1]+B-(D*A+Y*B+H*f),e[14]=n[2]+f-(N*A+X*B+$*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[1]=k+o,e[2]=M-x,e[3]=0,e[4]=k-o,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+x,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,x=1/Math.sqrt(h*h+d*d+m*m);h*=x,d*=x,m*=x;let o=y*m-L*d,z=L*h-c*m,R=c*d-y*h;x=Math.sqrt(o*o+z*z+R*R),x?(x=1/x,o*=x,z*=x,R*=x):(o=0,z=0,R=0);let g=d*R-m*z,w=m*o-h*R,V=h*z-d*o;return x=Math.sqrt(g*g+w*w+V*V),x?(x=1/x,g*=x,w*=x,V*=x):(g=0,w=0,V=0),e[0]=o,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(o*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,x=c*l-y*k;return h=d*d+m*m+x*x,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,x*=h),e[0]=d,e[1]=m,e[2]=x,e[3]=0,e[4]=l*x-M*m,e[5]=M*d-k*x,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],x=e[14],o=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],B=t[7],f=t[8],F=t[9],D=t[10],N=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-B)<=1e-6*Math.max(1,Math.abs(L),Math.abs(B))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-F)<=1e-6*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(M-D)<=1e-6*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(h-N)<=1e-6*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(x-X)<=1e-6*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(o-C)<=1e-6*Math.max(1,Math.abs(o),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var I=class b extends Float32Array{static#t="zyx";static#e=new Float32Array(4);static#r=new Float32Array(4);static#n=new Float32Array(9);static#s=new Float32Array(3);static#a=new Float32Array([1,0,0]);static#i=new Float32Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),x=Math.sin(m);M=Math.sin((1-s)*m)/x,h=Math.sin(s*m)/x}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};I.set=E.set;I.add=E.add;I.lerp=E.lerp;I.normalize=E.normalize;I.squaredLength=E.squaredLength;I.sqrLen=E.squaredLength;I.exactEquals=E.exactEquals;I.equals=E.equals;I.magnitude=E.magnitude;I.prototype.mul=I.prototype.multiply;I.mul=I.multiply;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var O=class b extends Float32Array{static#t=new Float32Array(4);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],x=t[6],o=t[7];return e[4]=d*L+o*i+m*y-x*c,e[5]=m*L+o*c+x*i-d*y,e[6]=x*L+o*y+d*c-m*i,e[7]=o*L-d*i-m*c-x*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],x=n[1],o=n[2],z=n[3];return e[0]=s*z+i*m+r*o-a*x,e[1]=r*z+i*x+a*m-s*o,e[2]=a*z+i*o+s*x-r*m,e[3]=i*z-s*m-r*x-a*o,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*o-h*x,e[5]=r*k+i*y+a*c-s*L+M*z+d*x+h*m-l*o,e[6]=a*k+i*L+s*y-r*c+h*z+d*o+l*x-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*x-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],x=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};O.dot=I.dot;O.squaredLength=I.squaredLength;O.sqrLen=I.squaredLength;O.mag=I.magnitude;O.length=I.magnitude;O.len=I.magnitude;O.mul=O.multiply;var S=class b extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};S.prototype.sub=S.prototype.subtract;S.prototype.mul=S.prototype.multiply;S.prototype.div=S.prototype.divide;S.prototype.dist=S.prototype.distance;S.prototype.sqrDist=S.prototype.squaredDistance;S.sub=S.subtract;S.mul=S.multiply;S.div=S.divide;S.dist=S.distance;S.sqrDist=S.squaredDistance;S.sqrLen=S.squaredLength;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var W=!1;function ze(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new S(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of b){let a=s(r);Object.defineProperty(S.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function pe(b){return b*J}function fe(b){return b*U}export{ze as EnableSwizzles,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,I as Quat,O as Quat2,S as Vec2,q as Vec3,E as Vec4,Z as mat2,j as mat2d,G as mat3,P as mat4,I as quat,O as quat2,pe as toDegree,fe as toRadian,S as vec2,q as vec3,E as vec4}; +//# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f32.min.js.map b/dist-cdn/esm/2022/gl-matrix-f32.min.js.map new file mode 100644 index 00000000..fb21244f --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f32.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";AAOO,IAAMA,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAA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ACjB", + "names": ["Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] +} diff --git a/dist-cdn/esm/2022/gl-matrix-f64.js b/dist-cdn/esm/2022/gl-matrix-f64.js new file mode 100644 index 00000000..be140cbd --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f64.js @@ -0,0 +1,9392 @@ +// glMatrix - v4.0.0-beta.3 + +// src/common/index.ts +var GLM_EPSILON = 1e-6; + +// src/_lib/f64/Mat2.ts +var Mat2 = class _Mat2 extends Float64Array { + static #IDENTITY_2X2 = new Float64Array([ + 1, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v + ]); + } else { + super(v, 0, 4); + } + break; + default: + super(_Mat2.#IDENTITY_2X2); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity() { + this.set(_Mat2.#IDENTITY_2X2); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values) { + return new _Mat2(...values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + let a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + let det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2(${a.join(", ")})`; + } +}; +Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; + +// src/_lib/f64/Mat2d.ts +var Mat2d = class _Mat2d extends Float64Array { + static #IDENTITY_2X3 = new Float64Array([ + 1, + 0, + 0, + 1, + 0, + 0 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 6: + super(values); + break; + case 2: + super(values[0], values[1], 6); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 6); + } + break; + default: + super(_Mat2d.#IDENTITY_2X3); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2d.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat2d.#IDENTITY_2X3); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat2d.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH() { + return 6 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values) { + return new _Mat2d(...values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2d(${a.join(", ")})`; + } +}; +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; + +// src/_lib/f64/Mat3.ts +var Mat3 = class _Mat3 extends Float64Array { + static #IDENTITY_3X3 = new Float64Array([ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 9: + super(values); + break; + case 2: + super(values[0], values[1], 9); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 9); + } + break; + default: + super(_Mat3.#IDENTITY_3X3); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat3.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat3.#IDENTITY_3X3); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat3.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH() { + return 9 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values) { + return new _Mat3(...values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2]; + const a10 = a[3], a11 = a[4], a12 = a[5]; + const a20 = a[6], a21 = a[7], a22 = a[8]; + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + let det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + ); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat3(${a.join(", ")})`; + } +}; +Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; + +// src/_lib/f64/Mat4.ts +var Mat4 = class _Mat4 extends Float64Array { + static #IDENTITY_4X4 = new Float64Array([ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ]); + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + static #TMP_VEC3 = new Float64Array(3); + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 16: + super(values); + break; + case 2: + super(values[0], values[1], 16); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 16); + } + break; + default: + super(_Mat4.#IDENTITY_4X4); + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat4.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat4.#IDENTITY_4X4); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH() { + return 16 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values) { + return new _Mat4(...values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a03 = a[3]; + const a12 = a[6], a13 = a[7]; + const a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out, a, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a20 = a[8]; + let a21 = a[9]; + let a22 = a[10]; + let a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out, a, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + let a00 = a[0]; + let a01 = a[1]; + let a02 = a[2]; + let a03 = a[3]; + let a10 = a[4]; + let a11 = a[5]; + let a12 = a[6]; + let a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out, rad) { + let s = Math.sin(rad); + let c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, v) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out, a) { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + let magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, _Mat4.#TMP_VEC3); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out, mat) { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out, mat) { + _Mat4.getScaling(_Mat4.#TMP_VEC3, mat); + const is1 = 1 / _Mat4.#TMP_VEC3[0]; + const is2 = 1 / _Mat4.#TMP_VEC3[1]; + const is3 = 1 / _Mat4.#TMP_VEC3[2]; + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out, q, v, s) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out, q, v, s, o) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out, left, right, bottom, top, near, far = Infinity) { + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out, fovy, aspect, near, far = Infinity) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out, fov, near, far) { + const upTan = Math.tan(fov.upDegrees * Math.PI / 180); + const downTan = Math.tan(fov.downDegrees * Math.PI / 180); + const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + const xScale = 2 / (leftTan + rightTan); + const yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out, eye, center, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out, eye, target, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15] + ); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat4(${a.join(", ")})`; + } +}; +Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; + +// src/_lib/f64/Vec3.ts +var Vec3 = class _Vec3 extends Float64Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 3: + super(values); + break; + case 2: + super(values[0], values[1], 3); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v]); + } else { + super(v, 0, 3); + } + break; + } + default: + super(3); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec3.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec3.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH() { + return 3 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + let z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a) { + return 0; + } + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out, a, b) { + const ax = a[0], ay = a[1], az = a[2]; + const bx = b[0], by = b[1], bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out, a, b, c, d, t) { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out, a, b, c, d, t) { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out, a, m) { + let x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + const uvx = qy * z - qz * y; + const uvy = qz * x - qx * z; + const uvz = qx * y - qy * x; + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out, a, b, rad) { + const by = b[1]; + const bz = b[2]; + const py = a[1] - by; + const pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out, a, b, rad) { + const bx = b[0]; + const bz = b[2]; + const px = a[0] - bx; + const pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out, a, b, rad) { + const bx = b[0]; + const by = b[1]; + const px = a[0] - bx; + const py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec3(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } +}; +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; + +// src/_lib/f64/Vec4.ts +var Vec4 = class _Vec4 extends Float64Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a() { + return this[3]; + } + set a(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec4.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec4.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out, u, v, w) { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec4(${a.join(", ")})`; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } +}; +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; + +// src/_lib/f64/Quat.ts +var Quat = class _Quat extends Float64Array { + static #DEFAULT_ANGLE_ORDER = "zyx"; + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT1 = new Float64Array(4); + static #TMP_QUAT2 = new Float64Array(4); + static #TMP_MAT3 = new Float64Array(9); + static #TMP_VEC3 = new Float64Array(3); + static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]); + static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]); + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale) { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b) { + return _Quat.dot(this, b); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis, q) { + const rad = Math.acos(q[3]) * 2; + const s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a, b) { + const dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + 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]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out, a) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const ax = a[0], ay = a[1], az = a[2], aw = a[3]; + let bx = b[0], by = b[1], bz = b[2], bw = b[3]; + let scale0; + let scale1; + let cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out, m) { + const fTrace = m[0] + m[4] + m[8]; + let fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + let i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + let j = (i + 1) % 3; + let k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) { + let halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + let sx = Math.sin(x); + let cx = Math.cos(x); + let sy = Math.sin(y); + let cy = Math.cos(y); + let sz = Math.sin(z); + let cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error("Unknown angle order " + order); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat(${a.join(", ")})`; + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + return out; + } + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return false; + } + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out, a, b) { + let dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a); + if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3); + _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(_Quat.#TMP_VEC3, a, b); + out[0] = _Quat.#TMP_VEC3[0]; + out[1] = _Quat.#TMP_VEC3[1]; + out[2] = _Quat.#TMP_VEC3[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out, a, b, c, d, t) { + _Quat.slerp(_Quat.#TMP_QUAT1, a, d, t); + _Quat.slerp(_Quat.#TMP_QUAT2, b, c, t); + _Quat.slerp(out, _Quat.#TMP_QUAT1, _Quat.#TMP_QUAT2, 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out, view, right, up) { + _Quat.#TMP_MAT3[0] = right[0]; + _Quat.#TMP_MAT3[3] = right[1]; + _Quat.#TMP_MAT3[6] = right[2]; + _Quat.#TMP_MAT3[1] = up[0]; + _Quat.#TMP_MAT3[4] = up[1]; + _Quat.#TMP_MAT3[7] = up[2]; + _Quat.#TMP_MAT3[2] = -view[0]; + _Quat.#TMP_MAT3[5] = -view[1]; + _Quat.#TMP_MAT3[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, _Quat.#TMP_MAT3)); + } +}; +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; +Quat.prototype.mul = Quat.prototype.multiply; +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; + +// src/_lib/f64/Quat2.ts +var Quat2 = class _Quat2 extends Float64Array { + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT = new Float64Array(4); + static #TMP_VEC3 = new Float64Array(3); + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 8: + super(values); + break; + case 2: + super(values[0], values[1], 8); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v, v, v, v, v]); + } else { + super(v, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH() { + return 8 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + return new _Quat2( + x1, + y1, + z1, + w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1 + ); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, t) { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out, a) { + Mat4.getRotation(_Quat2.#TMP_QUAT, a); + Mat4.getTranslation(_Quat2.#TMP_VEC3, a); + return _Quat2.fromRotationTranslation(out, _Quat2.#TMP_QUAT, _Quat2.#TMP_VEC3); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out, a) { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out, q, a) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad = rad * 0.5; + const s = Math.sin(rad); + const bx = s * axis[0] / axisLength; + const by = s * axis[1] / axisLength; + const bz = s * axis[2] / axisLength; + const bw = Math.cos(rad); + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out, a, b) { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const mt = 1 - t; + if (_Quat2.dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + let magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat2(${a.join(", ")})`; + } + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } +}; +Quat2.dot = Quat.dot; +Quat2.squaredLength = Quat.squaredLength; +Quat2.sqrLen = Quat.squaredLength; +Quat2.mag = Quat.magnitude; +Quat2.length = Quat.magnitude; +Quat2.len = Quat.magnitude; +Quat2.mul = Quat2.multiply; + +// src/_lib/f64/Vec2.ts +var Vec2 = class _Vec2 extends Float64Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 2: { + const v = values[0]; + if (typeof v === "number") { + super([v, values[1]]); + } else { + super(v, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v]); + } else { + super(v, 0, 2); + } + break; + } + default: + super(2); + break; + } + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec2.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH() { + return 2 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + let x = a[0]; + let y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + static length(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out, a, b) { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out, a, b, rad) { + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a, b) { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a) { + return `Vec2(${a.join(", ")})`; + } +}; +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; + +// src/swizzle/f64/index.ts +var GLM_SWIZZLES_ENABLED_F64 = false; +function EnableSwizzlesF64() { + if (GLM_SWIZZLES_ENABLED_F64) { + return; + } + const VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + const VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + const VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + const SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function() { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function() { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + }; + case 4: + return function() { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; + } + } + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + GLM_SWIZZLES_ENABLED_F64 = true; +} + +// src/util/angleConversion.ts +var GLM_DEG_TO_RAD = Math.PI / 180; +var GLM_RAD_TO_DEG = 180 / Math.PI; +function toDegree(value) { + return value * GLM_RAD_TO_DEG; +} +function toRadian(value) { + return value * GLM_DEG_TO_RAD; +} +export { + EnableSwizzlesF64, + Mat2, + Mat2d, + Mat3, + Mat4, + Quat, + Quat2, + Vec2, + Vec3, + Vec4, + toDegree, + toRadian +}; +//# sourceMappingURL=gl-matrix-f64.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f64.js.map b/dist-cdn/esm/2022/gl-matrix-f64.js.map new file mode 100644 index 00000000..040889f4 --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f64.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;AASO,IAAM,cAAsB;;;ACF5B,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAqE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AuB;AAC9C,SAAO,QAAQ;AACjB;", + "names": [] +} diff --git a/dist-cdn/esm/2022/gl-matrix-f64.min.js b/dist-cdn/esm/2022/gl-matrix-f64.min.js new file mode 100644 index 00000000..990ff86d --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f64.min.js @@ -0,0 +1,3 @@ +// glMatrix - v4.0.0-beta.3 +var Z=class b extends Float64Array{static#t=new Float64Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float64Array{static#t=new Float64Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[3]=k-o,e[6]=M+x,e[1]=k+o,e[4]=1-L-d,e[7]=h-m,e[2]=M-x,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=(r*D-s*N-a*I)*Q,e[4]=(n*N-r*f+a*B)*Q,e[5]=(s*f-n*D-a*A)*Q,e[6]=(m*T-x*V+o*w)*Q,e[7]=(x*g-d*T-o*R)*Q,e[8]=(d*V-m*g+o*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(r*D-s*N-a*I)*Q,e[2]=(m*T-x*V+o*w)*Q,e[3]=(M*V-l*T-h*w)*Q,e[4]=(y*f-i*N-L*B)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(x*g-d*T-o*R)*Q,e[7]=(k*T-M*g+h*R)*Q,e[8]=(i*D-c*f+L*A)*Q,e[9]=(s*f-n*D-a*A)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=(l*g-k*V-h*z)*Q,e[12]=(c*B-i*I-y*A)*Q,e[13]=(n*I-s*B+r*A)*Q,e[14]=(m*R-d*w-x*z)*Q,e[15]=(k*w-l*R+M*z)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x;return e[0]=c*N-y*D+L*I,e[1]=r*D-s*N-a*I,e[2]=m*T-x*V+o*w,e[3]=M*V-l*T-h*w,e[4]=y*f-i*N-L*B,e[5]=n*N-r*f+a*B,e[6]=x*g-d*T-o*R,e[7]=k*T-M*g+h*R,e[8]=i*D-c*f+L*A,e[9]=s*f-n*D-a*A,e[10]=d*V-m*g+o*z,e[11]=l*g-k*V-h*z,e[12]=c*B-i*I-y*A,e[13]=n*I-s*B+r*A,e[14]=m*R-d*w-x*z,e[15]=k*w-l*R+M*z,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],x=e[15],o=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,B=L*R-k*z+l*o,f=h*R-d*z+m*o;return y*T-r*A+x*B-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],x=t[13],o=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*x,e[2]=R*a+g*L+w*h+V*o,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*x,e[6]=R*a+g*L+w*h+V*o,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*x,e[10]=R*a+g*L+w*h+V*o,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*x,e[14]=R*a+g*L+w*h+V*o,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],x=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=x,e[11]=o,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+x*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,B=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,D=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*B,e[1]=M*T+x*A+g*B,e[2]=h*T+o*A+w*B,e[3]=d*T+z*A+V*B,e[4]=l*f+m*I+R*D,e[5]=M*f+x*I+g*D,e[6]=h*f+o*I+w*D,e[7]=d*f+z*I+V*D,e[8]=l*N+m*Q+R*Y,e[9]=M*N+x*Q+g*Y,e[10]=h*N+o*Q+w*Y,e[11]=d*N+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,x=i*c,o=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-o,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+x,e[7]=0,e[8]=M+o,e[9]=d-x,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=0,e[4]=(r*D-s*N-a*I)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(s*f-n*D-a*A)*Q,e[7]=0,e[8]=(m*T-x*V+o*w)*Q,e[9]=(x*g-d*T-o*R)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],x=r*h,o=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,B=x+g+A,f=0;return B>0?(f=Math.sqrt(B+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(o-R)/f):x>g&&x>A?(f=Math.sqrt(1+x-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(o+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-x-A)*2,e[3]=(V-z)/f,e[0]=(o+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-x-g)*2,e[3]=(o-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,x=i*k,o=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+x))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+x))*w,e[6]=(m+o)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-o)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,x=i*l,o=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],B=r[1],f=r[2],I=(1-(m+o))*w,D=(h+g)*w,N=(d-R)*w,Q=(h-g)*V,Y=(1-(M+o))*V,X=(x+z)*V,C=(d+R)*T,H=(x-z)*T,$=(1-(M+m))*T;return e[0]=I,e[1]=D,e[2]=N,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+A-(I*A+Q*B+C*f),e[13]=n[1]+B-(D*A+Y*B+H*f),e[14]=n[2]+f-(N*A+X*B+$*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[1]=k+o,e[2]=M-x,e[3]=0,e[4]=k-o,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+x,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,x=1/Math.sqrt(h*h+d*d+m*m);h*=x,d*=x,m*=x;let o=y*m-L*d,z=L*h-c*m,R=c*d-y*h;x=Math.sqrt(o*o+z*z+R*R),x?(x=1/x,o*=x,z*=x,R*=x):(o=0,z=0,R=0);let g=d*R-m*z,w=m*o-h*R,V=h*z-d*o;return x=Math.sqrt(g*g+w*w+V*V),x?(x=1/x,g*=x,w*=x,V*=x):(g=0,w=0,V=0),e[0]=o,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(o*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,x=c*l-y*k;return h=d*d+m*m+x*x,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,x*=h),e[0]=d,e[1]=m,e[2]=x,e[3]=0,e[4]=l*x-M*m,e[5]=M*d-k*x,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],x=e[14],o=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],B=t[7],f=t[8],I=t[9],D=t[10],N=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-B)<=1e-6*Math.max(1,Math.abs(L),Math.abs(B))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(M-D)<=1e-6*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(h-N)<=1e-6*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(x-X)<=1e-6*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(o-C)<=1e-6*Math.max(1,Math.abs(o),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var F=class b extends Float64Array{static#t="zyx";static#e=new Float64Array(4);static#r=new Float64Array(4);static#n=new Float64Array(9);static#s=new Float64Array(3);static#a=new Float64Array([1,0,0]);static#i=new Float64Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),x=Math.sin(m);M=Math.sin((1-s)*m)/x,h=Math.sin(s*m)/x}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};F.set=E.set;F.add=E.add;F.lerp=E.lerp;F.normalize=E.normalize;F.squaredLength=E.squaredLength;F.sqrLen=E.squaredLength;F.exactEquals=E.exactEquals;F.equals=E.equals;F.magnitude=E.magnitude;F.prototype.mul=F.prototype.multiply;F.mul=F.multiply;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var O=class b extends Float64Array{static#t=new Float64Array(4);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],x=t[6],o=t[7];return e[4]=d*L+o*i+m*y-x*c,e[5]=m*L+o*c+x*i-d*y,e[6]=x*L+o*y+d*c-m*i,e[7]=o*L-d*i-m*c-x*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],x=n[1],o=n[2],z=n[3];return e[0]=s*z+i*m+r*o-a*x,e[1]=r*z+i*x+a*m-s*o,e[2]=a*z+i*o+s*x-r*m,e[3]=i*z-s*m-r*x-a*o,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*o-h*x,e[5]=r*k+i*y+a*c-s*L+M*z+d*x+h*m-l*o,e[6]=a*k+i*L+s*y-r*c+h*z+d*o+l*x-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*x-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],x=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};O.dot=F.dot;O.squaredLength=F.squaredLength;O.sqrLen=F.squaredLength;O.mag=F.magnitude;O.length=F.magnitude;O.len=F.magnitude;O.mul=O.multiply;var S=class b extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};S.prototype.sub=S.prototype.subtract;S.prototype.mul=S.prototype.multiply;S.prototype.div=S.prototype.divide;S.prototype.dist=S.prototype.distance;S.prototype.sqrDist=S.prototype.squaredDistance;S.sub=S.subtract;S.mul=S.multiply;S.div=S.divide;S.dist=S.distance;S.sqrDist=S.squaredDistance;S.sqrLen=S.squaredLength;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var W=!1;function ge(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new S(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of b){let a=s(r);Object.defineProperty(S.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function ze(b){return b*J}function we(b){return b*U}export{ge as EnableSwizzlesF64,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,F as Quat,O as Quat2,S as Vec2,q as Vec3,E as Vec4,ze as toDegree,we as toRadian}; +//# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f64.min.js.map b/dist-cdn/esm/2022/gl-matrix-f64.min.js.map new file mode 100644 index 00000000..5c513f07 --- /dev/null +++ b/dist-cdn/esm/2022/gl-matrix-f64.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";AAOO,IAAMA,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,C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F,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", + "names": ["Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] +} diff --git a/dist-cdn/types/gl-matrix-f32.d.mts b/dist-cdn/types/gl-matrix-f32.d.mts new file mode 100644 index 00000000..3f6ed78e --- /dev/null +++ b/dist-cdn/types/gl-matrix-f32.d.mts @@ -0,0 +1,9891 @@ +/** + * Provides an all-inclusive ESM distribution of `gl-matrix` (32-bit). All library classes extends `Float32Array`. + * + * @packageDocumentation + */ + +/** + * Provides all common type declarations shared across `gl-matrix`. + * + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import type { Vec3Like } from 'gl-matrix/types'; + * + * const vec: Vec3Like = new Vec3(0, 1, 2); + * ``` + * + * For JSDoc using the new Typescript 5.5 `@import` tag: + * ```js + * /** + * * @import { Vec3Like } from 'gl-matrix/types' + * *\/ + * ``` + * + * For JSDoc using the older `import types` Typescript mechanism: + * ```js + * /** + * * @type {import('gl-matrix/types').Vec3Like} + * *\/ + * ``` + * + * @packageDocumentation + */ +/** + * The floating-point typed arrays that can be used in place of a vector, matrix, or quaternion. + */ +type FloatArray = Float32Array | Float64Array; +/** + * A 2x2 Matrix given as a {@link Mat2}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Mat2Like = [number, number, number, number] | FloatArray; +/** + * A 2x3 Matrix given as a {@link Mat2d}, a 6-element floating-point TypedArray, or an array of 6 numbers. + */ +type Mat2dLike = [number, number, number, number, number, number] | FloatArray; +/** + * A 3x3 Matrix given as a {@link Mat3}, a 9-element floating-point TypedArray, or an array of 9 numbers. + */ +type Mat3Like = [number, number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 4x4 Matrix given as a {@link Mat4}, a 16-element floating-point TypedArray, or an array of 16 numbers. + */ +type Mat4Like = + | [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + ] + | FloatArray; +/** + * A Quaternion given as a {@link Quat}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type QuatLike = Vec4Like; +/** + * A Dual Quaternion given as a {@link Quat2}, an 8-element floating-point TypedArray, or an array of 8 numbers. + */ +type Quat2Like = [number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 2-dimensional vector given as a {@link Vec2}, a 2-element floating-point TypedArray, or an array of 2 numbers. + */ +type Vec2Like = [number, number] | FloatArray; +/** + * A 3-dimensional vector given as a {@link Vec3}, a 3-element floating-point TypedArray, or an array of 3 numbers. + */ +type Vec3Like = [number, number, number] | FloatArray; +/** + * A 4-dimensional vector given as a {@link Vec4}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Vec4Like = [number, number, number, number] | FloatArray; + +/** + * A 2x2 Matrix + */ +declare class Mat2 extends Float32Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity(): this; + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose(): this; + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert(): this; + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create(): Mat2; + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a: Readonly): Mat2; + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values: number[]): Mat2; + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2Like, ...values: number[]): Mat2Like; + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2Like): Mat2Like; + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null; + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like; + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like; + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like; + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2Like, rad: number): Mat2Like; + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2Like, v: Readonly): Mat2Like; + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like; + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like; + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU( + L: Mat2Like, + D: Readonly, + U: Mat2Like, + a: Readonly, + ): (Readonly | Readonly | readonly [number, number, number, number])[]; + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 2x3 Matrix + */ +declare class Mat2d extends Float32Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create(): Mat2d; + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a: Readonly): Mat2d; + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2dLike, a: Readonly): Mat2dLike; + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values: number[]): Mat2d; + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2dLike, ...values: number[]): Mat2dLike; + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2dLike): Mat2dLike; + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null; + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike; + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2dLike, rad: number): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike; + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike; + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 3x3 Matrix + */ +declare class Mat3 extends Float32Array { + #private; + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create(): Mat3; + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a: Readonly): Mat3; + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values: number[]): Mat3; + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat3Like, ...values: number[]): Mat3Like; + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat3Like): Mat3Like; + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null; + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like; + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like; + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat3Like, rad: number): Mat3Like; + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat3Like, q: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null; + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out: Mat3Like, width: number, height: number): Mat3Like; + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like; + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like; + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 4x4 Matrix + */ +declare class Mat4 extends Float32Array { + #private; + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad: number, axis: Readonly): this; + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create(): Mat4; + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a: Readonly): Mat4; + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values: number[]): Mat4; + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat4Like, ...values: number[]): Mat4Like; + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out: Mat4Like): Mat4Like; + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null; + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like; + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null; + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null; + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like; + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out: QuatLike, mat: Readonly): QuatLike; + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + ): Mat4Like; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + o: Readonly, + ): Mat4Like; + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat4Like, q: Readonly): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out: Mat4Like, fov: any, near: number, far: number): Mat4Like; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like; + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like; + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like; + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like; + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * Quaternion + */ +declare class Quat extends Float32Array { + #private; + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w(): number; + set w(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale: number): QuatLike; + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b: Readonly): number; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create(): Quat; + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike; + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis: Vec3Like, q: Readonly): number; + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a: Readonly, b: Readonly): number; + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out: QuatLike, a: Readonly, b: number): QuatLike; + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out: QuatLike, a: Readonly): QuatLike; + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out: QuatLike, m: Readonly): QuatLike; + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out: QuatLike, x: number, y: number, z: number, order?: string): QuatLike; + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a: Readonly): Quat; + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x: number, y: number, z: number, w: number): Quat; + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike; + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out: QuatLike, a: Readonly, scale: number): QuatLike; + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out: QuatLike, a: Readonly): QuatLike; + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp( + out: QuatLike, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): QuatLike; + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike; +} + +/** + * Dual Quaternion + */ +declare class Quat2 extends Float32Array { + #private; + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create(): Quat2; + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a: Quat2Like): Quat2; + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2; + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + ): Quat2; + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out: Quat2Like, q: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set( + out: Quat2Like, + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2Like; + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out: QuatLike, a: Readonly): QuatLike; + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like; + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like; + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like; + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 2 Dimensional Vector + */ +declare class Vec2 extends Float32Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create(): Vec2; + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a: Readonly): Vec2; + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x: number, y: number): Vec2; + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out: Vec2Like, x: number, y: number): Vec2Like; + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like; + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like; + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like; + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out: Vec2Like): Vec2Like; + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a: Readonly): string; +} + +/** + * 3 Dimensional Vector + */ +declare class Vec3 extends Float32Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create(): Vec3; + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a: Readonly): Vec3; + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a: Readonly): number; + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x: number, y: number, z: number): Vec3; + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like; + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like; + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number): Vec3Like; + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like; + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like; + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like; + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec3Like): Vec3Like; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 4 Dimensional Vector + */ +declare class Vec4 extends Float32Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w(): number; + set w(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a(): number; + set a(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create(): Vec4; + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a: Vec4Like): Vec4; + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x: number, y: number, z: number, w: number): Vec4; + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like; + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like; + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like; + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like; + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like; + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec4Like): Vec4Like; + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from + * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please + * see {@link gl-matrix/types/swizzle}. + * + * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}. + * + * @example + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import { EnableSwizzles } from 'gl-matrix/swizzle'; + * + * EnableSwizzles(); + * + * const vec = new Vec3(0, 1, 2); + * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). + * ``` + * + * @packageDocumentation + */ +/** + * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / + * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit). + * + * Swizzle operations are performed by using the `.` operator in conjunction with any combination + * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed). + * They return a new vector with the same number of components as specified in the swizzle attribute. + * + * @example + * ```js + * import { Vec3, EnableSwizzles } from 'gl-matrix'; + * + * EnableSwizzles(); + * + * let v = new Vec3(0, 1, 2); + * + * v.yx; // returns new Vec2(1, 0) + * v.xzy; // returns new Vec3(0, 2, 1) + * v.zyxz; // returns new Vec4(2, 1, 0, 2) + * + * v.rgb; // returns new Vec3(0, 1, 2) + * v.rbg; // returns new Vec3(0, 2, 1) + * v.gg; // returns new Vec2(1, 1) + * ``` + */ +declare function EnableSwizzles(): void; + +/** + * Ambient module declarations for `gl-matrix` (32-bit) swizzle extensions for vector classes. + * + * When swizzle accessors via {@link gl-matrix/swizzle.EnableSwizzles | EnableSwizzles} are enabled include this + * sub-path export as a `side effect` import to add ambient module declarations for the additional accessors to + * {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / {@link gl-matrix.Vec4 | Vec4} + * + * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}. + * + * ```js + * import { Vec2 } from 'gl-matrix'; + * import { EnableSwizzles } from 'gl-matrix/swizzle'; + * + * import 'gl-matrix/types/swizzle'; + * + * EnableSwizzles(); + * + * const vec = new Vec2(0, 1); + * + * // Swizzled instance - returns new Vec2(1, 0). + * const vecSwizzled = vec.yx; + * ``` + * + * @packageDocumentation + */ + +/** + * A type alias for Vec2 (32-bit). + * @hidden + */ +type Vec2Alias = Vec2; +/** + * A type alias for Vec3 (32-bit). + * @hidden + */ +type Vec3Alias = Vec3; +/** + * A type alias for Vec4 (32-bit). + * @hidden + */ +type Vec4Alias = Vec4; +declare module '#gl-matrix' { + /** + * Vec2 swizzle extension accessors. + */ + interface Vec2 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + } + /** + * Vec3 swizzle extension accessors. + */ + interface Vec3 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + } + /** + * Vec4 swizzle extension accessors. + */ + interface Vec4 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ww(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get www(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ra(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ga(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ba(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ar(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ag(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ab(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get aa(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get raa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get baa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ara(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rraa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get graa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get braa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get araa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaaa(): Vec4Alias; + } +} + +/** + * Convert `radians` to `degrees`. + * + * @param value - Angle in `radians`. + * @returns Angle in `degrees`. + */ +declare function toDegree(value: number): number; +/** + * Convert `degrees` to `radians`. + * + * @param value - Angle in `degrees`. + * @returns Angle in `radians`. + */ +declare function toRadian(value: number): number; + +export { + EnableSwizzles, + type FloatArray, + Mat2, + type Mat2Like, + Mat2d, + type Mat2dLike, + Mat3, + type Mat3Like, + Mat4, + type Mat4Like, + Quat, + Quat2, + type Quat2Like, + type QuatLike, + Vec2, + type Vec2Like, + Vec3, + type Vec3Like, + Vec4, + type Vec4Like, + Mat2 as mat2, + Mat2d as mat2d, + Mat3 as mat3, + Mat4 as mat4, + Quat as quat, + Quat2 as quat2, + toDegree, + toRadian, + Vec2 as vec2, + Vec3 as vec3, + Vec4 as vec4, +}; diff --git a/dist-cdn/types/gl-matrix-f64.d.mts b/dist-cdn/types/gl-matrix-f64.d.mts new file mode 100644 index 00000000..27de74d7 --- /dev/null +++ b/dist-cdn/types/gl-matrix-f64.d.mts @@ -0,0 +1,9883 @@ +/** + * Provides an all-inclusive ESM distribution of `gl-matrix` (64-bit). All library classes extends `Float64Array`. + * + * @packageDocumentation + */ + +/** + * Provides all common type declarations shared across `gl-matrix`. + * + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import type { Vec3Like } from 'gl-matrix/types'; + * + * const vec: Vec3Like = new Vec3(0, 1, 2); + * ``` + * + * For JSDoc using the new Typescript 5.5 `@import` tag: + * ```js + * /** + * * @import { Vec3Like } from 'gl-matrix/types' + * *\/ + * ``` + * + * For JSDoc using the older `import types` Typescript mechanism: + * ```js + * /** + * * @type {import('gl-matrix/types').Vec3Like} + * *\/ + * ``` + * + * @packageDocumentation + */ +/** + * The floating-point typed arrays that can be used in place of a vector, matrix, or quaternion. + */ +type FloatArray = Float32Array | Float64Array; +/** + * A 2x2 Matrix given as a {@link Mat2}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Mat2Like = [number, number, number, number] | FloatArray; +/** + * A 2x3 Matrix given as a {@link Mat2d}, a 6-element floating-point TypedArray, or an array of 6 numbers. + */ +type Mat2dLike = [number, number, number, number, number, number] | FloatArray; +/** + * A 3x3 Matrix given as a {@link Mat3}, a 9-element floating-point TypedArray, or an array of 9 numbers. + */ +type Mat3Like = [number, number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 4x4 Matrix given as a {@link Mat4}, a 16-element floating-point TypedArray, or an array of 16 numbers. + */ +type Mat4Like = + | [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + ] + | FloatArray; +/** + * A Quaternion given as a {@link Quat}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type QuatLike = Vec4Like; +/** + * A Dual Quaternion given as a {@link Quat2}, an 8-element floating-point TypedArray, or an array of 8 numbers. + */ +type Quat2Like = [number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 2-dimensional vector given as a {@link Vec2}, a 2-element floating-point TypedArray, or an array of 2 numbers. + */ +type Vec2Like = [number, number] | FloatArray; +/** + * A 3-dimensional vector given as a {@link Vec3}, a 3-element floating-point TypedArray, or an array of 3 numbers. + */ +type Vec3Like = [number, number, number] | FloatArray; +/** + * A 4-dimensional vector given as a {@link Vec4}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Vec4Like = [number, number, number, number] | FloatArray; + +/** + * A 2x2 Matrix + */ +declare class Mat2 extends Float64Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity(): this; + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose(): this; + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert(): this; + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create(): Mat2; + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a: Readonly): Mat2; + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values: number[]): Mat2; + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2Like, ...values: number[]): Mat2Like; + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2Like): Mat2Like; + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null; + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like; + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like; + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like; + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2Like, rad: number): Mat2Like; + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2Like, v: Readonly): Mat2Like; + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like; + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like; + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU( + L: Mat2Like, + D: Readonly, + U: Mat2Like, + a: Readonly, + ): (Readonly | Readonly | readonly [number, number, number, number])[]; + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 2x3 Matrix + */ +declare class Mat2d extends Float64Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create(): Mat2d; + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a: Readonly): Mat2d; + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2dLike, a: Readonly): Mat2dLike; + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values: number[]): Mat2d; + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2dLike, ...values: number[]): Mat2dLike; + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2dLike): Mat2dLike; + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null; + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike; + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2dLike, rad: number): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike; + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike; + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 3x3 Matrix + */ +declare class Mat3 extends Float64Array { + #private; + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create(): Mat3; + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a: Readonly): Mat3; + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values: number[]): Mat3; + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat3Like, ...values: number[]): Mat3Like; + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat3Like): Mat3Like; + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null; + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like; + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like; + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat3Like, rad: number): Mat3Like; + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat3Like, q: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null; + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out: Mat3Like, width: number, height: number): Mat3Like; + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like; + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like; + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 4x4 Matrix + */ +declare class Mat4 extends Float64Array { + #private; + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad: number, axis: Readonly): this; + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create(): Mat4; + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a: Readonly): Mat4; + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values: number[]): Mat4; + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat4Like, ...values: number[]): Mat4Like; + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out: Mat4Like): Mat4Like; + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null; + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like; + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null; + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null; + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like; + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out: QuatLike, mat: Readonly): QuatLike; + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + ): Mat4Like; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + o: Readonly, + ): Mat4Like; + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat4Like, q: Readonly): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out: Mat4Like, fov: any, near: number, far: number): Mat4Like; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like; + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like; + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like; + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like; + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * Quaternion + */ +declare class Quat extends Float64Array { + #private; + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w(): number; + set w(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale: number): QuatLike; + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b: Readonly): number; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create(): Quat; + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike; + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis: Vec3Like, q: Readonly): number; + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a: Readonly, b: Readonly): number; + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out: QuatLike, a: Readonly, b: number): QuatLike; + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out: QuatLike, a: Readonly): QuatLike; + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out: QuatLike, m: Readonly): QuatLike; + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out: QuatLike, x: number, y: number, z: number, order?: string): QuatLike; + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a: Readonly): Quat; + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x: number, y: number, z: number, w: number): Quat; + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike; + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out: QuatLike, a: Readonly, scale: number): QuatLike; + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out: QuatLike, a: Readonly): QuatLike; + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp( + out: QuatLike, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): QuatLike; + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike; +} + +/** + * Dual Quaternion + */ +declare class Quat2 extends Float64Array { + #private; + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create(): Quat2; + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a: Quat2Like): Quat2; + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2; + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + ): Quat2; + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out: Quat2Like, q: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set( + out: Quat2Like, + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2Like; + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out: QuatLike, a: Readonly): QuatLike; + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like; + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like; + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like; + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 2 Dimensional Vector + */ +declare class Vec2 extends Float64Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create(): Vec2; + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a: Readonly): Vec2; + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x: number, y: number): Vec2; + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out: Vec2Like, x: number, y: number): Vec2Like; + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like; + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like; + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like; + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out: Vec2Like): Vec2Like; + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a: Readonly): string; +} + +/** + * 3 Dimensional Vector + */ +declare class Vec3 extends Float64Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create(): Vec3; + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a: Readonly): Vec3; + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a: Readonly): number; + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x: number, y: number, z: number): Vec3; + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like; + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like; + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number): Vec3Like; + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like; + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like; + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like; + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec3Like): Vec3Like; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 4 Dimensional Vector + */ +declare class Vec4 extends Float64Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w(): number; + set w(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a(): number; + set a(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create(): Vec4; + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a: Vec4Like): Vec4; + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x: number, y: number, z: number, w: number): Vec4; + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like; + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like; + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like; + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like; + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like; + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec4Like): Vec4Like; + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from + * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support + * please see {@link gl-matrix/types/swizzle/f64}. + * + * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}. + * + * @example + * ```ts + * import { Vec3 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * const vec = new Vec3(0, 1, 2); + * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). + * ``` + * + * @packageDocumentation + */ +/** + * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / + * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit). + * + * Swizzle operations are performed by using the `.` operator in conjunction with any combination + * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed). + * They return a new vector with the same number of components as specified in the swizzle attribute. + * + * @example + * ```js + * import { Vec3 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * let v = new Vec3(0, 1, 2); + * + * v.yx; // returns new Vec2(1, 0) + * v.xzy; // returns new Vec3(0, 2, 1) + * v.zyxz; // returns new Vec4(2, 1, 0, 2) + * + * v.rgb; // returns new Vec3(0, 1, 2) + * v.rbg; // returns new Vec3(0, 2, 1) + * v.gg; // returns new Vec2(1, 1) + * ``` + */ +declare function EnableSwizzlesF64(): void; + +/** + * Ambient module declarations for `gl-matrix/f64` (64-bit) swizzle extensions for vector classes. + * + * When swizzle accessors via {@link gl-matrix/swizzle/f64.EnableSwizzlesF64 | EnableSwizzlesF64} are enabled include + * this sub-path export as a `side effect` import to add ambient module declarations for the additional accessors to + * {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / {@link gl-matrix/f64.Vec4 | Vec4}. + * + * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}. + * + * ```js + * import { Vec2 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * import 'gl-matrix/types/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * const vec = new Vec2(0, 1); + * + * // Swizzled instance - returns new Vec2(1, 0). + * const vecSwizzled = vec.yx; + * ``` + * + * @packageDocumentation + */ + +/** + * A type alias for Vec2 (64-bit). + * @hidden + */ +type Vec2Alias = Vec2; +/** + * A type alias for Vec3 (64-bit). + * @hidden + */ +type Vec3Alias = Vec3; +/** + * A type alias for Vec4 (64-bit). + * @hidden + */ +type Vec4Alias = Vec4; +declare module '#gl-matrix/f64' { + /** + * Vec2 swizzle extension accessors. + */ + interface Vec2 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + } + /** + * Vec3 swizzle extension accessors. + */ + interface Vec3 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + } + /** + * Vec4 swizzle extension accessors. + */ + interface Vec4 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ww(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get www(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ra(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ga(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ba(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ar(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ag(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ab(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get aa(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get raa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get baa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ara(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rraa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get graa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get braa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get araa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaaa(): Vec4Alias; + } +} + +/** + * Convert `radians` to `degrees`. + * + * @param value - Angle in `radians`. + * @returns Angle in `degrees`. + */ +declare function toDegree(value: number): number; +/** + * Convert `degrees` to `radians`. + * + * @param value - Angle in `degrees`. + * @returns Angle in `radians`. + */ +declare function toRadian(value: number): number; + +export { + EnableSwizzlesF64, + type FloatArray, + Mat2, + type Mat2Like, + Mat2d, + type Mat2dLike, + Mat3, + type Mat3Like, + Mat4, + type Mat4Like, + Quat, + Quat2, + type Quat2Like, + type QuatLike, + Vec2, + type Vec2Like, + Vec3, + type Vec3Like, + Vec4, + type Vec4Like, + toDegree, + toRadian, +}; diff --git a/dist-cdn/umd/gl-matrix-f32.cjs b/dist-cdn/umd/gl-matrix-f32.cjs new file mode 100644 index 00000000..4a3585ba --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f32.cjs @@ -0,0 +1,10679 @@ +[object Object] +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrix = {})); +})(this, (function (exports) { 'use strict'; + + function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; + } + function _callSuper(t, o, e) { + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); + } + function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); + } + function _construct(t, e, r) { + if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _setPrototypeOf(p, r.prototype), p; + } + function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); + } + } + function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; + } + function _get() { + return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = _superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, _get.apply(null, arguments); + } + function _getPrototypeOf(t) { + return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, _getPrototypeOf(t); + } + function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && _setPrototypeOf(t, e); + } + function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } + } + function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (_isNativeReflectConstruct = function () { + return !!t; + })(); + } + function _possibleConstructorReturn(t, e) { + if (e && ("object" == typeof e || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return _assertThisInitialized(t); + } + function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); + } + function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); + return t; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r ); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (String )(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return _wrapNativeSuper = function (t) { + if (null === t || !_isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return _construct(t, arguments, _getPrototypeOf(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), _setPrototypeOf(Wrapper, t); + }, _wrapNativeSuper(t); + } + + // glMatrix - v4.0.0-beta.3 + var __typeError = function __typeError(msg) { + throw TypeError(msg); + }; + var __accessCheck = function __accessCheck(obj, member, msg) { + return member.has(obj) || __typeError("Cannot " + msg); + }; + var __privateGet = function __privateGet(obj, member, getter) { + return __accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj); + }; + var __privateAdd = function __privateAdd(obj, member, value) { + return member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); + }; + + // src/common/index.ts + var GLM_EPSILON = 1e-6; + + // src/_lib/f32/Mat2.ts + var _IDENTITY_2X2; + var _Mat2 = /*#__PURE__*/function (_Float32Array) { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + function _Mat2() { + var _this; + _classCallCheck(this, _Mat2); + for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + switch (values.length) { + case 4: + _this = _callSuper(this, _Mat2, [values]); + break; + case 2: + _this = _callSuper(this, _Mat2, [values[0], values[1], 4]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this = _callSuper(this, _Mat2, [[v, v, v, v]]); + } else { + _this = _callSuper(this, _Mat2, [v, 0, 4]); + } + break; + default: + _this = _callSuper(this, _Mat2, [__privateGet(_Mat2, _IDENTITY_2X2)]); + break; + } + return _assertThisInitialized(_this); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + _inherits(_Mat2, _Float32Array); + return _createClass(_Mat2, [{ + key: "str", + get: function get() { + return _Mat2.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat2, _IDENTITY_2X2)); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + }, { + key: "transpose", + value: function transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + }, { + key: "invert", + value: function invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + }, { + key: "rotate", + value: function rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + }, { + key: "create", + value: function create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + values[_key2] = arguments[_key2]; + } + return _construct(_Mat2, values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "transpose", + value: function transpose(out, a) { + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "adjoint", + value: function adjoint(out, a) { + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, rad) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var v0 = v[0]; + var v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + }, { + key: "LDU", + value: function LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat2(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + _IDENTITY_2X2 = new WeakMap(); + __privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([1, 0, 0, 1])); + var Mat2 = _Mat2; + Mat2.prototype.mul = Mat2.prototype.multiply; + Mat2.mul = Mat2.multiply; + Mat2.sub = Mat2.subtract; + + // src/_lib/f32/Mat2d.ts + var _IDENTITY_2X3; + var _Mat2d = /*#__PURE__*/function (_Float32Array2) { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + function _Mat2d() { + var _this2; + _classCallCheck(this, _Mat2d); + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + values[_key3] = arguments[_key3]; + } + switch (values.length) { + case 6: + _this2 = _callSuper(this, _Mat2d, [values]); + break; + case 2: + _this2 = _callSuper(this, _Mat2d, [values[0], values[1], 6]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this2 = _callSuper(this, _Mat2d, [[v, v, v, v, v, v]]); + } else { + _this2 = _callSuper(this, _Mat2d, [v, 0, 6]); + } + break; + default: + _this2 = _callSuper(this, _Mat2d, [__privateGet(_Mat2d, _IDENTITY_2X3)]); + break; + } + return _assertThisInitialized(_this2); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + _inherits(_Mat2d, _Float32Array2); + return _createClass(_Mat2d, [{ + key: "str", + get: function get() { + return _Mat2d.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat2d, _IDENTITY_2X3)); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + }, { + key: "translate", + value: function translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotate", + value: function rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat2d.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 6 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + }, { + key: "create", + value: function create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len4 = arguments.length, values = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + values[_key4] = arguments[_key4]; + } + return _construct(_Mat2d, values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + out[4] = arguments.length <= 5 ? undefined : arguments[5]; + out[5] = arguments.length <= 6 ? undefined : arguments[6]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var aa = a[0]; + var ab = a[1]; + var ac = a[2]; + var ad = a[3]; + var atx = a[4]; + var aty = a[5]; + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var v0 = v[0]; + var v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, rad) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var v0 = v[0]; + var v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat2d(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + _IDENTITY_2X3 = new WeakMap(); + __privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([1, 0, 0, 1, 0, 0])); + var Mat2d = _Mat2d; + Mat2d.mul = Mat2d.multiply; + Mat2d.sub = Mat2d.subtract; + + // src/_lib/f32/Mat3.ts + var _IDENTITY_3X3; + var _Mat3 = /*#__PURE__*/function (_Float32Array3) { + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + function _Mat3() { + var _this3; + _classCallCheck(this, _Mat3); + for (var _len5 = arguments.length, values = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + values[_key5] = arguments[_key5]; + } + switch (values.length) { + case 9: + _this3 = _callSuper(this, _Mat3, [values]); + break; + case 2: + _this3 = _callSuper(this, _Mat3, [values[0], values[1], 9]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this3 = _callSuper(this, _Mat3, [[v, v, v, v, v, v, v, v, v]]); + } else { + _this3 = _callSuper(this, _Mat3, [v, 0, 9]); + } + break; + default: + _this3 = _callSuper(this, _Mat3, [__privateGet(_Mat3, _IDENTITY_3X3)]); + break; + } + return _assertThisInitialized(_this3); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + _inherits(_Mat3, _Float32Array3); + return _createClass(_Mat3, [{ + key: "str", + get: function get() { + return _Mat3.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat3, _IDENTITY_3X3)); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "transpose", + value: function transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + }, { + key: "translate", + value: function translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotate", + value: function rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat3.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 9 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + }, { + key: "create", + value: function create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len6 = arguments.length, values = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + values[_key6] = arguments[_key6]; + } + return _construct(_Mat3, values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + out[4] = arguments.length <= 5 ? undefined : arguments[5]; + out[5] = arguments.length <= 6 ? undefined : arguments[6]; + out[6] = arguments.length <= 7 ? undefined : arguments[7]; + out[7] = arguments.length <= 8 ? undefined : arguments[8]; + out[8] = arguments.length <= 9 ? undefined : arguments[9]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "transpose", + value: function transpose(out, a) { + if (out === a) { + var a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + var det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "adjoint", + value: function adjoint(out, a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + var x = v[0]; + var y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, rad) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var x = v[0]; + var y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + }, { + key: "fromMat2d", + value: function fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + }, { + key: "fromQuat", + value: function fromQuat(out, q) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + }, { + key: "fromMat4", + value: function fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "normalFromMat4", + value: function normalFromMat4(out, a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(out, a) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var bx = a[4]; + var by = a[5]; + var bz = a[6]; + var cx = a[8]; + var cy = a[9]; + var cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + }, { + key: "projection", + value: function projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var a6 = a[6]; + var a7 = a[7]; + var a8 = a[8]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + var b6 = b[6]; + var b7 = b[7]; + var b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat3(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + _IDENTITY_3X3 = new WeakMap(); + __privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); + var Mat3 = _Mat3; + Mat3.prototype.mul = Mat3.prototype.multiply; + Mat3.mul = Mat3.multiply; + Mat3.sub = Mat3.subtract; + + // src/_lib/f32/Mat4.ts + var _IDENTITY_4X4, _TMP_VEC3; + var _Mat4 = /*#__PURE__*/function (_Float32Array4) { + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + function _Mat4() { + var _this4; + _classCallCheck(this, _Mat4); + for (var _len7 = arguments.length, values = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + values[_key7] = arguments[_key7]; + } + switch (values.length) { + case 16: + _this4 = _callSuper(this, _Mat4, [values]); + break; + case 2: + _this4 = _callSuper(this, _Mat4, [values[0], values[1], 16]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this4 = _callSuper(this, _Mat4, [[v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v]]); + } else { + _this4 = _callSuper(this, _Mat4, [v, 0, 16]); + } + break; + default: + _this4 = _callSuper(this, _Mat4, [__privateGet(_Mat4, _IDENTITY_4X4)]); + break; + } + return _assertThisInitialized(_this4); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + _inherits(_Mat4, _Float32Array4); + return _createClass(_Mat4, [{ + key: "str", + get: function get() { + return _Mat4.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat4, _IDENTITY_4X4)); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "transpose", + value: function transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + }, { + key: "translate", + value: function translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + }, { + key: "rotate", + value: function rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotateX", + value: function rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotateY", + value: function rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotateZ", + value: function rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + }, { + key: "perspectiveNO", + value: function perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + }, { + key: "perspectiveZO", + value: function perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + }, { + key: "orthoNO", + value: function orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + }, { + key: "orthoZO", + value: function orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 16 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + }, { + key: "create", + value: function create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len8 = arguments.length, values = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + values[_key8] = arguments[_key8]; + } + return _construct(_Mat4, values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + out[4] = arguments.length <= 5 ? undefined : arguments[5]; + out[5] = arguments.length <= 6 ? undefined : arguments[6]; + out[6] = arguments.length <= 7 ? undefined : arguments[7]; + out[7] = arguments.length <= 8 ? undefined : arguments[8]; + out[8] = arguments.length <= 9 ? undefined : arguments[9]; + out[9] = arguments.length <= 10 ? undefined : arguments[10]; + out[10] = arguments.length <= 11 ? undefined : arguments[11]; + out[11] = arguments.length <= 12 ? undefined : arguments[12]; + out[12] = arguments.length <= 13 ? undefined : arguments[13]; + out[13] = arguments.length <= 14 ? undefined : arguments[14]; + out[14] = arguments.length <= 15 ? undefined : arguments[15]; + out[15] = arguments.length <= 16 ? undefined : arguments[16]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "transpose", + value: function transpose(out, a) { + if (out === a) { + var a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a12 = a[6], + a13 = a[7]; + var a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "adjoint", + value: function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b0 = a00 * a11 - a01 * a10; + var b1 = a00 * a12 - a02 * a10; + var b2 = a01 * a12 - a02 * a11; + var b3 = a20 * a31 - a21 * a30; + var b4 = a20 * a32 - a22 * a30; + var b5 = a21 * a32 - a22 * a31; + var b6 = a00 * b5 - a01 * b4 + a02 * b3; + var b7 = a10 * b5 - a11 * b4 + a12 * b3; + var b8 = a20 * b2 - a21 * b1 + a22 * b0; + var b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var x = v[0]; + var y = v[1]; + var z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var x = v[0]; + var y = v[1]; + var z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + }, { + key: "rotate", + value: function rotate(out, a, rad, axis) { + var x = axis[0]; + var y = axis[1]; + var z = axis[2]; + var len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad, axis) { + var x = axis[0]; + var y = axis[1]; + var z = axis[2]; + var len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromXRotation", + value: function fromXRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromYRotation", + value: function fromYRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromZRotation", + value: function fromZRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(out, q, v) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + }, { + key: "fromQuat2", + value: function fromQuat2(out, a) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3)); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "normalFromMat4", + value: function normalFromMat4(out, a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(out, a) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var bx = a[4]; + var by = a[5]; + var bz = a[6]; + var cx = a[8]; + var cy = a[9]; + var cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + }, { + key: "getTranslation", + value: function getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + }, { + key: "getScaling", + value: function getScaling(out, mat) { + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + }, { + key: "getRotation", + value: function getRotation(out, mat) { + _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat); + var is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0]; + var is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1]; + var is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2]; + var sm11 = mat[0] * is1; + var sm12 = mat[1] * is2; + var sm13 = mat[2] * is3; + var sm21 = mat[4] * is1; + var sm22 = mat[5] * is2; + var sm23 = mat[6] * is3; + var sm31 = mat[8] * is1; + var sm32 = mat[9] * is2; + var sm33 = mat[10] * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + }, { + key: "decompose", + value: function decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + var is1 = 1 / out_s[0]; + var is2 = 1 / out_s[1]; + var is3 = 1 / out_s[2]; + var sm11 = m11 * is1; + var sm12 = m12 * is2; + var sm13 = m13 * is3; + var sm21 = m21 * is1; + var sm22 = m22 * is2; + var sm23 = m23 * is3; + var sm31 = m31 * is1; + var sm32 = m32 * is2; + var sm33 = m33 * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + }, { + key: "fromRotationTranslationScale", + value: function fromRotationTranslationScale(out, q, v, s) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + }, { + key: "fromRotationTranslationScaleOrigin", + value: function fromRotationTranslationScaleOrigin(out, q, v, s, o) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + var ox = o[0]; + var oy = o[1]; + var oz = o[2]; + var out0 = (1 - (yy + zz)) * sx; + var out1 = (xy + wz) * sx; + var out2 = (xz - wy) * sx; + var out4 = (xy - wz) * sy; + var out5 = (1 - (xx + zz)) * sy; + var out6 = (yz + wx) * sy; + var out8 = (xz + wy) * sz; + var out9 = (yz - wx) * sz; + var out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + }, { + key: "fromQuat", + value: function fromQuat(out, q) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "frustumNO", + value: function frustumNO(out, left, right, bottom, top, near) { + var far = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : Infinity; + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + }, { + key: "frustum", + value: function frustum(out, left, right, bottom, top, near) { + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "frustumZO", + value: function frustumZO(out, left, right, bottom, top, near) { + var far = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : Infinity; + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "perspectiveNO", + value: function perspectiveNO(out, fovy, aspect, near) { + var far = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Infinity; + var f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + }, { + key: "perspective", + value: function perspective(out, fovy, aspect, near) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "perspectiveZO", + value: function perspectiveZO(out, fovy, aspect, near) { + var far = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Infinity; + var f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + }, { + key: "perspectiveFromFieldOfView", + value: function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI / 180); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + var xScale = 2 / (leftTan + rightTan); + var yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + }, { + key: "orthoNO", + value: function orthoNO(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + }, { + key: "ortho", + value: function ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + }, { + key: "orthoZO", + value: function orthoZO(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + }, { + key: "lookAt", + value: function lookAt(out, eye, center, up) { + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var centerx = center[0]; + var centery = center[1]; + var centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + }, { + key: "targetTo", + value: function targetTo(out, eye, target, up) { + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var z0 = eyex - target[0]; + var z1 = eyey - target[1]; + var z2 = eyez - target[2]; + var len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var a6 = a[6]; + var a7 = a[7]; + var a8 = a[8]; + var a9 = a[9]; + var a10 = a[10]; + var a11 = a[11]; + var a12 = a[12]; + var a13 = a[13]; + var a14 = a[14]; + var a15 = a[15]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + var b6 = b[6]; + var b7 = b[7]; + var b8 = b[8]; + var b9 = b[9]; + var b10 = b[10]; + var b11 = b[11]; + var b12 = b[12]; + var b13 = b[13]; + var b14 = b[14]; + var b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat4(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + _IDENTITY_4X4 = new WeakMap(); + _TMP_VEC3 = new WeakMap(); + __privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])); + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + __privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3)); + var Mat4 = _Mat4; + Mat4.prototype.mul = Mat4.prototype.multiply; + Mat4.sub = Mat4.subtract; + Mat4.mul = Mat4.multiply; + Mat4.frustum = Mat4.frustumNO; + Mat4.perspective = Mat4.perspectiveNO; + Mat4.ortho = Mat4.orthoNO; + + // src/_lib/f32/Vec3.ts + var Vec3 = /*#__PURE__*/function (_Float32Array5) { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + function _Vec3() { + var _this5; + _classCallCheck(this, _Vec3); + for (var _len9 = arguments.length, values = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { + values[_key9] = arguments[_key9]; + } + switch (values.length) { + case 3: + _this5 = _callSuper(this, _Vec3, [values]); + break; + case 2: + _this5 = _callSuper(this, _Vec3, [values[0], values[1], 3]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this5 = _callSuper(this, _Vec3, [[v, v, v]]); + } else { + _this5 = _callSuper(this, _Vec3, [v, 0, 3]); + } + break; + } + default: + _this5 = _callSuper(this, _Vec3, [3]); + break; + } + return _assertThisInitialized(_this5); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + _inherits(_Vec3, _Float32Array5); + return _createClass(_Vec3, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + }, { + key: "squaredMagnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Vec3.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + }, { + key: "add", + value: function add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + }, { + key: "subtract", + value: function subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + }, { + key: "sub", + value: function sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + }, { + key: "divide", + value: function divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + }, { + key: "div", + value: function div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + }, { + key: "distance", + value: function distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + }, { + key: "dist", + value: function dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + }, { + key: "sqrDist", + value: function sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "negate", + value: function negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "abs", + value: function abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + }, { + key: "dot", + value: function dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "normalize", + value: function normalize() { + return _Vec3.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 3 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + }, { + key: "create", + value: function create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + }, { + key: "clone", + value: function clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + }, { + key: "magnitude", + value: function magnitude(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + }, { + key: "fromValues", + value: function fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "divide", + value: function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + }, { + key: "div", + value: function div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + }, { + key: "ceil", + value: function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + }, { + key: "floor", + value: function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "min", + value: function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "max", + value: function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, _scale) { + out[0] = a[0] * _scale; + out[1] = a[1] * _scale; + out[2] = a[2] * _scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + }, { + key: "distance", + value: function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + }, { + key: "dist", + value: function dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + }, { + key: "squaredDistance", + value: function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + }, { + key: "sqrDist", + value: function sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + }, { + key: "negate", + value: function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + }, { + key: "inverse", + value: function inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + }, { + key: "abs", + value: function abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "cross", + value: function cross(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2]; + var bx = b[0], + by = b[1], + bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "slerp", + value: function slerp(out, a, b, t) { + var angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + var sinTotal = Math.sin(angle); + var ratioA = Math.sin((1 - t) * angle) / sinTotal; + var ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "hermite", + value: function hermite(out, a, b, c, d, t) { + var factorTimes2 = t * t; + var factor1 = factorTimes2 * (2 * t - 3) + 1; + var factor2 = factorTimes2 * (t - 2) + t; + var factor3 = factorTimes2 * (t - 1); + var factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "bezier", + value: function bezier(out, a, b, c, d, t) { + var inverseFactor = 1 - t; + var inverseFactorTimesTwo = inverseFactor * inverseFactor; + var factorTimes2 = t * t; + var factor1 = inverseFactorTimesTwo * inverseFactor; + var factor2 = 3 * t * inverseFactorTimesTwo; + var factor3 = 3 * factorTimes2 * inverseFactor; + var factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + }, { + key: "transformMat4", + value: function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + var w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + }, { + key: "transformMat3", + value: function transformMat3(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + }, { + key: "transformQuat", + value: function transformQuat(out, a, q) { + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var w2 = q[3] * 2; + var x = a[0]; + var y = a[1]; + var z = a[2]; + var uvx = qy * z - qz * y; + var uvy = qz * x - qx * z; + var uvz = qx * y - qy * x; + var uuvx = (qy * uvz - qz * uvy) * 2; + var uuvy = (qz * uvx - qx * uvz) * 2; + var uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, b, rad) { + var by = b[1]; + var bz = b[2]; + var py = a[1] - by; + var pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, b, rad) { + var bx = b[0]; + var bz = b[2]; + var px = a[0] - bx; + var pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, b, rad) { + var bx = b[0]; + var by = b[1]; + var px = a[0] - bx; + var py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + }, { + key: "angle", + value: function angle(a, b) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var bx = b[0]; + var by = b[1]; + var bz = b[2]; + var mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + var cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + }, { + key: "zero", + value: function zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Vec3(".concat(a.join(", "), ")"); + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + Vec3.prototype.sub = Vec3.prototype.subtract; + Vec3.prototype.mul = Vec3.prototype.multiply; + Vec3.prototype.div = Vec3.prototype.divide; + Vec3.prototype.dist = Vec3.prototype.distance; + Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; + Vec3.sub = Vec3.subtract; + Vec3.mul = Vec3.multiply; + Vec3.div = Vec3.divide; + Vec3.dist = Vec3.distance; + Vec3.sqrDist = Vec3.squaredDistance; + Vec3.sqrLen = Vec3.squaredLength; + Vec3.mag = Vec3.magnitude; + Vec3.length = Vec3.magnitude; + Vec3.len = Vec3.magnitude; + + // src/_lib/f32/Vec4.ts + var Vec4 = /*#__PURE__*/function (_Float32Array6) { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + function _Vec4() { + var _this6; + _classCallCheck(this, _Vec4); + for (var _len10 = arguments.length, values = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { + values[_key10] = arguments[_key10]; + } + switch (values.length) { + case 4: + _this6 = _callSuper(this, _Vec4, [values]); + break; + case 2: + _this6 = _callSuper(this, _Vec4, [values[0], values[1], 4]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this6 = _callSuper(this, _Vec4, [[v, v, v, v]]); + } else { + _this6 = _callSuper(this, _Vec4, [v, 0, 4]); + } + break; + } + default: + _this6 = _callSuper(this, _Vec4, [4]); + break; + } + return _assertThisInitialized(_this6); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + _inherits(_Vec4, _Float32Array6); + return _createClass(_Vec4, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + }, { + key: "a", + get: function get() { + return this[3]; + }, + set: function set(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + var w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Vec4.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + _get(_getPrototypeOf(_Vec4.prototype), "set", this).call(this, a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + }, { + key: "add", + value: function add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + }, { + key: "subtract", + value: function subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + }, { + key: "sub", + value: function sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + }, { + key: "divide", + value: function divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + }, { + key: "div", + value: function div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + }, { + key: "distance", + value: function distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + }, { + key: "dist", + value: function dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + }, { + key: "sqrDist", + value: function sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "negate", + value: function negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "abs", + value: function abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + }, { + key: "dot", + value: function dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "normalize", + value: function normalize() { + return _Vec4.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + }, { + key: "create", + value: function create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + }, { + key: "clone", + value: function clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + }, { + key: "fromValues", + value: function fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "divide", + value: function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + }, { + key: "div", + value: function div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + }, { + key: "ceil", + value: function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + }, { + key: "floor", + value: function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "min", + value: function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "max", + value: function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + }, { + key: "round", + value: function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, _scale2) { + out[0] = a[0] * _scale2; + out[1] = a[1] * _scale2; + out[2] = a[2] * _scale2; + out[3] = a[3] * _scale2; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + }, { + key: "distance", + value: function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + }, { + key: "dist", + value: function dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + }, { + key: "squaredDistance", + value: function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + }, { + key: "sqrDist", + value: function sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + }, { + key: "magnitude", + value: function magnitude(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a) { + return 0; + } + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + }, { + key: "negate", + value: function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + }, { + key: "inverse", + value: function inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + }, { + key: "abs", + value: function abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + var len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + }, { + key: "cross", + value: function cross(out, u, v, w) { + var a = v[0] * w[1] - v[1] * w[0]; + var b = v[0] * w[2] - v[2] * w[0]; + var c = v[0] * w[3] - v[3] * w[0]; + var d = v[1] * w[2] - v[2] * w[1]; + var e = v[1] * w[3] - v[3] * w[1]; + var f = v[2] * w[3] - v[3] * w[2]; + var g = u[0]; + var h = u[1]; + var i = u[2]; + var j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + }, { + key: "transformMat4", + value: function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + }, { + key: "transformQuat", + value: function transformQuat(out, a, q) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var qw = q[3]; + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + }, { + key: "zero", + value: function zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Vec4(".concat(a.join(", "), ")"); + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + Vec4.prototype.sub = Vec4.prototype.subtract; + Vec4.prototype.mul = Vec4.prototype.multiply; + Vec4.prototype.div = Vec4.prototype.divide; + Vec4.prototype.dist = Vec4.prototype.distance; + Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; + Vec4.sub = Vec4.subtract; + Vec4.mul = Vec4.multiply; + Vec4.div = Vec4.divide; + Vec4.dist = Vec4.distance; + Vec4.sqrDist = Vec4.squaredDistance; + Vec4.sqrLen = Vec4.squaredLength; + Vec4.mag = Vec4.magnitude; + Vec4.length = Vec4.magnitude; + Vec4.len = Vec4.magnitude; + + // src/_lib/f32/Quat.ts + var _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3; + var _Quat = /*#__PURE__*/function (_Float32Array7) { + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + function _Quat() { + var _this7; + _classCallCheck(this, _Quat); + for (var _len11 = arguments.length, values = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { + values[_key11] = arguments[_key11]; + } + switch (values.length) { + case 4: + _this7 = _callSuper(this, _Quat, [values]); + break; + case 2: + _this7 = _callSuper(this, _Quat, [values[0], values[1], 4]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this7 = _callSuper(this, _Quat, [[v, v, v, v]]); + } else { + _this7 = _callSuper(this, _Quat, [v, 0, 4]); + } + break; + } + default: + _this7 = _callSuper(this, _Quat, [4]); + _this7[3] = 1; + break; + } + return _assertThisInitialized(_this7); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + _inherits(_Quat, _Float32Array7); + return _createClass(_Quat, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + var w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Quat.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + _get(_getPrototypeOf(_Quat.prototype), "set", this).call(this, a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + }, { + key: "rotateX", + value: function rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + }, { + key: "rotateY", + value: function rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + }, { + key: "rotateZ", + value: function rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(_scale3) { + this[0] *= _scale3; + this[1] *= _scale3; + this[2] *= _scale3; + this[3] *= _scale3; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + }, { + key: "dot", + value: function dot(b) { + return _Quat.dot(this, b); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + }, { + key: "create", + value: function create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + }, { + key: "setAxisAngle", + value: function setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + }, { + key: "getAxisAngle", + value: function getAxisAngle(out_axis, q) { + var rad = Math.acos(q[3]) * 2; + var s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + }, { + key: "getAngle", + value: function getAngle(a, b) { + var dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var bx = b[0]; + var by = b[1]; + var bz = b[2]; + var bw = b[3]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, rad) { + rad *= 0.5; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var bx = Math.sin(rad); + var bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, rad) { + rad *= 0.5; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var by = Math.sin(rad); + var bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, rad) { + rad *= 0.5; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var bz = Math.sin(rad); + var bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + }, { + key: "calculateW", + value: function calculateW(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + }, { + key: "exp", + value: function exp(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var et = Math.exp(w); + var s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + }, { + key: "ln", + value: function ln(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + }, { + key: "pow", + value: function pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "slerp", + value: function slerp(out, a, b, t) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + var scale0; + var scale1; + var cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + }, { + key: "invert", + value: function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + }, { + key: "conjugate", + value: function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + }, { + key: "fromMat3", + value: function fromMat3(out, m) { + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + var i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + var j = (i + 1) % 3; + var k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + }, { + key: "fromEuler", + value: function fromEuler(out, x, y, z) { + var order = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : __privateGet(_Quat, _DEFAULT_ANGLE_ORDER); + var halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + var sx = Math.sin(x); + var cx = Math.cos(x); + var sy = Math.sin(y); + var cy = Math.cos(y); + var sz = Math.sin(z); + var cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error("Unknown angle order " + order); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Quat(".concat(a.join(", "), ")"); + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + }, { + key: "clone", + value: function clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + }, { + key: "fromValues", + value: function fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, _scale4) { + out[0] = a[0] * _scale4; + out[1] = a[1] * _scale4; + out[2] = a[2] * _scale4; + out[3] = a[3] * _scale4; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + }, { + key: "magnitude", + value: function magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + return out; + } + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return false; + } + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + }, { + key: "rotationTo", + value: function rotationTo(out, a, b) { + var dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); + _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b); + out[0] = __privateGet(_Quat, _TMP_VEC32)[0]; + out[1] = __privateGet(_Quat, _TMP_VEC32)[1]; + out[2] = __privateGet(_Quat, _TMP_VEC32)[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "sqlerp", + value: function sqlerp(out, a, b, c, d, t) { + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t); + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t); + _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + }, { + key: "setAxes", + value: function setAxes(out, view, right, up) { + __privateGet(_Quat, _TMP_MAT3)[0] = right[0]; + __privateGet(_Quat, _TMP_MAT3)[3] = right[1]; + __privateGet(_Quat, _TMP_MAT3)[6] = right[2]; + __privateGet(_Quat, _TMP_MAT3)[1] = up[0]; + __privateGet(_Quat, _TMP_MAT3)[4] = up[1]; + __privateGet(_Quat, _TMP_MAT3)[7] = up[2]; + __privateGet(_Quat, _TMP_MAT3)[2] = -view[0]; + __privateGet(_Quat, _TMP_MAT3)[5] = -view[1]; + __privateGet(_Quat, _TMP_MAT3)[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3))); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + _DEFAULT_ANGLE_ORDER = new WeakMap(); + _TMP_QUAT1 = new WeakMap(); + _TMP_QUAT2 = new WeakMap(); + _TMP_MAT3 = new WeakMap(); + _TMP_VEC32 = new WeakMap(); + _X_UNIT_VEC3 = new WeakMap(); + _Y_UNIT_VEC3 = new WeakMap(); + __privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, "zyx"); + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + __privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4)); + __privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4)); + __privateAdd(_Quat, _TMP_MAT3, new Float32Array(9)); + __privateAdd(_Quat, _TMP_VEC32, new Float32Array(3)); + __privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0])); + __privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0])); + var Quat = _Quat; + Quat.set = Vec4.set; + Quat.add = Vec4.add; + Quat.lerp = Vec4.lerp; + Quat.normalize = Vec4.normalize; + Quat.squaredLength = Vec4.squaredLength; + Quat.sqrLen = Vec4.squaredLength; + Quat.exactEquals = Vec4.exactEquals; + Quat.equals = Vec4.equals; + Quat.magnitude = Vec4.magnitude; + Quat.prototype.mul = Quat.prototype.multiply; + Quat.mul = Quat.multiply; + Quat.mag = Quat.magnitude; + Quat.length = Quat.magnitude; + Quat.len = Quat.magnitude; + + // src/_lib/f32/Quat2.ts + var _TMP_QUAT, _TMP_VEC33; + var _Quat2 = /*#__PURE__*/function (_Float32Array8) { + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + function _Quat2() { + var _this8; + _classCallCheck(this, _Quat2); + for (var _len12 = arguments.length, values = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { + values[_key12] = arguments[_key12]; + } + switch (values.length) { + case 8: + _this8 = _callSuper(this, _Quat2, [values]); + break; + case 2: + _this8 = _callSuper(this, _Quat2, [values[0], values[1], 8]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this8 = _callSuper(this, _Quat2, [[v, v, v, v, v, v, v, v]]); + } else { + _this8 = _callSuper(this, _Quat2, [v, 0, 8]); + } + break; + } + default: + _this8 = _callSuper(this, _Quat2, [8]); + _this8[3] = 1; + break; + } + return _assertThisInitialized(_this8); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + _inherits(_Quat2, _Float32Array8); + return _createClass(_Quat2, [{ + key: "str", + get: function get() { + return _Quat2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + _get(_getPrototypeOf(_Quat2.prototype), "set", this).call(this, a); + return this; + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 8 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + }, { + key: "create", + value: function create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + }, { + key: "clone", + value: function clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + }, { + key: "fromValues", + value: function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + }, { + key: "fromRotationTranslationValues", + value: function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + var ax = x2 * 0.5; + var ay = y2 * 0.5; + var az = z2 * 0.5; + return new _Quat2(x1, y1, z1, w1, ax * w1 + ay * z1 - az * y1, ay * w1 + az * x1 - ax * z1, az * w1 + ax * y1 - ay * x1, -ax * x1 - ay * y1 - az * z1); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(out, q, t) { + var ax = t[0] * 0.5; + var ay = t[1] * 0.5; + var az = t[2] * 0.5; + var bx = q[0]; + var by = q[1]; + var bz = q[2]; + var bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + }, { + key: "fromMat4", + value: function fromMat4(out, a) { + Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a); + Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a); + return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33)); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + }, { + key: "getReal", + value: function getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + }, { + key: "getDual", + value: function getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + }, { + key: "setReal", + value: function setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + }, { + key: "setDual", + value: function setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + }, { + key: "getTranslation", + value: function getTranslation(out, a) { + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var ax1 = a[0]; + var ay1 = a[1]; + var az1 = a[2]; + var aw1 = a[3]; + var bx1 = v[0] * 0.5; + var by1 = v[1] * 0.5; + var bz1 = v[2] * 0.5; + var ax2 = a[4]; + var ay2 = a[5]; + var az2 = a[6]; + var aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, rad) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var ax1 = ax * bw + aw * bx + ay * bz - az * by; + var ay1 = ay * bw + aw * by + az * bx - ax * bz; + var az1 = az * bw + aw * bz + ax * by - ay * bx; + var aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, rad) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var ax1 = ax * bw + aw * bx + ay * bz - az * by; + var ay1 = ay * bw + aw * by + az * bx - ax * bz; + var az1 = az * bw + aw * bz + ax * by - ay * bx; + var aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, rad) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var ax1 = ax * bw + aw * bx + ay * bz - az * by; + var ay1 = ay * bw + aw * by + az * bx - ax * bz; + var az1 = az * bw + aw * bz + ax * by - ay * bx; + var aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + }, { + key: "rotateByQuatAppend", + value: function rotateByQuatAppend(out, a, q) { + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var qw = q[3]; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + }, { + key: "rotateByQuatPrepend", + value: function rotateByQuatPrepend(out, q, a) { + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var qw = q[3]; + var bx = a[0]; + var by = a[1]; + var bz = a[2]; + var bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + }, { + key: "rotateAroundAxis", + value: function rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + var axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad = rad * 0.5; + var s = Math.sin(rad); + var bx = s * axis[0] / axisLength; + var by = s * axis[1] / axisLength; + var bz = s * axis[2] / axisLength; + var bw = Math.cos(rad); + var ax1 = a[0]; + var ay1 = a[1]; + var az1 = a[2]; + var aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var ax0 = a[0]; + var ay0 = a[1]; + var az0 = a[2]; + var aw0 = a[3]; + var bx1 = b[4]; + var by1 = b[5]; + var bz1 = b[6]; + var bw1 = b[7]; + var ax1 = a[4]; + var ay1 = a[5]; + var az1 = a[6]; + var aw1 = a[7]; + var bx0 = b[0]; + var by0 = b[1]; + var bz0 = b[2]; + var bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var mt = 1 - t; + if (_Quat2.dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + }, { + key: "invert", + value: function invert(out, a) { + var sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + }, { + key: "conjugate", + value: function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + }, { + key: "magnitude", + value: function magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + var a0 = a[0] / magnitude; + var a1 = a[1] / magnitude; + var a2 = a[2] / magnitude; + var a3 = a[3] / magnitude; + var b0 = a[4]; + var b1 = a[5]; + var b2 = a[6]; + var b3 = a[7]; + var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Quat2(".concat(a.join(", "), ")"); + } + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var a6 = a[6]; + var a7 = a[7]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + var b6 = b[6]; + var b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + _TMP_QUAT = new WeakMap(); + _TMP_VEC33 = new WeakMap(); + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + __privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4)); + __privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3)); + var Quat2 = _Quat2; + Quat2.dot = Quat.dot; + Quat2.squaredLength = Quat.squaredLength; + Quat2.sqrLen = Quat.squaredLength; + Quat2.mag = Quat.magnitude; + Quat2.length = Quat.magnitude; + Quat2.len = Quat.magnitude; + Quat2.mul = Quat2.multiply; + + // src/_lib/f32/Vec2.ts + var Vec2 = /*#__PURE__*/function (_Float32Array9) { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + function _Vec2() { + var _this9; + _classCallCheck(this, _Vec2); + switch (arguments.length) { + case 2: + { + var v = arguments.length <= 0 ? undefined : arguments[0]; + if (typeof v === "number") { + _this9 = _callSuper(this, _Vec2, [[v, arguments.length <= 1 ? undefined : arguments[1]]]); + } else { + _this9 = _callSuper(this, _Vec2, [v, arguments.length <= 1 ? undefined : arguments[1], 2]); + } + break; + } + case 1: + { + var _v = arguments.length <= 0 ? undefined : arguments[0]; + if (typeof _v === "number") { + _this9 = _callSuper(this, _Vec2, [[_v, _v]]); + } else { + _this9 = _callSuper(this, _Vec2, [_v, 0, 2]); + } + break; + } + default: + _this9 = _callSuper(this, _Vec2, [2]); + break; + } + return _assertThisInitialized(_this9); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + _inherits(_Vec2, _Float32Array9); + return _createClass(_Vec2, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + }, { + key: "squaredMagnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Vec2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + }, { + key: "add", + value: function add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + }, { + key: "subtract", + value: function subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + }, { + key: "sub", + value: function sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + }, { + key: "divide", + value: function divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + }, { + key: "div", + value: function div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + }, { + key: "distance", + value: function distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + }, { + key: "dist", + value: function dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + }, { + key: "sqrDist", + value: function sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "negate", + value: function negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "abs", + value: function abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + }, { + key: "dot", + value: function dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "normalize", + value: function normalize() { + return _Vec2.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 2 * Float32Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + }, { + key: "create", + value: function create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + }, { + key: "clone", + value: function clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + }, { + key: "fromValues", + value: function fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "divide", + value: function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + }, { + key: "div", + value: function div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + }, { + key: "ceil", + value: function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + }, { + key: "floor", + value: function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "min", + value: function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "max", + value: function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + }, { + key: "round", + value: function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + }, { + key: "distance", + value: function distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + }, { + key: "dist", + value: function dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + }, { + key: "sqrDist", + value: function sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + }, { + key: "magnitude", + value: function magnitude(a) { + var x = a[0]; + var y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + var x = a[0]; + var y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + }, { + key: "negate", + value: function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + }, { + key: "inverse", + value: function inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + }, { + key: "abs", + value: function abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "cross", + value: function cross(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat2", + value: function transformMat2(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat2d", + value: function transformMat2d(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat3", + value: function transformMat3(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat4", + value: function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, b, rad) { + var p0 = a[0] - b[0]; + var p1 = a[1] - b[1]; + var sinC = Math.sin(rad); + var cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + }, { + key: "angle", + value: function angle(a, b) { + var x1 = a[0]; + var y1 = a[1]; + var x2 = b[0]; + var y2 = b[1]; + var mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + var cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + }, { + key: "zero", + value: function zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var b0 = b[0]; + var b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Vec2(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + Vec2.prototype.sub = Vec2.prototype.subtract; + Vec2.prototype.mul = Vec2.prototype.multiply; + Vec2.prototype.div = Vec2.prototype.divide; + Vec2.prototype.dist = Vec2.prototype.distance; + Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; + Vec2.sub = Vec2.subtract; + Vec2.mul = Vec2.multiply; + Vec2.div = Vec2.divide; + Vec2.dist = Vec2.distance; + Vec2.sqrDist = Vec2.squaredDistance; + Vec2.sqrLen = Vec2.squaredLength; + Vec2.mag = Vec2.magnitude; + Vec2.length = Vec2.magnitude; + Vec2.len = Vec2.magnitude; + + // src/swizzle/index.ts + var GLM_SWIZZLES_ENABLED_F32 = false; + function EnableSwizzles() { + if (GLM_SWIZZLES_ENABLED_F32) { + return; + } + var VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + var VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + var VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + var SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function () { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function () { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + }; + case 4: + return function () { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; + } + } + for (var _i = 0, _VEC2_SWIZZLES = VEC2_SWIZZLES; _i < _VEC2_SWIZZLES.length; _i++) { + var swizzle = _VEC2_SWIZZLES[_i]; + var impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (var _i2 = 0, _VEC3_SWIZZLES = VEC3_SWIZZLES; _i2 < _VEC3_SWIZZLES.length; _i2++) { + var _swizzle = _VEC3_SWIZZLES[_i2]; + var _impl = getSwizzleImpl(_swizzle); + Object.defineProperty(Vec3.prototype, _swizzle, { + get: _impl + }); + Object.defineProperty(Vec4.prototype, _swizzle, { + get: _impl + }); + } + for (var _i3 = 0, _VEC4_SWIZZLES = VEC4_SWIZZLES; _i3 < _VEC4_SWIZZLES.length; _i3++) { + var _swizzle2 = _VEC4_SWIZZLES[_i3]; + var _impl2 = getSwizzleImpl(_swizzle2); + Object.defineProperty(Vec4.prototype, _swizzle2, { + get: _impl2 + }); + } + GLM_SWIZZLES_ENABLED_F32 = true; + } + + // src/util/angleConversion.ts + var GLM_DEG_TO_RAD = Math.PI / 180; + var GLM_RAD_TO_DEG = 180 / Math.PI; + function toDegree(value) { + return value * GLM_RAD_TO_DEG; + } + function toRadian(value) { + return value * GLM_DEG_TO_RAD; + } + + exports.EnableSwizzles = EnableSwizzles; + exports.Mat2 = Mat2; + exports.Mat2d = Mat2d; + exports.Mat3 = Mat3; + exports.Mat4 = Mat4; + exports.Quat = Quat; + exports.Quat2 = Quat2; + exports.Vec2 = Vec2; + exports.Vec3 = Vec3; + exports.Vec4 = Vec4; + exports.mat2 = Mat2; + exports.mat2d = Mat2d; + exports.mat3 = Mat3; + exports.mat4 = Mat4; + exports.quat = Quat; + exports.quat2 = Quat2; + exports.toDegree = toDegree; + exports.toRadian = toRadian; + exports.vec2 = Vec2; + exports.vec3 = Vec3; + exports.vec4 = Vec4; + +})); +//# sourceMappingURL=gl-matrix-f32.cjs.map diff --git a/dist-cdn/umd/gl-matrix-f32.cjs.map b/dist-cdn/umd/gl-matrix-f32.cjs.map new file mode 100644 index 00000000..ffd87c33 --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f32.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f32.cjs","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.min.cjs b/dist-cdn/umd/gl-matrix-f32.min.cjs new file mode 100644 index 00000000..29b5295a --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f32.min.cjs @@ -0,0 +1,4445 @@ +[object Object] +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrix = {})); +})(this, (function (exports) { 'use strict'; + + function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; + } + function _callSuper(t, o, e) { + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); + } + function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); + } + function _construct(t, e, r) { + if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _setPrototypeOf(p, r.prototype), p; + } + function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); + } + } + function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; + } + function _get() { + return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = _superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, _get.apply(null, arguments); + } + function _getPrototypeOf(t) { + return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, _getPrototypeOf(t); + } + function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && _setPrototypeOf(t, e); + } + function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } + } + function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (_isNativeReflectConstruct = function () { + return !!t; + })(); + } + function _possibleConstructorReturn(t, e) { + if (e && ("object" == typeof e || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return _assertThisInitialized(t); + } + function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); + } + function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); + return t; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r ); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (String )(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return _wrapNativeSuper = function (t) { + if (null === t || !_isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return _construct(t, arguments, _getPrototypeOf(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), _setPrototypeOf(Wrapper, t); + }, _wrapNativeSuper(t); + } + + // glMatrix - v4.0.0-beta.3 + var de = function de(A) { + throw TypeError(A); + }; + var xe = function xe(A, e, t) { + return e.has(A) || de("Cannot " + t); + }; + var E = function E(A, e, t) { + return xe(A, e, "read from private field"), t ? t.call(A) : e.get(A); + }, + Z = function Z(A, e, t) { + return e.has(A) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(A) : e.set(A, t); + }; + var ne, + C = /*#__PURE__*/function (_Float32Array) { + function C() { + var _this; + _classCallCheck(this, C); + for (var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++) { + e[_key] = arguments[_key]; + } + switch (e.length) { + case 4: + _this = _callSuper(this, C, [e]); + break; + case 2: + _this = _callSuper(this, C, [e[0], e[1], 4]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this = _callSuper(this, C, [[t, t, t, t]]) : _this = _callSuper(this, C, [t, 0, 4]); + break; + default: + _this = _callSuper(this, C, [E(C, ne)]); + break; + } + return _assertThisInitialized(_this); + } + _inherits(C, _Float32Array); + return _createClass(C, [{ + key: "str", + get: function get() { + return C.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E(C, ne)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return C.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "transpose", + value: function transpose() { + return C.transpose(this, this); + } + }, { + key: "invert", + value: function invert() { + return C.invert(this, this); + } + }, { + key: "scale", + value: function scale(e) { + return C.scale(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e) { + return C.rotate(this, this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new C(); + } + }, { + key: "clone", + value: function clone(e) { + return new C(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + e[_key2] = arguments[_key2]; + } + return _construct(C, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e; + } + }, { + key: "transpose", + value: function transpose(e, t) { + if (e === t) { + var n = t[1]; + e[1] = t[2], e[2] = n; + } else e[0] = t[0], e[1] = t[2], e[2] = t[1], e[3] = t[3]; + return e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = n * a - r * s; + return i ? (i = 1 / i, e[0] = a * i, e[1] = -s * i, e[2] = -r * i, e[3] = n * i, e) : null; + } + }, { + key: "adjoint", + value: function adjoint(e, t) { + var n = t[0]; + return e[0] = t[3], e[1] = -t[1], e[2] = -t[2], e[3] = n, e; + } + }, { + key: "determinant", + value: function determinant(e) { + return e[0] * e[3] - e[2] * e[1]; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = n[0], + y = n[1], + L = n[2], + k = n[3]; + return e[0] = s * c + a * y, e[1] = r * c + i * y, e[2] = s * L + a * k, e[3] = r * L + i * k, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "rotate", + value: function rotate(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y + a * c, e[1] = r * y + i * c, e[2] = s * -c + a * y, e[3] = r * -c + i * y, e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = n[0], + y = n[1]; + return e[0] = s * c, e[1] = r * c, e[2] = a * y, e[3] = i * y, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = -n, e[3] = s, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = t[1], e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3]); + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e; + } + }, { + key: "LDU", + value: function LDU(e, t, n, s) { + return e[2] = s[2] / s[0], n[0] = s[0], n[1] = s[1], n[3] = s[3] - e[2] * n[1], [e, t, n]; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = e[3], + i = t[0], + c = t[1], + y = t[2], + L = t[3]; + return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(a - L) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(L)); + } + }, { + key: "str", + value: function str(e) { + return "Mat2(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + ne = new WeakMap(), Z(C, ne, new Float32Array([1, 0, 0, 1])); + var v = C; + v.prototype.mul = v.prototype.multiply; + v.mul = v.multiply; + v.sub = v.subtract; + var se, + $ = /*#__PURE__*/function (_Float32Array2) { + function $() { + var _this2; + _classCallCheck(this, $); + for (var _len3 = arguments.length, e = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + e[_key3] = arguments[_key3]; + } + switch (e.length) { + case 6: + _this2 = _callSuper(this, $, [e]); + break; + case 2: + _this2 = _callSuper(this, $, [e[0], e[1], 6]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this2 = _callSuper(this, $, [[t, t, t, t, t, t]]) : _this2 = _callSuper(this, $, [t, 0, 6]); + break; + default: + _this2 = _callSuper(this, $, [E($, se)]); + break; + } + return _assertThisInitialized(_this2); + } + _inherits($, _Float32Array2); + return _createClass($, [{ + key: "str", + get: function get() { + return $.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E($, se)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return $.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "translate", + value: function translate(e) { + return $.translate(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e) { + return $.rotate(this, this, e); + } + }, { + key: "scale", + value: function scale(e) { + return $.scale(this, this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 6 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new $(); + } + }, { + key: "clone", + value: function clone(e) { + return new $(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len4 = arguments.length, e = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + e[_key4] = arguments[_key4]; + } + return _construct($, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e[4] = arguments.length <= 5 ? undefined : arguments[5], e[5] = arguments.length <= 6 ? undefined : arguments[6], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = n * a - s * r; + return y ? (y = 1 / y, e[0] = a * y, e[1] = -s * y, e[2] = -r * y, e[3] = n * y, e[4] = (r * c - a * i) * y, e[5] = (s * i - n * c) * y, e) : null; + } + }, { + key: "determinant", + value: function determinant(e) { + return e[0] * e[3] - e[1] * e[2]; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e[4] = t[4] - n[4], e[5] = t[5] - n[5], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = n[0], + k = n[1], + l = n[2], + M = n[3], + h = n[4], + b = n[5]; + return e[0] = s * L + a * k, e[1] = r * L + i * k, e[2] = s * l + a * M, e[3] = r * l + i * M, e[4] = s * h + a * b + c, e[5] = r * h + i * b + y, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = n[0], + k = n[1]; + return e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = s * L + a * k + c, e[5] = r * L + i * k + y, e; + } + }, { + key: "rotate", + value: function rotate(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = Math.sin(n), + k = Math.cos(n); + return e[0] = s * k + a * L, e[1] = r * k + i * L, e[2] = s * -L + a * k, e[3] = r * -L + i * k, e[4] = c, e[5] = y, e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = n[0], + k = n[1]; + return e[0] = s * L, e[1] = r * L, e[2] = a * k, e[3] = i * k, e[4] = c, e[5] = y, e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = t[0], e[5] = t[1], e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = -n, e[3] = s, e[4] = 0, e[5] = 0, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = t[1], e[4] = 0, e[5] = 0, e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3] + e[4] * e[4] + e[5] * e[5] + 1); + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e[4] = t[4] + n[4] * s, e[5] = t[5] + n[5] * s, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = e[3], + i = e[4], + c = e[5], + y = t[0], + L = t[1], + k = t[2], + l = t[3], + M = t[4], + h = t[5]; + return Math.abs(n - y) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(y)) && Math.abs(s - L) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(L)) && Math.abs(r - k) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(k)) && Math.abs(a - l) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(l)) && Math.abs(i - M) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(M)) && Math.abs(c - h) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(h)); + } + }, { + key: "str", + value: function str(e) { + return "Mat2d(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + se = new WeakMap(), Z($, se, new Float32Array([1, 0, 0, 1, 0, 0])); + var _ = $; + _.mul = _.multiply; + _.sub = _.subtract; + var re, + X = /*#__PURE__*/function (_Float32Array3) { + function X() { + var _this3; + _classCallCheck(this, X); + for (var _len5 = arguments.length, e = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + e[_key5] = arguments[_key5]; + } + switch (e.length) { + case 9: + _this3 = _callSuper(this, X, [e]); + break; + case 2: + _this3 = _callSuper(this, X, [e[0], e[1], 9]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this3 = _callSuper(this, X, [[t, t, t, t, t, t, t, t, t]]) : _this3 = _callSuper(this, X, [t, 0, 9]); + break; + default: + _this3 = _callSuper(this, X, [E(X, re)]); + break; + } + return _assertThisInitialized(_this3); + } + _inherits(X, _Float32Array3); + return _createClass(X, [{ + key: "str", + get: function get() { + return X.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E(X, re)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return X.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "transpose", + value: function transpose() { + return X.transpose(this, this); + } + }, { + key: "invert", + value: function invert() { + return X.invert(this, this); + } + }, { + key: "translate", + value: function translate(e) { + return X.translate(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e) { + return X.rotate(this, this, e); + } + }, { + key: "scale", + value: function scale(e) { + return X.scale(this, this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 9 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new X(); + } + }, { + key: "clone", + value: function clone(e) { + return new X(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len6 = arguments.length, e = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + e[_key6] = arguments[_key6]; + } + return _construct(X, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e[4] = arguments.length <= 5 ? undefined : arguments[5], e[5] = arguments.length <= 6 ? undefined : arguments[6], e[6] = arguments.length <= 7 ? undefined : arguments[7], e[7] = arguments.length <= 8 ? undefined : arguments[8], e[8] = arguments.length <= 9 ? undefined : arguments[9], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 1, e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e; + } + }, { + key: "transpose", + value: function transpose(e, t) { + if (e === t) { + var n = t[1], + s = t[2], + r = t[5]; + e[1] = t[3], e[2] = t[6], e[3] = n, e[5] = t[7], e[6] = s, e[7] = r; + } else e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8]; + return e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = k * i - c * L, + M = -k * a + c * y, + h = L * a - i * y, + b = n * l + s * M + r * h; + return b ? (b = 1 / b, e[0] = l * b, e[1] = (-k * s + r * L) * b, e[2] = (c * s - r * i) * b, e[3] = M * b, e[4] = (k * n - r * y) * b, e[5] = (-c * n + r * a) * b, e[6] = h * b, e[7] = (-L * n + s * y) * b, e[8] = (i * n - s * a) * b, e) : null; + } + }, { + key: "adjoint", + value: function adjoint(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8]; + return e[0] = i * k - c * L, e[1] = r * L - s * k, e[2] = s * c - r * i, e[3] = c * y - a * k, e[4] = n * k - r * y, e[5] = r * a - n * c, e[6] = a * L - i * y, e[7] = s * y - n * L, e[8] = n * i - s * a, e; + } + }, { + key: "determinant", + value: function determinant(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3], + a = e[4], + i = e[5], + c = e[6], + y = e[7], + L = e[8]; + return t * (L * a - i * y) + n * (-L * r + i * c) + s * (y * r - a * c); + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e[6] = t[6] + n[6], e[7] = t[7] + n[7], e[8] = t[8] + n[8], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e[4] = t[4] - n[4], e[5] = t[5] - n[5], e[6] = t[6] - n[6], e[7] = t[7] - n[7], e[8] = t[8] - n[8], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + M = n[0], + h = n[1], + b = n[2]; + return e[0] = M * s + h * i + b * L, e[1] = M * r + h * c + b * k, e[2] = M * a + h * y + b * l, M = n[3], h = n[4], b = n[5], e[3] = M * s + h * i + b * L, e[4] = M * r + h * c + b * k, e[5] = M * a + h * y + b * l, M = n[6], h = n[7], b = n[8], e[6] = M * s + h * i + b * L, e[7] = M * r + h * c + b * k, e[8] = M * a + h * y + b * l, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + M = n[0], + h = n[1]; + return e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = c, e[5] = y, e[6] = M * s + h * i + L, e[7] = M * r + h * c + k, e[8] = M * a + h * y + l, e; + } + }, { + key: "rotate", + value: function rotate(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + M = Math.sin(n), + h = Math.cos(n); + return e[0] = h * s + M * i, e[1] = h * r + M * c, e[2] = h * a + M * y, e[3] = h * i - M * s, e[4] = h * c - M * r, e[5] = h * y - M * a, e[6] = L, e[7] = k, e[8] = l, e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = n[0], + r = n[1]; + return e[0] = s * t[0], e[1] = s * t[1], e[2] = s * t[2], e[3] = r * t[3], e[4] = r * t[4], e[5] = r * t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 1, e[5] = 0, e[6] = t[0], e[7] = t[1], e[8] = 1, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = 0, e[3] = -n, e[4] = s, e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = 0, e[4] = t[1], e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e; + } + }, { + key: "fromMat2d", + value: function fromMat2d(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = 0, e[3] = t[2], e[4] = t[3], e[5] = 0, e[6] = t[4], e[7] = t[5], e[8] = 1, e; + } + }, { + key: "fromQuat", + value: function fromQuat(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = n + n, + c = s + s, + y = r + r, + L = n * i, + k = s * i, + l = s * c, + M = r * i, + h = r * c, + b = r * y, + d = a * i, + m = a * c, + x = a * y; + return e[0] = 1 - l - b, e[3] = k - x, e[6] = M + m, e[1] = k + x, e[4] = 1 - L - b, e[7] = h - d, e[2] = M - m, e[5] = h + d, e[8] = 1 - L - l, e; + } + }, { + key: "fromMat4", + value: function fromMat4(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[4], e[4] = t[5], e[5] = t[6], e[6] = t[8], e[7] = t[9], e[8] = t[10], e; + } + }, { + key: "normalFromMat4", + value: function normalFromMat4(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + M = t[10], + h = t[11], + b = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * i, + o = n * y - r * i, + R = n * L - a * i, + z = s * y - r * c, + g = s * L - a * c, + S = r * L - a * y, + B = k * d - l * b, + N = k * m - M * b, + p = k * x - h * b, + Y = l * m - M * d, + F = l * x - h * d, + P = M * x - h * m, + Q = V * P - o * F + R * Y + z * p - g * N + S * B; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * F + L * Y) * Q, e[1] = (y * p - i * P - L * N) * Q, e[2] = (i * F - c * p + L * B) * Q, e[3] = (r * F - s * P - a * Y) * Q, e[4] = (n * P - r * p + a * N) * Q, e[5] = (s * p - n * F - a * B) * Q, e[6] = (d * S - m * g + x * z) * Q, e[7] = (m * R - b * S - x * o) * Q, e[8] = (b * g - d * R + x * V) * Q, e) : null; + } + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[4], + i = t[5], + c = t[6], + y = t[8], + L = t[9], + k = t[10]; + return e[0] = i * k - k * L, e[1] = c * y - y * k, e[2] = a * L - L * y, e[3] = L * r - k * s, e[4] = k * n - y * r, e[5] = y * s - L * n, e[6] = s * c - r * i, e[7] = r * a - n * c, e[8] = n * i - s * a, e; + } + }, { + key: "projection", + value: function projection(e, t, n) { + return e[0] = 2 / t, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = -2 / n, e[5] = 0, e[6] = -1, e[7] = 1, e[8] = 1, e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3] + e[4] * e[4] + e[5] * e[5] + e[6] * e[6] + e[7] * e[7] + e[8] * e[8]); + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e[6] = t[6] * n, e[7] = t[7] * n, e[8] = t[8] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e[4] = t[4] + n[4] * s, e[5] = t[5] + n[5] * s, e[6] = t[6] + n[6] * s, e[7] = t[7] + n[7] * s, e[8] = t[8] + n[8] * s, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7] && e[8] === t[8]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = e[3], + i = e[4], + c = e[5], + y = e[6], + L = e[7], + k = e[8], + l = t[0], + M = t[1], + h = t[2], + b = t[3], + d = t[4], + m = t[5], + x = t[6], + V = t[7], + o = t[8]; + return Math.abs(n - l) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(l)) && Math.abs(s - M) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(M)) && Math.abs(r - h) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(h)) && Math.abs(a - b) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(i - d) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(d)) && Math.abs(c - m) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(y - x) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(x)) && Math.abs(L - V) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(V)) && Math.abs(k - o) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(o)); + } + }, { + key: "str", + value: function str(e) { + return "Mat3(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + re = new WeakMap(), Z(X, re, new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); + var u = X; + u.prototype.mul = u.prototype.multiply; + u.mul = u.multiply; + u.sub = u.subtract; + var ae, + H, + D = /*#__PURE__*/function (_Float32Array4) { + function D() { + var _this4; + _classCallCheck(this, D); + for (var _len7 = arguments.length, e = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + e[_key7] = arguments[_key7]; + } + switch (e.length) { + case 16: + _this4 = _callSuper(this, D, [e]); + break; + case 2: + _this4 = _callSuper(this, D, [e[0], e[1], 16]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this4 = _callSuper(this, D, [[t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]]) : _this4 = _callSuper(this, D, [t, 0, 16]); + break; + default: + _this4 = _callSuper(this, D, [E(D, ae)]); + break; + } + return _assertThisInitialized(_this4); + } + _inherits(D, _Float32Array4); + return _createClass(D, [{ + key: "str", + get: function get() { + return D.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E(D, ae)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return D.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "transpose", + value: function transpose() { + return D.transpose(this, this); + } + }, { + key: "invert", + value: function invert() { + return D.invert(this, this); + } + }, { + key: "translate", + value: function translate(e) { + return D.translate(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e, t) { + return D.rotate(this, this, e, t); + } + }, { + key: "scale", + value: function scale(e) { + return D.scale(this, this, e); + } + }, { + key: "rotateX", + value: function rotateX(e) { + return D.rotateX(this, this, e); + } + }, { + key: "rotateY", + value: function rotateY(e) { + return D.rotateY(this, this, e); + } + }, { + key: "rotateZ", + value: function rotateZ(e) { + return D.rotateZ(this, this, e); + } + }, { + key: "perspectiveNO", + value: function perspectiveNO(e, t, n, s) { + return D.perspectiveNO(this, e, t, n, s); + } + }, { + key: "perspectiveZO", + value: function perspectiveZO(e, t, n, s) { + return D.perspectiveZO(this, e, t, n, s); + } + }, { + key: "orthoNO", + value: function orthoNO(e, t, n, s, r, a) { + return D.orthoNO(this, e, t, n, s, r, a); + } + }, { + key: "orthoZO", + value: function orthoZO(e, t, n, s, r, a) { + return D.orthoZO(this, e, t, n, s, r, a); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 16 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new D(); + } + }, { + key: "clone", + value: function clone(e) { + return new D(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len8 = arguments.length, e = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + e[_key8] = arguments[_key8]; + } + return _construct(D, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e[4] = arguments.length <= 5 ? undefined : arguments[5], e[5] = arguments.length <= 6 ? undefined : arguments[6], e[6] = arguments.length <= 7 ? undefined : arguments[7], e[7] = arguments.length <= 8 ? undefined : arguments[8], e[8] = arguments.length <= 9 ? undefined : arguments[9], e[9] = arguments.length <= 10 ? undefined : arguments[10], e[10] = arguments.length <= 11 ? undefined : arguments[11], e[11] = arguments.length <= 12 ? undefined : arguments[12], e[12] = arguments.length <= 13 ? undefined : arguments[13], e[13] = arguments.length <= 14 ? undefined : arguments[14], e[14] = arguments.length <= 15 ? undefined : arguments[15], e[15] = arguments.length <= 16 ? undefined : arguments[16], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "transpose", + value: function transpose(e, t) { + if (e === t) { + var n = t[1], + s = t[2], + r = t[3], + a = t[6], + i = t[7], + c = t[11]; + e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = n, e[6] = t[9], e[7] = t[13], e[8] = s, e[9] = a, e[11] = t[14], e[12] = r, e[13] = i, e[14] = c; + } else e[0] = t[0], e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = t[1], e[5] = t[5], e[6] = t[9], e[7] = t[13], e[8] = t[2], e[9] = t[6], e[10] = t[10], e[11] = t[14], e[12] = t[3], e[13] = t[7], e[14] = t[11], e[15] = t[15]; + return e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + M = t[10], + h = t[11], + b = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * i, + o = n * y - r * i, + R = n * L - a * i, + z = s * y - r * c, + g = s * L - a * c, + S = r * L - a * y, + B = k * d - l * b, + N = k * m - M * b, + p = k * x - h * b, + Y = l * m - M * d, + F = l * x - h * d, + P = M * x - h * m, + Q = V * P - o * F + R * Y + z * p - g * N + S * B; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * F + L * Y) * Q, e[1] = (r * F - s * P - a * Y) * Q, e[2] = (d * S - m * g + x * z) * Q, e[3] = (M * g - l * S - h * z) * Q, e[4] = (y * p - i * P - L * N) * Q, e[5] = (n * P - r * p + a * N) * Q, e[6] = (m * R - b * S - x * o) * Q, e[7] = (k * S - M * R + h * o) * Q, e[8] = (i * F - c * p + L * B) * Q, e[9] = (s * p - n * F - a * B) * Q, e[10] = (b * g - d * R + x * V) * Q, e[11] = (l * R - k * g - h * V) * Q, e[12] = (c * N - i * Y - y * B) * Q, e[13] = (n * Y - s * N + r * B) * Q, e[14] = (d * o - b * z - m * V) * Q, e[15] = (k * z - l * o + M * V) * Q, e) : null; + } + }, { + key: "adjoint", + value: function adjoint(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + M = t[10], + h = t[11], + b = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * i, + o = n * y - r * i, + R = n * L - a * i, + z = s * y - r * c, + g = s * L - a * c, + S = r * L - a * y, + B = k * d - l * b, + N = k * m - M * b, + p = k * x - h * b, + Y = l * m - M * d, + F = l * x - h * d, + P = M * x - h * m; + return e[0] = c * P - y * F + L * Y, e[1] = r * F - s * P - a * Y, e[2] = d * S - m * g + x * z, e[3] = M * g - l * S - h * z, e[4] = y * p - i * P - L * N, e[5] = n * P - r * p + a * N, e[6] = m * R - b * S - x * o, e[7] = k * S - M * R + h * o, e[8] = i * F - c * p + L * B, e[9] = s * p - n * F - a * B, e[10] = b * g - d * R + x * V, e[11] = l * R - k * g - h * V, e[12] = c * N - i * Y - y * B, e[13] = n * Y - s * N + r * B, e[14] = d * o - b * z - m * V, e[15] = k * z - l * o + M * V, e; + } + }, { + key: "determinant", + value: function determinant(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3], + a = e[4], + i = e[5], + c = e[6], + y = e[7], + L = e[8], + k = e[9], + l = e[10], + M = e[11], + h = e[12], + b = e[13], + d = e[14], + m = e[15], + x = t * i - n * a, + V = t * c - s * a, + o = n * c - s * i, + R = L * b - k * h, + z = L * d - l * h, + g = k * d - l * b, + S = t * g - n * z + s * R, + B = a * g - i * z + c * R, + N = L * o - k * V + l * x, + p = h * o - b * V + d * x; + return y * S - r * B + m * N - M * p; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + M = t[9], + h = t[10], + b = t[11], + d = t[12], + m = t[13], + x = t[14], + V = t[15], + o = n[0], + R = n[1], + z = n[2], + g = n[3]; + return e[0] = o * s + R * c + z * l + g * d, e[1] = o * r + R * y + z * M + g * m, e[2] = o * a + R * L + z * h + g * x, e[3] = o * i + R * k + z * b + g * V, o = n[4], R = n[5], z = n[6], g = n[7], e[4] = o * s + R * c + z * l + g * d, e[5] = o * r + R * y + z * M + g * m, e[6] = o * a + R * L + z * h + g * x, e[7] = o * i + R * k + z * b + g * V, o = n[8], R = n[9], z = n[10], g = n[11], e[8] = o * s + R * c + z * l + g * d, e[9] = o * r + R * y + z * M + g * m, e[10] = o * a + R * L + z * h + g * x, e[11] = o * i + R * k + z * b + g * V, o = n[12], R = n[13], z = n[14], g = n[15], e[12] = o * s + R * c + z * l + g * d, e[13] = o * r + R * y + z * M + g * m, e[14] = o * a + R * L + z * h + g * x, e[15] = o * i + R * k + z * b + g * V, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = n[0], + r = n[1], + a = n[2]; + if (t === e) e[12] = t[0] * s + t[4] * r + t[8] * a + t[12], e[13] = t[1] * s + t[5] * r + t[9] * a + t[13], e[14] = t[2] * s + t[6] * r + t[10] * a + t[14], e[15] = t[3] * s + t[7] * r + t[11] * a + t[15];else { + var i = t[0], + c = t[1], + y = t[2], + L = t[3], + k = t[4], + l = t[5], + M = t[6], + h = t[7], + b = t[8], + d = t[9], + m = t[10], + x = t[11]; + e[0] = i, e[1] = c, e[2] = y, e[3] = L, e[4] = k, e[5] = l, e[6] = M, e[7] = h, e[8] = b, e[9] = d, e[10] = m, e[11] = x, e[12] = i * s + k * r + b * a + t[12], e[13] = c * s + l * r + d * a + t[13], e[14] = y * s + M * r + m * a + t[14], e[15] = L * s + h * r + x * a + t[15]; + } + return e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = n[0], + r = n[1], + a = n[2]; + return e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s, e[3] = t[3] * s, e[4] = t[4] * r, e[5] = t[5] * r, e[6] = t[6] * r, e[7] = t[7] * r, e[8] = t[8] * a, e[9] = t[9] * a, e[10] = t[10] * a, e[11] = t[11] * a, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; + } + }, { + key: "rotate", + value: function rotate(e, t, n, s) { + var r = s[0], + a = s[1], + i = s[2], + c = Math.sqrt(r * r + a * a + i * i); + if (c < 1e-6) return null; + c = 1 / c, r *= c, a *= c, i *= c; + var y = Math.sin(n), + L = Math.cos(n), + k = 1 - L, + l = t[0], + M = t[1], + h = t[2], + b = t[3], + d = t[4], + m = t[5], + x = t[6], + V = t[7], + o = t[8], + R = t[9], + z = t[10], + g = t[11], + S = r * r * k + L, + B = a * r * k + i * y, + N = i * r * k - a * y, + p = r * a * k - i * y, + Y = a * a * k + L, + F = i * a * k + r * y, + P = r * i * k + a * y, + Q = a * i * k - r * y, + K = i * i * k + L; + return e[0] = l * S + d * B + o * N, e[1] = M * S + m * B + R * N, e[2] = h * S + x * B + z * N, e[3] = b * S + V * B + g * N, e[4] = l * p + d * Y + o * F, e[5] = M * p + m * Y + R * F, e[6] = h * p + x * Y + z * F, e[7] = b * p + V * Y + g * F, e[8] = l * P + d * Q + o * K, e[9] = M * P + m * Q + R * K, e[10] = h * P + x * Q + z * K, e[11] = b * P + V * Q + g * K, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n) { + var s = Math.sin(n), + r = Math.cos(n), + a = t[4], + i = t[5], + c = t[6], + y = t[7], + L = t[8], + k = t[9], + l = t[10], + M = t[11]; + return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = a * r + L * s, e[5] = i * r + k * s, e[6] = c * r + l * s, e[7] = y * r + M * s, e[8] = L * r - a * s, e[9] = k * r - i * s, e[10] = l * r - c * s, e[11] = M * r - y * s, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n) { + var s = Math.sin(n), + r = Math.cos(n), + a = t[0], + i = t[1], + c = t[2], + y = t[3], + L = t[8], + k = t[9], + l = t[10], + M = t[11]; + return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = a * r - L * s, e[1] = i * r - k * s, e[2] = c * r - l * s, e[3] = y * r - M * s, e[8] = a * s + L * r, e[9] = i * s + k * r, e[10] = c * s + l * r, e[11] = y * s + M * r, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n) { + var s = Math.sin(n), + r = Math.cos(n), + a = t[0], + i = t[1], + c = t[2], + y = t[3], + L = t[4], + k = t[5], + l = t[6], + M = t[7]; + return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = a * r + L * s, e[1] = i * r + k * s, e[2] = c * r + l * s, e[3] = y * r + M * s, e[4] = L * r - a * s, e[5] = k * r - i * s, e[6] = l * r - c * s, e[7] = M * r - y * s, e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = t[0], e[13] = t[1], e[14] = t[2], e[15] = 1, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = t[1], e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = t[2], e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t, n) { + var s = n[0], + r = n[1], + a = n[2], + i = Math.sqrt(s * s + r * r + a * a); + if (i < 1e-6) return null; + i = 1 / i, s *= i, r *= i, a *= i; + var c = Math.sin(t), + y = Math.cos(t), + L = 1 - y; + return e[0] = s * s * L + y, e[1] = r * s * L + a * c, e[2] = a * s * L - r * c, e[3] = 0, e[4] = s * r * L - a * c, e[5] = r * r * L + y, e[6] = a * r * L + s * c, e[7] = 0, e[8] = s * a * L + r * c, e[9] = r * a * L - s * c, e[10] = a * a * L + y, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromXRotation", + value: function fromXRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = s, e[6] = n, e[7] = 0, e[8] = 0, e[9] = -n, e[10] = s, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromYRotation", + value: function fromYRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = 0, e[2] = -n, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = n, e[9] = 0, e[10] = s, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromZRotation", + value: function fromZRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = 0, e[3] = 0, e[4] = -n, e[5] = s, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = s + s, + y = r + r, + L = a + a, + k = s * c, + l = s * y, + M = s * L, + h = r * y, + b = r * L, + d = a * L, + m = i * c, + x = i * y, + V = i * L; + return e[0] = 1 - (h + d), e[1] = l + V, e[2] = M - x, e[3] = 0, e[4] = l - V, e[5] = 1 - (k + d), e[6] = b + m, e[7] = 0, e[8] = M + x, e[9] = b - m, e[10] = 1 - (k + h), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + } + }, { + key: "fromQuat2", + value: function fromQuat2(e, t) { + var n = -t[0], + s = -t[1], + r = -t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = n * n + s * s + r * r + a * a; + return k > 0 ? (E(D, H)[0] = (i * a + L * n + c * r - y * s) * 2 / k, E(D, H)[1] = (c * a + L * s + y * n - i * r) * 2 / k, E(D, H)[2] = (y * a + L * r + i * s - c * n) * 2 / k) : (E(D, H)[0] = (i * a + L * n + c * r - y * s) * 2, E(D, H)[1] = (c * a + L * s + y * n - i * r) * 2, E(D, H)[2] = (y * a + L * r + i * s - c * n) * 2), D.fromRotationTranslation(e, t, E(D, H)), e; + } + }, { + key: "normalFromMat4", + value: function normalFromMat4(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + M = t[10], + h = t[11], + b = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * i, + o = n * y - r * i, + R = n * L - a * i, + z = s * y - r * c, + g = s * L - a * c, + S = r * L - a * y, + B = k * d - l * b, + N = k * m - M * b, + p = k * x - h * b, + Y = l * m - M * d, + F = l * x - h * d, + P = M * x - h * m, + Q = V * P - o * F + R * Y + z * p - g * N + S * B; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * F + L * Y) * Q, e[1] = (y * p - i * P - L * N) * Q, e[2] = (i * F - c * p + L * B) * Q, e[3] = 0, e[4] = (r * F - s * P - a * Y) * Q, e[5] = (n * P - r * p + a * N) * Q, e[6] = (s * p - n * F - a * B) * Q, e[7] = 0, e[8] = (d * S - m * g + x * z) * Q, e[9] = (m * R - b * S - x * o) * Q, e[10] = (b * g - d * R + x * V) * Q, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e) : null; + } + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[4], + i = t[5], + c = t[6], + y = t[8], + L = t[9], + k = t[10]; + return e[0] = i * k - k * L, e[1] = c * y - y * k, e[2] = a * L - L * y, e[3] = 0, e[4] = L * r - k * s, e[5] = k * n - y * r, e[6] = y * s - L * n, e[7] = 0, e[8] = s * c - r * i, e[9] = r * a - n * c, e[10] = n * i - s * a, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "getTranslation", + value: function getTranslation(e, t) { + return e[0] = t[12], e[1] = t[13], e[2] = t[14], e; + } + }, { + key: "getScaling", + value: function getScaling(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[4], + i = t[5], + c = t[6], + y = t[8], + L = t[9], + k = t[10]; + return e[0] = Math.sqrt(n * n + s * s + r * r), e[1] = Math.sqrt(a * a + i * i + c * c), e[2] = Math.sqrt(y * y + L * L + k * k), e; + } + }, { + key: "getRotation", + value: function getRotation(e, t) { + D.getScaling(E(D, H), t); + var n = 1 / E(D, H)[0], + s = 1 / E(D, H)[1], + r = 1 / E(D, H)[2], + a = t[0] * n, + i = t[1] * s, + c = t[2] * r, + y = t[4] * n, + L = t[5] * s, + k = t[6] * r, + l = t[8] * n, + M = t[9] * s, + h = t[10] * r, + b = a + L + h, + d = 0; + return b > 0 ? (d = Math.sqrt(b + 1) * 2, e[3] = .25 * d, e[0] = (k - M) / d, e[1] = (l - c) / d, e[2] = (i - y) / d) : a > L && a > h ? (d = Math.sqrt(1 + a - L - h) * 2, e[3] = (k - M) / d, e[0] = .25 * d, e[1] = (i + y) / d, e[2] = (l + c) / d) : L > h ? (d = Math.sqrt(1 + L - a - h) * 2, e[3] = (l - c) / d, e[0] = (i + y) / d, e[1] = .25 * d, e[2] = (k + M) / d) : (d = Math.sqrt(1 + h - a - L) * 2, e[3] = (i - y) / d, e[0] = (l + c) / d, e[1] = (k + M) / d, e[2] = .25 * d), e; + } + }, { + key: "decompose", + value: function decompose(e, t, n, s) { + t[0] = s[12], t[1] = s[13], t[2] = s[14]; + var r = s[0], + a = s[1], + i = s[2], + c = s[4], + y = s[5], + L = s[6], + k = s[8], + l = s[9], + M = s[10]; + n[0] = Math.sqrt(r * r + a * a + i * i), n[1] = Math.sqrt(c * c + y * y + L * L), n[2] = Math.sqrt(k * k + l * l + M * M); + var h = 1 / n[0], + b = 1 / n[1], + d = 1 / n[2], + m = r * h, + x = a * b, + V = i * d, + o = c * h, + R = y * b, + z = L * d, + g = k * h, + S = l * b, + B = M * d, + N = m + R + B, + p = 0; + return N > 0 ? (p = Math.sqrt(N + 1) * 2, e[3] = .25 * p, e[0] = (z - S) / p, e[1] = (g - V) / p, e[2] = (x - o) / p) : m > R && m > B ? (p = Math.sqrt(1 + m - R - B) * 2, e[3] = (z - S) / p, e[0] = .25 * p, e[1] = (x + o) / p, e[2] = (g + V) / p) : R > B ? (p = Math.sqrt(1 + R - m - B) * 2, e[3] = (g - V) / p, e[0] = (x + o) / p, e[1] = .25 * p, e[2] = (z + S) / p) : (p = Math.sqrt(1 + B - m - R) * 2, e[3] = (x - o) / p, e[0] = (g + V) / p, e[1] = (z + S) / p, e[2] = .25 * p), e; + } + }, { + key: "fromRotationTranslationScale", + value: function fromRotationTranslationScale(e, t, n, s) { + var r = t[0], + a = t[1], + i = t[2], + c = t[3], + y = r + r, + L = a + a, + k = i + i, + l = r * y, + M = r * L, + h = r * k, + b = a * L, + d = a * k, + m = i * k, + x = c * y, + V = c * L, + o = c * k, + R = s[0], + z = s[1], + g = s[2]; + return e[0] = (1 - (b + m)) * R, e[1] = (M + o) * R, e[2] = (h - V) * R, e[3] = 0, e[4] = (M - o) * z, e[5] = (1 - (l + m)) * z, e[6] = (d + x) * z, e[7] = 0, e[8] = (h + V) * g, e[9] = (d - x) * g, e[10] = (1 - (l + b)) * g, e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + } + }, { + key: "fromRotationTranslationScaleOrigin", + value: function fromRotationTranslationScaleOrigin(e, t, n, s, r) { + var a = t[0], + i = t[1], + c = t[2], + y = t[3], + L = a + a, + k = i + i, + l = c + c, + M = a * L, + h = a * k, + b = a * l, + d = i * k, + m = i * l, + x = c * l, + V = y * L, + o = y * k, + R = y * l, + z = s[0], + g = s[1], + S = s[2], + B = r[0], + N = r[1], + p = r[2], + Y = (1 - (d + x)) * z, + F = (h + R) * z, + P = (b - o) * z, + Q = (h - R) * g, + K = (1 - (M + x)) * g, + ee = (m + V) * g, + te = (b + o) * S, + Me = (m - V) * S, + be = (1 - (M + d)) * S; + return e[0] = Y, e[1] = F, e[2] = P, e[3] = 0, e[4] = Q, e[5] = K, e[6] = ee, e[7] = 0, e[8] = te, e[9] = Me, e[10] = be, e[11] = 0, e[12] = n[0] + B - (Y * B + Q * N + te * p), e[13] = n[1] + N - (F * B + K * N + Me * p), e[14] = n[2] + p - (P * B + ee * N + be * p), e[15] = 1, e; + } + }, { + key: "fromQuat", + value: function fromQuat(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = n + n, + c = s + s, + y = r + r, + L = n * i, + k = s * i, + l = s * c, + M = r * i, + h = r * c, + b = r * y, + d = a * i, + m = a * c, + x = a * y; + return e[0] = 1 - l - b, e[1] = k + x, e[2] = M - m, e[3] = 0, e[4] = k - x, e[5] = 1 - L - b, e[6] = h + d, e[7] = 0, e[8] = M + m, e[9] = h - d, e[10] = 1 - L - l, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "frustumNO", + value: function frustumNO(e, t, n, s, r, a) { + var i = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; + var c = 1 / (n - t), + y = 1 / (r - s); + if (e[0] = a * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, i != null && i !== 1 / 0) { + var L = 1 / (a - i); + e[10] = (i + a) * L, e[14] = 2 * i * a * L; + } else e[10] = -1, e[14] = -2 * a; + return e; + } + }, { + key: "frustum", + value: function frustum(e, t, n, s, r, a) { + return e; + } + }, { + key: "frustumZO", + value: function frustumZO(e, t, n, s, r, a) { + var i = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; + var c = 1 / (n - t), + y = 1 / (r - s); + if (e[0] = a * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, i != null && i !== 1 / 0) { + var L = 1 / (a - i); + e[10] = i * L, e[14] = i * a * L; + } else e[10] = -1, e[14] = -a; + return e; + } + }, { + key: "perspectiveNO", + value: function perspectiveNO(e, t, n, s) { + var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1 / 0; + var a = 1 / Math.tan(t / 2); + if (e[0] = a / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { + var i = 1 / (s - r); + e[10] = (r + s) * i, e[14] = 2 * r * s * i; + } else e[10] = -1, e[14] = -2 * s; + return e; + } + }, { + key: "perspective", + value: function perspective(e, t, n, s) { + return e; + } + }, { + key: "perspectiveZO", + value: function perspectiveZO(e, t, n, s) { + var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1 / 0; + var a = 1 / Math.tan(t / 2); + if (e[0] = a / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { + var i = 1 / (s - r); + e[10] = r * i, e[14] = r * s * i; + } else e[10] = -1, e[14] = -s; + return e; + } + }, { + key: "perspectiveFromFieldOfView", + value: function perspectiveFromFieldOfView(e, t, n, s) { + var r = Math.tan(t.upDegrees * Math.PI / 180), + a = Math.tan(t.downDegrees * Math.PI / 180), + i = Math.tan(t.leftDegrees * Math.PI / 180), + c = Math.tan(t.rightDegrees * Math.PI / 180), + y = 2 / (i + c), + L = 2 / (r + a); + return e[0] = y, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = L, e[6] = 0, e[7] = 0, e[8] = -((i - c) * y * .5), e[9] = (r - a) * L * .5, e[10] = s / (n - s), e[11] = -1, e[12] = 0, e[13] = 0, e[14] = s * n / (n - s), e[15] = 0, e; + } + }, { + key: "orthoNO", + value: function orthoNO(e, t, n, s, r, a, i) { + var c = 1 / (t - n), + y = 1 / (s - r), + L = 1 / (a - i); + return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 2 * L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = (i + a) * L, e[15] = 1, e; + } + }, { + key: "ortho", + value: function ortho(e, t, n, s, r, a, i) { + return e; + } + }, { + key: "orthoZO", + value: function orthoZO(e, t, n, s, r, a, i) { + var c = 1 / (t - n), + y = 1 / (s - r), + L = 1 / (a - i); + return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = a * L, e[15] = 1, e; + } + }, { + key: "lookAt", + value: function lookAt(e, t, n, s) { + var r = t[0], + a = t[1], + i = t[2], + c = s[0], + y = s[1], + L = s[2], + k = n[0], + l = n[1], + M = n[2]; + if (Math.abs(r - k) < 1e-6 && Math.abs(a - l) < 1e-6 && Math.abs(i - M) < 1e-6) return D.identity(e); + var h = r - k, + b = a - l, + d = i - M, + m = 1 / Math.sqrt(h * h + b * b + d * d); + h *= m, b *= m, d *= m; + var x = y * d - L * b, + V = L * h - c * d, + o = c * b - y * h; + m = Math.sqrt(x * x + V * V + o * o), m ? (m = 1 / m, x *= m, V *= m, o *= m) : (x = 0, V = 0, o = 0); + var R = b * o - d * V, + z = d * x - h * o, + g = h * V - b * x; + return m = Math.sqrt(R * R + z * z + g * g), m ? (m = 1 / m, R *= m, z *= m, g *= m) : (R = 0, z = 0, g = 0), e[0] = x, e[1] = R, e[2] = h, e[3] = 0, e[4] = V, e[5] = z, e[6] = b, e[7] = 0, e[8] = o, e[9] = g, e[10] = d, e[11] = 0, e[12] = -(x * r + V * a + o * i), e[13] = -(R * r + z * a + g * i), e[14] = -(h * r + b * a + d * i), e[15] = 1, e; + } + }, { + key: "targetTo", + value: function targetTo(e, t, n, s) { + var r = t[0], + a = t[1], + i = t[2], + c = s[0], + y = s[1], + L = s[2], + k = r - n[0], + l = a - n[1], + M = i - n[2], + h = k * k + l * l + M * M; + h > 0 && (h = 1 / Math.sqrt(h), k *= h, l *= h, M *= h); + var b = y * M - L * l, + d = L * k - c * M, + m = c * l - y * k; + return h = b * b + d * d + m * m, h > 0 && (h = 1 / Math.sqrt(h), b *= h, d *= h, m *= h), e[0] = b, e[1] = d, e[2] = m, e[3] = 0, e[4] = l * m - M * d, e[5] = M * b - k * m, e[6] = k * d - l * b, e[7] = 0, e[8] = k, e[9] = l, e[10] = M, e[11] = 0, e[12] = r, e[13] = a, e[14] = i, e[15] = 1, e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3] + e[4] * e[4] + e[5] * e[5] + e[6] * e[6] + e[7] * e[7] + e[8] * e[8] + e[9] * e[9] + e[10] * e[10] + e[11] * e[11] + e[12] * e[12] + e[13] * e[13] + e[14] * e[14] + e[15] * e[15]); + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e[6] = t[6] + n[6], e[7] = t[7] + n[7], e[8] = t[8] + n[8], e[9] = t[9] + n[9], e[10] = t[10] + n[10], e[11] = t[11] + n[11], e[12] = t[12] + n[12], e[13] = t[13] + n[13], e[14] = t[14] + n[14], e[15] = t[15] + n[15], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e[4] = t[4] - n[4], e[5] = t[5] - n[5], e[6] = t[6] - n[6], e[7] = t[7] - n[7], e[8] = t[8] - n[8], e[9] = t[9] - n[9], e[10] = t[10] - n[10], e[11] = t[11] - n[11], e[12] = t[12] - n[12], e[13] = t[13] - n[13], e[14] = t[14] - n[14], e[15] = t[15] - n[15], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e[6] = t[6] * n, e[7] = t[7] * n, e[8] = t[8] * n, e[9] = t[9] * n, e[10] = t[10] * n, e[11] = t[11] * n, e[12] = t[12] * n, e[13] = t[13] * n, e[14] = t[14] * n, e[15] = t[15] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e[4] = t[4] + n[4] * s, e[5] = t[5] + n[5] * s, e[6] = t[6] + n[6] * s, e[7] = t[7] + n[7] * s, e[8] = t[8] + n[8] * s, e[9] = t[9] + n[9] * s, e[10] = t[10] + n[10] * s, e[11] = t[11] + n[11] * s, e[12] = t[12] + n[12] * s, e[13] = t[13] + n[13] * s, e[14] = t[14] + n[14] * s, e[15] = t[15] + n[15] * s, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7] && e[8] === t[8] && e[9] === t[9] && e[10] === t[10] && e[11] === t[11] && e[12] === t[12] && e[13] === t[13] && e[14] === t[14] && e[15] === t[15]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = e[3], + i = e[4], + c = e[5], + y = e[6], + L = e[7], + k = e[8], + l = e[9], + M = e[10], + h = e[11], + b = e[12], + d = e[13], + m = e[14], + x = e[15], + V = t[0], + o = t[1], + R = t[2], + z = t[3], + g = t[4], + S = t[5], + B = t[6], + N = t[7], + p = t[8], + Y = t[9], + F = t[10], + P = t[11], + Q = t[12], + K = t[13], + ee = t[14], + te = t[15]; + return Math.abs(n - V) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(V)) && Math.abs(s - o) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(o)) && Math.abs(r - R) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(R)) && Math.abs(a - z) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(z)) && Math.abs(i - g) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(g)) && Math.abs(c - S) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(S)) && Math.abs(y - B) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(B)) && Math.abs(L - N) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(N)) && Math.abs(k - p) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(p)) && Math.abs(l - Y) <= 1e-6 * Math.max(1, Math.abs(l), Math.abs(Y)) && Math.abs(M - F) <= 1e-6 * Math.max(1, Math.abs(M), Math.abs(F)) && Math.abs(h - P) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(P)) && Math.abs(b - Q) <= 1e-6 * Math.max(1, Math.abs(b), Math.abs(Q)) && Math.abs(d - K) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(K)) && Math.abs(m - ee) <= 1e-6 * Math.max(1, Math.abs(m), Math.abs(ee)) && Math.abs(x - te) <= 1e-6 * Math.max(1, Math.abs(x), Math.abs(te)); + } + }, { + key: "str", + value: function str(e) { + return "Mat4(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + ae = new WeakMap(), H = new WeakMap(), Z(D, ae, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(D, H, new Float32Array(3)); + var G = D; + G.prototype.mul = G.prototype.multiply; + G.sub = G.subtract; + G.mul = G.multiply; + G.frustum = G.frustumNO; + G.perspective = G.perspectiveNO; + G.ortho = G.orthoNO; + var T = /*#__PURE__*/function (_Float32Array5) { + function A() { + var _this5; + _classCallCheck(this, A); + for (var _len9 = arguments.length, e = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { + e[_key9] = arguments[_key9]; + } + switch (e.length) { + case 3: + _this5 = _callSuper(this, A, [e]); + break; + case 2: + _this5 = _callSuper(this, A, [e[0], e[1], 3]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this5 = _callSuper(this, A, [[t, t, t]]) : _this5 = _callSuper(this, A, [t, 0, 3]); + break; + } + default: + _this5 = _callSuper(this, A, [3]); + break; + } + return _assertThisInitialized(_this5); + } + _inherits(A, _Float32Array5); + return _createClass(A, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "magnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2]; + return Math.sqrt(e * e + t * t + n * n); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "squaredMagnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2]; + return e * e + t * t + n * n; + } + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + }, { + key: "str", + get: function get() { + return A.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "add", + value: function add(e) { + return this[0] += e[0], this[1] += e[1], this[2] += e[2], this; + } + }, { + key: "subtract", + value: function subtract(e) { + return this[0] -= e[0], this[1] -= e[1], this[2] -= e[2], this; + } + }, { + key: "sub", + value: function sub(e) { + return this; + } + }, { + key: "multiply", + value: function multiply(e) { + return this[0] *= e[0], this[1] *= e[1], this[2] *= e[2], this; + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "divide", + value: function divide(e) { + return this[0] /= e[0], this[1] /= e[1], this[2] /= e[2], this; + } + }, { + key: "div", + value: function div(e) { + return this; + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this[2] *= e, this; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t) { + return this[0] += e[0] * t, this[1] += e[1] * t, this[2] += e[2] * t, this; + } + }, { + key: "distance", + value: function distance(e) { + return A.distance(this, e); + } + }, { + key: "dist", + value: function dist(e) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e) { + return A.squaredDistance(this, e); + } + }, { + key: "sqrDist", + value: function sqrDist(e) { + return 0; + } + }, { + key: "negate", + value: function negate() { + return this[0] *= -1, this[1] *= -1, this[2] *= -1, this; + } + }, { + key: "invert", + value: function invert() { + return this[0] = 1 / this[0], this[1] = 1 / this[1], this[2] = 1 / this[2], this; + } + }, { + key: "abs", + value: function abs() { + return this[0] = Math.abs(this[0]), this[1] = Math.abs(this[1]), this[2] = Math.abs(this[2]), this; + } + }, { + key: "dot", + value: function dot(e) { + return this[0] * e[0] + this[1] * e[1] + this[2] * e[2]; + } + }, { + key: "normalize", + value: function normalize() { + return A.normalize(this, this); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 3 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new A(); + } + }, { + key: "clone", + value: function clone(e) { + return new A(e); + } + }, { + key: "magnitude", + value: function magnitude(e) { + var t = e[0], + n = e[1], + s = e[2]; + return Math.sqrt(t * t + n * n + s * s); + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "fromValues", + value: function fromValues(e, t, n) { + return new A(e, t, n); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e; + } + }, { + key: "set", + value: function set(e, t, n, s) { + return e[0] = t, e[1] = n, e[2] = s, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return [0, 0, 0]; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + return e[0] = t[0] * n[0], e[1] = t[1] * n[1], e[2] = t[2] * n[2], e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return [0, 0, 0]; + } + }, { + key: "divide", + value: function divide(e, t, n) { + return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e[2] = t[2] / n[2], e; + } + }, { + key: "div", + value: function div(e, t, n) { + return [0, 0, 0]; + } + }, { + key: "ceil", + value: function ceil(e, t) { + return e[0] = Math.ceil(t[0]), e[1] = Math.ceil(t[1]), e[2] = Math.ceil(t[2]), e; + } + }, { + key: "floor", + value: function floor(e, t) { + return e[0] = Math.floor(t[0]), e[1] = Math.floor(t[1]), e[2] = Math.floor(t[2]), e; + } + }, { + key: "min", + value: function min(e, t, n) { + return e[0] = Math.min(t[0], n[0]), e[1] = Math.min(t[1], n[1]), e[2] = Math.min(t[2], n[2]), e; + } + }, { + key: "max", + value: function max(e, t, n) { + return e[0] = Math.max(t[0], n[0]), e[1] = Math.max(t[1], n[1]), e[2] = Math.max(t[2], n[2]), e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e; + } + }, { + key: "distance", + value: function distance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2]; + return Math.sqrt(n * n + s * s + r * r); + } + }, { + key: "dist", + value: function dist(e, t) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2]; + return n * n + s * s + r * r; + } + }, { + key: "sqrDist", + value: function sqrDist(e, t) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + var t = e[0], + n = e[1], + s = e[2]; + return t * t + n * n + s * s; + } + }, { + key: "sqrLen", + value: function sqrLen(e, t) { + return 0; + } + }, { + key: "negate", + value: function negate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e; + } + }, { + key: "inverse", + value: function inverse(e, t) { + return e[0] = 1 / t[0], e[1] = 1 / t[1], e[2] = 1 / t[2], e; + } + }, { + key: "abs", + value: function abs(e, t) { + return e[0] = Math.abs(t[0]), e[1] = Math.abs(t[1]), e[2] = Math.abs(t[2]), e; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = n * n + s * s + r * r; + return a > 0 && (a = 1 / Math.sqrt(a)), e[0] = t[0] * a, e[1] = t[1] * a, e[2] = t[2] * a, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1] + e[2] * t[2]; + } + }, { + key: "cross", + value: function cross(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = n[0], + c = n[1], + y = n[2]; + return e[0] = r * y - a * c, e[1] = a * i - s * y, e[2] = s * c - r * i, e; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = t[0], + a = t[1], + i = t[2]; + return e[0] = r + s * (n[0] - r), e[1] = a + s * (n[1] - a), e[2] = i + s * (n[2] - i), e; + } + }, { + key: "slerp", + value: function slerp(e, t, n, s) { + var r = Math.acos(Math.min(Math.max(A.dot(t, n), -1), 1)), + a = Math.sin(r), + i = Math.sin((1 - s) * r) / a, + c = Math.sin(s * r) / a; + return e[0] = i * t[0] + c * n[0], e[1] = i * t[1] + c * n[1], e[2] = i * t[2] + c * n[2], e; + } + }, { + key: "hermite", + value: function hermite(e, t, n, s, r, a) { + var i = a * a, + c = i * (2 * a - 3) + 1, + y = i * (a - 2) + a, + L = i * (a - 1), + k = i * (3 - 2 * a); + return e[0] = t[0] * c + n[0] * y + s[0] * L + r[0] * k, e[1] = t[1] * c + n[1] * y + s[1] * L + r[1] * k, e[2] = t[2] * c + n[2] * y + s[2] * L + r[2] * k, e; + } + }, { + key: "bezier", + value: function bezier(e, t, n, s, r, a) { + var i = 1 - a, + c = i * i, + y = a * a, + L = c * i, + k = 3 * a * c, + l = 3 * y * i, + M = y * a; + return e[0] = t[0] * L + n[0] * k + s[0] * l + r[0] * M, e[1] = t[1] * L + n[1] * k + s[1] * l + r[1] * M, e[2] = t[2] * L + n[2] * k + s[2] * l + r[2] * M, e; + } + }, { + key: "transformMat4", + value: function transformMat4(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = n[3] * s + n[7] * r + n[11] * a + n[15] || 1; + return e[0] = (n[0] * s + n[4] * r + n[8] * a + n[12]) / i, e[1] = (n[1] * s + n[5] * r + n[9] * a + n[13]) / i, e[2] = (n[2] * s + n[6] * r + n[10] * a + n[14]) / i, e; + } + }, { + key: "transformMat3", + value: function transformMat3(e, t, n) { + var s = t[0], + r = t[1], + a = t[2]; + return e[0] = s * n[0] + r * n[3] + a * n[6], e[1] = s * n[1] + r * n[4] + a * n[7], e[2] = s * n[2] + r * n[5] + a * n[8], e; + } + }, { + key: "transformQuat", + value: function transformQuat(e, t, n) { + var s = n[0], + r = n[1], + a = n[2], + i = n[3] * 2, + c = t[0], + y = t[1], + L = t[2], + k = r * L - a * y, + l = a * c - s * L, + M = s * y - r * c, + h = (r * M - a * l) * 2, + b = (a * k - s * M) * 2, + d = (s * l - r * k) * 2; + return e[0] = c + k * i + h, e[1] = y + l * i + b, e[2] = L + M * i + d, e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n, s) { + var r = n[1], + a = n[2], + i = t[1] - r, + c = t[2] - a; + return e[0] = t[0], e[1] = i * Math.cos(s) - c * Math.sin(s) + r, e[2] = i * Math.sin(s) + c * Math.cos(s) + a, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n, s) { + var r = n[0], + a = n[2], + i = t[0] - r, + c = t[2] - a; + return e[0] = c * Math.sin(s) + i * Math.cos(s) + r, e[1] = t[1], e[2] = c * Math.cos(s) - i * Math.sin(s) + a, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n, s) { + var r = n[0], + a = n[1], + i = t[0] - r, + c = t[1] - a; + return e[0] = i * Math.cos(s) - c * Math.sin(s) + r, e[1] = i * Math.sin(s) + c * Math.cos(s) + a, e[2] = n[2], e; + } + }, { + key: "angle", + value: function angle(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = t[0], + i = t[1], + c = t[2], + y = Math.sqrt((n * n + s * s + r * r) * (a * a + i * i + c * c)), + L = y && A.dot(e, t) / y; + return Math.acos(Math.min(Math.max(L, -1), 1)); + } + }, { + key: "zero", + value: function zero(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e; + } + }, { + key: "str", + value: function str(e) { + return "Vec3(".concat(e.join(", "), ")"); + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = t[0], + i = t[1], + c = t[2]; + return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - i) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(i)) && Math.abs(r - c) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(c)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + T.prototype.sub = T.prototype.subtract; + T.prototype.mul = T.prototype.multiply; + T.prototype.div = T.prototype.divide; + T.prototype.dist = T.prototype.distance; + T.prototype.sqrDist = T.prototype.squaredDistance; + T.sub = T.subtract; + T.mul = T.multiply; + T.div = T.divide; + T.dist = T.distance; + T.sqrDist = T.squaredDistance; + T.sqrLen = T.squaredLength; + T.mag = T.magnitude; + T.length = T.magnitude; + T.len = T.magnitude; + var q = /*#__PURE__*/function (_Float32Array6) { + function A() { + var _this6; + _classCallCheck(this, A); + for (var _len10 = arguments.length, e = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { + e[_key10] = arguments[_key10]; + } + switch (e.length) { + case 4: + _this6 = _callSuper(this, A, [e]); + break; + case 2: + _this6 = _callSuper(this, A, [e[0], e[1], 4]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this6 = _callSuper(this, A, [[t, t, t, t]]) : _this6 = _callSuper(this, A, [t, 0, 4]); + break; + } + default: + _this6 = _callSuper(this, A, [4]); + break; + } + return _assertThisInitialized(_this6); + } + _inherits(A, _Float32Array6); + return _createClass(A, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(e) { + this[3] = e; + } + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "a", + get: function get() { + return this[3]; + }, + set: function set(e) { + this[3] = e; + } + }, { + key: "magnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2], + s = this[3]; + return Math.sqrt(e * e + t * t + n * n + s * s); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "str", + get: function get() { + return A.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return _get(_getPrototypeOf(A.prototype), "set", this).call(this, e), this; + } + }, { + key: "add", + value: function add(e) { + return this[0] += e[0], this[1] += e[1], this[2] += e[2], this[3] += e[3], this; + } + }, { + key: "subtract", + value: function subtract(e) { + return this[0] -= e[0], this[1] -= e[1], this[2] -= e[2], this[3] -= e[3], this; + } + }, { + key: "sub", + value: function sub(e) { + return this; + } + }, { + key: "multiply", + value: function multiply(e) { + return this[0] *= e[0], this[1] *= e[1], this[2] *= e[2], this[3] *= e[3], this; + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "divide", + value: function divide(e) { + return this[0] /= e[0], this[1] /= e[1], this[2] /= e[2], this[3] /= e[3], this; + } + }, { + key: "div", + value: function div(e) { + return this; + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this[2] *= e, this[3] *= e, this; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t) { + return this[0] += e[0] * t, this[1] += e[1] * t, this[2] += e[2] * t, this[3] += e[3] * t, this; + } + }, { + key: "distance", + value: function distance(e) { + return A.distance(this, e); + } + }, { + key: "dist", + value: function dist(e) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e) { + return A.squaredDistance(this, e); + } + }, { + key: "sqrDist", + value: function sqrDist(e) { + return 0; + } + }, { + key: "negate", + value: function negate() { + return this[0] *= -1, this[1] *= -1, this[2] *= -1, this[3] *= -1, this; + } + }, { + key: "invert", + value: function invert() { + return this[0] = 1 / this[0], this[1] = 1 / this[1], this[2] = 1 / this[2], this[3] = 1 / this[3], this; + } + }, { + key: "abs", + value: function abs() { + return this[0] = Math.abs(this[0]), this[1] = Math.abs(this[1]), this[2] = Math.abs(this[2]), this[3] = Math.abs(this[3]), this; + } + }, { + key: "dot", + value: function dot(e) { + return this[0] * e[0] + this[1] * e[1] + this[2] * e[2] + this[3] * e[3]; + } + }, { + key: "normalize", + value: function normalize() { + return A.normalize(this, this); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new A(); + } + }, { + key: "clone", + value: function clone(e) { + return new A(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t, n, s) { + return new A(e, t, n, s); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "set", + value: function set(e, t, n, s, r) { + return e[0] = t, e[1] = n, e[2] = s, e[3] = r, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + return e[0] = t[0] * n[0], e[1] = t[1] * n[1], e[2] = t[2] * n[2], e[3] = t[3] * n[3], e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "divide", + value: function divide(e, t, n) { + return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e[2] = t[2] / n[2], e[3] = t[3] / n[3], e; + } + }, { + key: "div", + value: function div(e, t, n) { + return e; + } + }, { + key: "ceil", + value: function ceil(e, t) { + return e[0] = Math.ceil(t[0]), e[1] = Math.ceil(t[1]), e[2] = Math.ceil(t[2]), e[3] = Math.ceil(t[3]), e; + } + }, { + key: "floor", + value: function floor(e, t) { + return e[0] = Math.floor(t[0]), e[1] = Math.floor(t[1]), e[2] = Math.floor(t[2]), e[3] = Math.floor(t[3]), e; + } + }, { + key: "min", + value: function min(e, t, n) { + return e[0] = Math.min(t[0], n[0]), e[1] = Math.min(t[1], n[1]), e[2] = Math.min(t[2], n[2]), e[3] = Math.min(t[3], n[3]), e; + } + }, { + key: "max", + value: function max(e, t, n) { + return e[0] = Math.max(t[0], n[0]), e[1] = Math.max(t[1], n[1]), e[2] = Math.max(t[2], n[2]), e[3] = Math.max(t[3], n[3]), e; + } + }, { + key: "round", + value: function round(e, t) { + return e[0] = Math.round(t[0]), e[1] = Math.round(t[1]), e[2] = Math.round(t[2]), e[3] = Math.round(t[3]), e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e; + } + }, { + key: "distance", + value: function distance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2], + a = t[3] - e[3]; + return Math.hypot(n, s, r, a); + } + }, { + key: "dist", + value: function dist(e, t) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2], + a = t[3] - e[3]; + return n * n + s * s + r * r + a * a; + } + }, { + key: "sqrDist", + value: function sqrDist(e, t) { + return 0; + } + }, { + key: "magnitude", + value: function magnitude(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3]; + return Math.sqrt(t * t + n * n + s * s + r * r); + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3]; + return t * t + n * n + s * s + r * r; + } + }, { + key: "sqrLen", + value: function sqrLen(e) { + return 0; + } + }, { + key: "negate", + value: function negate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = -t[3], e; + } + }, { + key: "inverse", + value: function inverse(e, t) { + return e[0] = 1 / t[0], e[1] = 1 / t[1], e[2] = 1 / t[2], e[3] = 1 / t[3], e; + } + }, { + key: "abs", + value: function abs(e, t) { + return e[0] = Math.abs(t[0]), e[1] = Math.abs(t[1]), e[2] = Math.abs(t[2]), e[3] = Math.abs(t[3]), e; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = n * n + s * s + r * r + a * a; + return i > 0 && (i = 1 / Math.sqrt(i)), e[0] = n * i, e[1] = s * i, e[2] = r * i, e[3] = a * i, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3]; + } + }, { + key: "cross", + value: function cross(e, t, n, s) { + var r = n[0] * s[1] - n[1] * s[0], + a = n[0] * s[2] - n[2] * s[0], + i = n[0] * s[3] - n[3] * s[0], + c = n[1] * s[2] - n[2] * s[1], + y = n[1] * s[3] - n[3] * s[1], + L = n[2] * s[3] - n[3] * s[2], + k = t[0], + l = t[1], + M = t[2], + h = t[3]; + return e[0] = l * L - M * y + h * c, e[1] = -(k * L) + M * i - h * a, e[2] = k * y - l * i + h * r, e[3] = -(k * c) + l * a - M * r, e; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = t[0], + a = t[1], + i = t[2], + c = t[3]; + return e[0] = r + s * (n[0] - r), e[1] = a + s * (n[1] - a), e[2] = i + s * (n[2] - i), e[3] = c + s * (n[3] - c), e; + } + }, { + key: "transformMat4", + value: function transformMat4(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3]; + return e[0] = n[0] * s + n[4] * r + n[8] * a + n[12] * i, e[1] = n[1] * s + n[5] * r + n[9] * a + n[13] * i, e[2] = n[2] * s + n[6] * r + n[10] * a + n[14] * i, e[3] = n[3] * s + n[7] * r + n[11] * a + n[15] * i, e; + } + }, { + key: "transformQuat", + value: function transformQuat(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = n[0], + c = n[1], + y = n[2], + L = n[3], + k = L * s + c * a - y * r, + l = L * r + y * s - i * a, + M = L * a + i * r - c * s, + h = -i * s - c * r - y * a; + return e[0] = k * L + h * -i + l * -y - M * -c, e[1] = l * L + h * -c + M * -i - k * -y, e[2] = M * L + h * -y + k * -c - l * -i, e[3] = t[3], e; + } + }, { + key: "zero", + value: function zero(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 0, e; + } + }, { + key: "str", + value: function str(e) { + return "Vec4(".concat(e.join(", "), ")"); + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = e[3], + i = t[0], + c = t[1], + y = t[2], + L = t[3]; + return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(a - L) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(L)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + q.prototype.sub = q.prototype.subtract; + q.prototype.mul = q.prototype.multiply; + q.prototype.div = q.prototype.divide; + q.prototype.dist = q.prototype.distance; + q.prototype.sqrDist = q.prototype.squaredDistance; + q.sub = q.subtract; + q.mul = q.multiply; + q.div = q.divide; + q.dist = q.distance; + q.sqrDist = q.squaredDistance; + q.sqrLen = q.squaredLength; + q.mag = q.magnitude; + q.length = q.magnitude; + q.len = q.magnitude; + var ke, + ie, + ce, + W, + U, + le, + he, + f = /*#__PURE__*/function (_Float32Array7) { + function f() { + var _this7; + _classCallCheck(this, f); + for (var _len11 = arguments.length, e = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { + e[_key11] = arguments[_key11]; + } + switch (e.length) { + case 4: + _this7 = _callSuper(this, f, [e]); + break; + case 2: + _this7 = _callSuper(this, f, [e[0], e[1], 4]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this7 = _callSuper(this, f, [[t, t, t, t]]) : _this7 = _callSuper(this, f, [t, 0, 4]); + break; + } + default: + _this7 = _callSuper(this, f, [4]), _this7[3] = 1; + break; + } + return _assertThisInitialized(_this7); + } + _inherits(f, _Float32Array7); + return _createClass(f, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(e) { + this[3] = e; + } + }, { + key: "magnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2], + s = this[3]; + return Math.sqrt(e * e + t * t + n * n + s * s); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "str", + get: function get() { + return f.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return _get(_getPrototypeOf(f.prototype), "set", this).call(this, e), this; + } + }, { + key: "identity", + value: function identity() { + return this[0] = 0, this[1] = 0, this[2] = 0, this[3] = 1, this; + } + }, { + key: "multiply", + value: function multiply(e) { + return f.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "rotateX", + value: function rotateX(e) { + return f.rotateX(this, this, e); + } + }, { + key: "rotateY", + value: function rotateY(e) { + return f.rotateY(this, this, e); + } + }, { + key: "rotateZ", + value: function rotateZ(e) { + return f.rotateZ(this, this, e); + } + }, { + key: "invert", + value: function invert() { + return f.invert(this, this); + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this[2] *= e, this[3] *= e, this; + } + }, { + key: "dot", + value: function dot(e) { + return f.dot(this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new f(); + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e; + } + }, { + key: "setAxisAngle", + value: function setAxisAngle(e, t, n) { + n = n * .5; + var s = Math.sin(n); + return e[0] = s * t[0], e[1] = s * t[1], e[2] = s * t[2], e[3] = Math.cos(n), e; + } + }, { + key: "getAxisAngle", + value: function getAxisAngle(e, t) { + var n = Math.acos(t[3]) * 2, + s = Math.sin(n / 2); + return s > 1e-6 ? (e[0] = t[0] / s, e[1] = t[1] / s, e[2] = t[2] / s) : (e[0] = 1, e[1] = 0, e[2] = 0), n; + } + }, { + key: "getAngle", + value: function getAngle(e, t) { + var n = f.dot(e, t); + return Math.acos(2 * n * n - 1); + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = n[0], + y = n[1], + L = n[2], + k = n[3]; + return e[0] = s * k + i * c + r * L - a * y, e[1] = r * k + i * y + a * c - s * L, e[2] = a * k + i * L + s * y - r * c, e[3] = i * k - s * c - r * y - a * L, e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n) { + n *= .5; + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y + i * c, e[1] = r * y + a * c, e[2] = a * y - r * c, e[3] = i * y - s * c, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n) { + n *= .5; + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y - a * c, e[1] = r * y + i * c, e[2] = a * y + s * c, e[3] = i * y - r * c, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n) { + n *= .5; + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y + r * c, e[1] = r * y - s * c, e[2] = a * y + i * c, e[3] = i * y - a * c, e; + } + }, { + key: "calculateW", + value: function calculateW(e, t) { + var n = t[0], + s = t[1], + r = t[2]; + return e[0] = n, e[1] = s, e[2] = r, e[3] = Math.sqrt(Math.abs(1 - n * n - s * s - r * r)), e; + } + }, { + key: "exp", + value: function exp(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = Math.sqrt(n * n + s * s + r * r), + c = Math.exp(a), + y = i > 0 ? c * Math.sin(i) / i : 0; + return e[0] = n * y, e[1] = s * y, e[2] = r * y, e[3] = c * Math.cos(i), e; + } + }, { + key: "ln", + value: function ln(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = Math.sqrt(n * n + s * s + r * r), + c = i > 0 ? Math.atan2(i, a) / i : 0; + return e[0] = n * c, e[1] = s * c, e[2] = r * c, e[3] = .5 * Math.log(n * n + s * s + r * r + a * a), e; + } + }, { + key: "pow", + value: function pow(e, t, n) { + return f.ln(e, t), f.scale(e, e, n), f.exp(e, e), e; + } + }, { + key: "slerp", + value: function slerp(e, t, n, s) { + var r = t[0], + a = t[1], + i = t[2], + c = t[3], + y = n[0], + L = n[1], + k = n[2], + l = n[3], + M, + h, + b = r * y + a * L + i * k + c * l; + if (b < 0 && (b = -b, y = -y, L = -L, k = -k, l = -l), 1 - b > 1e-6) { + var d = Math.acos(b), + m = Math.sin(d); + M = Math.sin((1 - s) * d) / m, h = Math.sin(s * d) / m; + } else M = 1 - s, h = s; + return e[0] = M * r + h * y, e[1] = M * a + h * L, e[2] = M * i + h * k, e[3] = M * c + h * l, e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + a = t[3], + i = n * n + s * s + r * r + a * a, + c = i ? 1 / i : 0; + return e[0] = -n * c, e[1] = -s * c, e[2] = -r * c, e[3] = a * c, e; + } + }, { + key: "conjugate", + value: function conjugate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = t[3], e; + } + }, { + key: "fromMat3", + value: function fromMat3(e, t) { + var n = t[0] + t[4] + t[8], + s; + if (n > 0) s = Math.sqrt(n + 1), e[3] = .5 * s, s = .5 / s, e[0] = (t[5] - t[7]) * s, e[1] = (t[6] - t[2]) * s, e[2] = (t[1] - t[3]) * s;else { + var r = 0; + t[4] > t[0] && (r = 1), t[8] > t[r * 3 + r] && (r = 2); + var a = (r + 1) % 3, + i = (r + 2) % 3; + s = Math.sqrt(t[r * 3 + r] - t[a * 3 + a] - t[i * 3 + i] + 1), e[r] = .5 * s, s = .5 / s, e[3] = (t[a * 3 + i] - t[i * 3 + a]) * s, e[a] = (t[a * 3 + r] + t[r * 3 + a]) * s, e[i] = (t[i * 3 + r] + t[r * 3 + i]) * s; + } + return e; + } + }, { + key: "fromEuler", + value: function fromEuler(e, t, n, s) { + var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : E(f, ke); + var a = .5 * Math.PI / 180; + t *= a, n *= a, s *= a; + var i = Math.sin(t), + c = Math.cos(t), + y = Math.sin(n), + L = Math.cos(n), + k = Math.sin(s), + l = Math.cos(s); + switch (r) { + case "xyz": + e[0] = i * L * l + c * y * k, e[1] = c * y * l - i * L * k, e[2] = c * L * k + i * y * l, e[3] = c * L * l - i * y * k; + break; + case "xzy": + e[0] = i * L * l - c * y * k, e[1] = c * y * l - i * L * k, e[2] = c * L * k + i * y * l, e[3] = c * L * l + i * y * k; + break; + case "yxz": + e[0] = i * L * l + c * y * k, e[1] = c * y * l - i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l + i * y * k; + break; + case "yzx": + e[0] = i * L * l + c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l - i * y * k; + break; + case "zxy": + e[0] = i * L * l - c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k + i * y * l, e[3] = c * L * l - i * y * k; + break; + case "zyx": + e[0] = i * L * l - c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l + i * y * k; + break; + default: + throw new Error("Unknown angle order " + r); + } + return e; + } + }, { + key: "str", + value: function str(e) { + return "Quat(".concat(e.join(", "), ")"); + } + }, { + key: "clone", + value: function clone(e) { + return new f(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t, n, s) { + return new f(e, t, n, s); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "set", + value: function set(e, t, n, s, r) { + return e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3]; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + return e; + } + }, { + key: "magnitude", + value: function magnitude(e) { + return 0; + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + return 0; + } + }, { + key: "sqrLen", + value: function sqrLen(e) { + return 0; + } + }, { + key: "normalize", + value: function normalize(e, t) { + return e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return !1; + } + }, { + key: "equals", + value: function equals(e, t) { + return !1; + } + }, { + key: "rotationTo", + value: function rotationTo(e, t, n) { + var s = T.dot(t, n); + return s < -.999999 ? (T.cross(E(f, U), E(f, le), t), T.mag(E(f, U)) < 1e-6 && T.cross(E(f, U), E(f, he), t), T.normalize(E(f, U), E(f, U)), f.setAxisAngle(e, E(f, U), Math.PI), e) : s > .999999 ? (e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e) : (T.cross(E(f, U), t, n), e[0] = E(f, U)[0], e[1] = E(f, U)[1], e[2] = E(f, U)[2], e[3] = 1 + s, f.normalize(e, e)); + } + }, { + key: "sqlerp", + value: function sqlerp(e, t, n, s, r, a) { + return f.slerp(E(f, ie), t, r, a), f.slerp(E(f, ce), n, s, a), f.slerp(e, E(f, ie), E(f, ce), 2 * a * (1 - a)), e; + } + }, { + key: "setAxes", + value: function setAxes(e, t, n, s) { + return E(f, W)[0] = n[0], E(f, W)[3] = n[1], E(f, W)[6] = n[2], E(f, W)[1] = s[0], E(f, W)[4] = s[1], E(f, W)[7] = s[2], E(f, W)[2] = -t[0], E(f, W)[5] = -t[1], E(f, W)[8] = -t[2], f.normalize(e, f.fromMat3(e, E(f, W))); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + ke = new WeakMap(), ie = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), U = new WeakMap(), le = new WeakMap(), he = new WeakMap(), Z(f, ke, "zyx"), Z(f, ie, new Float32Array(4)), Z(f, ce, new Float32Array(4)), Z(f, W, new Float32Array(9)), Z(f, U, new Float32Array(3)), Z(f, le, new Float32Array([1, 0, 0])), Z(f, he, new Float32Array([0, 1, 0])); + var O = f; + O.set = q.set; + O.add = q.add; + O.lerp = q.lerp; + O.normalize = q.normalize; + O.squaredLength = q.squaredLength; + O.sqrLen = q.squaredLength; + O.exactEquals = q.exactEquals; + O.equals = q.equals; + O.magnitude = q.magnitude; + O.prototype.mul = O.prototype.multiply; + O.mul = O.multiply; + O.mag = O.magnitude; + O.length = O.magnitude; + O.len = O.magnitude; + var ye, + Le, + j = /*#__PURE__*/function (_Float32Array8) { + function j() { + var _this8; + _classCallCheck(this, j); + for (var _len12 = arguments.length, e = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { + e[_key12] = arguments[_key12]; + } + switch (e.length) { + case 8: + _this8 = _callSuper(this, j, [e]); + break; + case 2: + _this8 = _callSuper(this, j, [e[0], e[1], 8]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this8 = _callSuper(this, j, [[t, t, t, t, t, t, t, t]]) : _this8 = _callSuper(this, j, [t, 0, 8]); + break; + } + default: + _this8 = _callSuper(this, j, [8]), _this8[3] = 1; + break; + } + return _assertThisInitialized(_this8); + } + _inherits(j, _Float32Array8); + return _createClass(j, [{ + key: "str", + get: function get() { + return j.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return _get(_getPrototypeOf(j.prototype), "set", this).call(this, e), this; + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 8 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new j(); + } + }, { + key: "clone", + value: function clone(e) { + return new j(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t, n, s, r, a, i, c) { + return new j(e, t, n, s, r, a, i, c); + } + }, { + key: "fromRotationTranslationValues", + value: function fromRotationTranslationValues(e, t, n, s, r, a, i) { + var c = r * .5, + y = a * .5, + L = i * .5; + return new j(e, t, n, s, c * s + y * n - L * t, y * s + L * e - c * n, L * s + c * t - y * e, -c * e - y * t - L * n); + } + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(e, t, n) { + var s = n[0] * .5, + r = n[1] * .5, + a = n[2] * .5, + i = t[0], + c = t[1], + y = t[2], + L = t[3]; + return e[0] = i, e[1] = c, e[2] = y, e[3] = L, e[4] = s * L + r * y - a * c, e[5] = r * L + a * i - s * y, e[6] = a * L + s * c - r * i, e[7] = -s * i - r * c - a * y, e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = t[0] * .5, e[5] = t[1] * .5, e[6] = t[2] * .5, e[7] = 0, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = 0, e[5] = 0, e[6] = 0, e[7] = 0, e; + } + }, { + key: "fromMat4", + value: function fromMat4(e, t) { + return G.getRotation(E(j, ye), t), G.getTranslation(E(j, Le), t), j.fromRotationTranslation(e, E(j, ye), E(j, Le)); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e[6] = 0, e[7] = 0, e; + } + }, { + key: "set", + value: function set(e, t, n, s, r, a, i, c, y) { + return e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = a, e[5] = i, e[6] = c, e[7] = y, e; + } + }, { + key: "getReal", + value: function getReal(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "getDual", + value: function getDual(e, t) { + return e[0] = t[4], e[1] = t[5], e[2] = t[6], e[3] = t[7], e; + } + }, { + key: "setReal", + value: function setReal(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "setDual", + value: function setDual(e, t) { + return e[4] = t[0], e[5] = t[1], e[6] = t[2], e[7] = t[3], e; + } + }, { + key: "getTranslation", + value: function getTranslation(e, t) { + var n = t[4], + s = t[5], + r = t[6], + a = t[7], + i = -t[0], + c = -t[1], + y = -t[2], + L = t[3]; + return e[0] = (n * L + a * i + s * y - r * c) * 2, e[1] = (s * L + a * c + r * i - n * y) * 2, e[2] = (r * L + a * y + n * c - s * i) * 2, e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = n[0] * .5, + y = n[1] * .5, + L = n[2] * .5, + k = t[4], + l = t[5], + M = t[6], + h = t[7]; + return e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = i * c + r * L - a * y + k, e[5] = i * y + a * c - s * L + l, e[6] = i * L + s * y - r * c + M, e[7] = -s * c - r * y - a * L + h, e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n) { + var s = -t[0], + r = -t[1], + a = -t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = c * i + k * s + y * a - L * r, + M = y * i + k * r + L * s - c * a, + h = L * i + k * a + c * r - y * s, + b = k * i - c * s - y * r - L * a; + return O.rotateX(e, t, n), s = e[0], r = e[1], a = e[2], i = e[3], e[4] = l * i + b * s + M * a - h * r, e[5] = M * i + b * r + h * s - l * a, e[6] = h * i + b * a + l * r - M * s, e[7] = b * i - l * s - M * r - h * a, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n) { + var s = -t[0], + r = -t[1], + a = -t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = c * i + k * s + y * a - L * r, + M = y * i + k * r + L * s - c * a, + h = L * i + k * a + c * r - y * s, + b = k * i - c * s - y * r - L * a; + return O.rotateY(e, t, n), s = e[0], r = e[1], a = e[2], i = e[3], e[4] = l * i + b * s + M * a - h * r, e[5] = M * i + b * r + h * s - l * a, e[6] = h * i + b * a + l * r - M * s, e[7] = b * i - l * s - M * r - h * a, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n) { + var s = -t[0], + r = -t[1], + a = -t[2], + i = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = c * i + k * s + y * a - L * r, + M = y * i + k * r + L * s - c * a, + h = L * i + k * a + c * r - y * s, + b = k * i - c * s - y * r - L * a; + return O.rotateZ(e, t, n), s = e[0], r = e[1], a = e[2], i = e[3], e[4] = l * i + b * s + M * a - h * r, e[5] = M * i + b * r + h * s - l * a, e[6] = h * i + b * a + l * r - M * s, e[7] = b * i - l * s - M * r - h * a, e; + } + }, { + key: "rotateByQuatAppend", + value: function rotateByQuatAppend(e, t, n) { + var s = n[0], + r = n[1], + a = n[2], + i = n[3], + c = t[0], + y = t[1], + L = t[2], + k = t[3]; + return e[0] = c * i + k * s + y * a - L * r, e[1] = y * i + k * r + L * s - c * a, e[2] = L * i + k * a + c * r - y * s, e[3] = k * i - c * s - y * r - L * a, c = t[4], y = t[5], L = t[6], k = t[7], e[4] = c * i + k * s + y * a - L * r, e[5] = y * i + k * r + L * s - c * a, e[6] = L * i + k * a + c * r - y * s, e[7] = k * i - c * s - y * r - L * a, e; + } + }, { + key: "rotateByQuatPrepend", + value: function rotateByQuatPrepend(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = n[0], + y = n[1], + L = n[2], + k = n[3]; + return e[0] = s * k + i * c + r * L - a * y, e[1] = r * k + i * y + a * c - s * L, e[2] = a * k + i * L + s * y - r * c, e[3] = i * k - s * c - r * y - a * L, c = n[4], y = n[5], L = n[6], k = n[7], e[4] = s * k + i * c + r * L - a * y, e[5] = r * k + i * y + a * c - s * L, e[6] = a * k + i * L + s * y - r * c, e[7] = i * k - s * c - r * y - a * L, e; + } + }, { + key: "rotateAroundAxis", + value: function rotateAroundAxis(e, t, n, s) { + if (Math.abs(s) < 1e-6) return j.copy(e, t); + var r = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); + s = s * .5; + var a = Math.sin(s), + i = a * n[0] / r, + c = a * n[1] / r, + y = a * n[2] / r, + L = Math.cos(s), + k = t[0], + l = t[1], + M = t[2], + h = t[3]; + e[0] = k * L + h * i + l * y - M * c, e[1] = l * L + h * c + M * i - k * y, e[2] = M * L + h * y + k * c - l * i, e[3] = h * L - k * i - l * c - M * y; + var b = t[4], + d = t[5], + m = t[6], + x = t[7]; + return e[4] = b * L + x * i + d * y - m * c, e[5] = d * L + x * c + m * i - b * y, e[6] = m * L + x * y + b * c - d * i, e[7] = x * L - b * i - d * c - m * y, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e[6] = t[6] + n[6], e[7] = t[7] + n[7], e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + a = t[2], + i = t[3], + c = n[4], + y = n[5], + L = n[6], + k = n[7], + l = t[4], + M = t[5], + h = t[6], + b = t[7], + d = n[0], + m = n[1], + x = n[2], + V = n[3]; + return e[0] = s * V + i * d + r * x - a * m, e[1] = r * V + i * m + a * d - s * x, e[2] = a * V + i * x + s * m - r * d, e[3] = i * V - s * d - r * m - a * x, e[4] = s * k + i * c + r * L - a * y + l * V + b * d + M * x - h * m, e[5] = r * k + i * y + a * c - s * L + M * V + b * m + h * d - l * x, e[6] = a * k + i * L + s * y - r * c + h * V + b * x + l * m - M * d, e[7] = i * k - s * c - r * y - a * L + b * V - l * d - M * m - h * x, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e[6] = t[6] * n, e[7] = t[7] * n, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return 0; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = 1 - s; + return j.dot(t, n) < 0 && (s = -s), e[0] = t[0] * r + n[0] * s, e[1] = t[1] * r + n[1] * s, e[2] = t[2] * r + n[2] * s, e[3] = t[3] * r + n[3] * s, e[4] = t[4] * r + n[4] * s, e[5] = t[5] * r + n[5] * s, e[6] = t[6] * r + n[6] * s, e[7] = t[7] * r + n[7] * s, e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = j.squaredLength(t); + return e[0] = -t[0] / n, e[1] = -t[1] / n, e[2] = -t[2] / n, e[3] = t[3] / n, e[4] = -t[4] / n, e[5] = -t[5] / n, e[6] = -t[6] / n, e[7] = t[7] / n, e; + } + }, { + key: "conjugate", + value: function conjugate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = t[3], e[4] = -t[4], e[5] = -t[5], e[6] = -t[6], e[7] = t[7], e; + } + }, { + key: "magnitude", + value: function magnitude(e) { + return 0; + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + return 0; + } + }, { + key: "sqrLen", + value: function sqrLen(e) { + return 0; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = j.squaredLength(t); + if (n > 0) { + n = Math.sqrt(n); + var s = t[0] / n, + r = t[1] / n, + a = t[2] / n, + i = t[3] / n, + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = s * c + r * y + a * L + i * k; + e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = (c - s * l) / n, e[5] = (y - r * l) / n, e[6] = (L - a * l) / n, e[7] = (k - i * l) / n; + } + return e; + } + }, { + key: "str", + value: function str(e) { + return "Quat2(".concat(e.join(", "), ")"); + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + a = e[3], + i = e[4], + c = e[5], + y = e[6], + L = e[7], + k = t[0], + l = t[1], + M = t[2], + h = t[3], + b = t[4], + d = t[5], + m = t[6], + x = t[7]; + return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - M) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(M)) && Math.abs(a - h) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(h)) && Math.abs(i - b) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(b)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - x) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(x)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + ye = new WeakMap(), Le = new WeakMap(), Z(j, ye, new Float32Array(4)), Z(j, Le, new Float32Array(3)); + var J = j; + J.dot = O.dot; + J.squaredLength = O.squaredLength; + J.sqrLen = O.squaredLength; + J.mag = O.magnitude; + J.length = O.magnitude; + J.len = O.magnitude; + J.mul = J.multiply; + var I = /*#__PURE__*/function (_Float32Array9) { + function A() { + var _this9; + _classCallCheck(this, A); + switch (arguments.length) { + case 2: + { + var t = arguments.length <= 0 ? undefined : arguments[0]; + typeof t == "number" ? _this9 = _callSuper(this, A, [[t, arguments.length <= 1 ? undefined : arguments[1]]]) : _this9 = _callSuper(this, A, [t, arguments.length <= 1 ? undefined : arguments[1], 2]); + break; + } + case 1: + { + var _t = arguments.length <= 0 ? undefined : arguments[0]; + typeof _t == "number" ? _this9 = _callSuper(this, A, [[_t, _t]]) : _this9 = _callSuper(this, A, [_t, 0, 2]); + break; + } + default: + _this9 = _callSuper(this, A, [2]); + break; + } + return _assertThisInitialized(_this9); + } + _inherits(A, _Float32Array9); + return _createClass(A, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "magnitude", + get: function get() { + return Math.hypot(this[0], this[1]); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "squaredMagnitude", + get: function get() { + var e = this[0], + t = this[1]; + return e * e + t * t; + } + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + }, { + key: "str", + get: function get() { + return A.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "add", + value: function add(e) { + return this[0] += e[0], this[1] += e[1], this; + } + }, { + key: "subtract", + value: function subtract(e) { + return this[0] -= e[0], this[1] -= e[1], this; + } + }, { + key: "sub", + value: function sub(e) { + return this; + } + }, { + key: "multiply", + value: function multiply(e) { + return this[0] *= e[0], this[1] *= e[1], this; + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "divide", + value: function divide(e) { + return this[0] /= e[0], this[1] /= e[1], this; + } + }, { + key: "div", + value: function div(e) { + return this; + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t) { + return this[0] += e[0] * t, this[1] += e[1] * t, this; + } + }, { + key: "distance", + value: function distance(e) { + return A.distance(this, e); + } + }, { + key: "dist", + value: function dist(e) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e) { + return A.squaredDistance(this, e); + } + }, { + key: "sqrDist", + value: function sqrDist(e) { + return 0; + } + }, { + key: "negate", + value: function negate() { + return this[0] *= -1, this[1] *= -1, this; + } + }, { + key: "invert", + value: function invert() { + return this[0] = 1 / this[0], this[1] = 1 / this[1], this; + } + }, { + key: "abs", + value: function abs() { + return this[0] = Math.abs(this[0]), this[1] = Math.abs(this[1]), this; + } + }, { + key: "dot", + value: function dot(e) { + return this[0] * e[0] + this[1] * e[1]; + } + }, { + key: "normalize", + value: function normalize() { + return A.normalize(this, this); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 2 * Float32Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new A(); + } + }, { + key: "clone", + value: function clone(e) { + return new A(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t) { + return new A(e, t); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e; + } + }, { + key: "set", + value: function set(e, t, n) { + return e[0] = t, e[1] = n, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return [0, 0]; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + return e[0] = t[0] * n[0], e[1] = t[1] * n[1], e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return [0, 0]; + } + }, { + key: "divide", + value: function divide(e, t, n) { + return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e; + } + }, { + key: "div", + value: function div(e, t, n) { + return [0, 0]; + } + }, { + key: "ceil", + value: function ceil(e, t) { + return e[0] = Math.ceil(t[0]), e[1] = Math.ceil(t[1]), e; + } + }, { + key: "floor", + value: function floor(e, t) { + return e[0] = Math.floor(t[0]), e[1] = Math.floor(t[1]), e; + } + }, { + key: "min", + value: function min(e, t, n) { + return e[0] = Math.min(t[0], n[0]), e[1] = Math.min(t[1], n[1]), e; + } + }, { + key: "max", + value: function max(e, t, n) { + return e[0] = Math.max(t[0], n[0]), e[1] = Math.max(t[1], n[1]), e; + } + }, { + key: "round", + value: function round(e, t) { + return e[0] = Math.round(t[0]), e[1] = Math.round(t[1]), e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e; + } + }, { + key: "distance", + value: function distance(e, t) { + return Math.hypot(t[0] - e[0], t[1] - e[1]); + } + }, { + key: "dist", + value: function dist(e, t) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1]; + return n * n + s * s; + } + }, { + key: "sqrDist", + value: function sqrDist(e, t) { + return 0; + } + }, { + key: "magnitude", + value: function magnitude(e) { + var t = e[0], + n = e[1]; + return Math.sqrt(t * t + n * n); + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + var t = e[0], + n = e[1]; + return t * t + n * n; + } + }, { + key: "sqrLen", + value: function sqrLen(e, t) { + return 0; + } + }, { + key: "negate", + value: function negate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e; + } + }, { + key: "inverse", + value: function inverse(e, t) { + return e[0] = 1 / t[0], e[1] = 1 / t[1], e; + } + }, { + key: "abs", + value: function abs(e, t) { + return e[0] = Math.abs(t[0]), e[1] = Math.abs(t[1]), e; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = t[0], + s = t[1], + r = n * n + s * s; + return r > 0 && (r = 1 / Math.sqrt(r)), e[0] = t[0] * r, e[1] = t[1] * r, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1]; + } + }, { + key: "cross", + value: function cross(e, t, n) { + var s = t[0] * n[1] - t[1] * n[0]; + return e[0] = e[1] = 0, e[2] = s, e; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = t[0], + a = t[1]; + return e[0] = r + s * (n[0] - r), e[1] = a + s * (n[1] - a), e; + } + }, { + key: "transformMat2", + value: function transformMat2(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[2] * r, e[1] = n[1] * s + n[3] * r, e; + } + }, { + key: "transformMat2d", + value: function transformMat2d(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[2] * r + n[4], e[1] = n[1] * s + n[3] * r + n[5], e; + } + }, { + key: "transformMat3", + value: function transformMat3(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[3] * r + n[6], e[1] = n[1] * s + n[4] * r + n[7], e; + } + }, { + key: "transformMat4", + value: function transformMat4(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[4] * r + n[12], e[1] = n[1] * s + n[5] * r + n[13], e; + } + }, { + key: "rotate", + value: function rotate(e, t, n, s) { + var r = t[0] - n[0], + a = t[1] - n[1], + i = Math.sin(s), + c = Math.cos(s); + return e[0] = r * c - a * i + n[0], e[1] = r * i + a * c + n[1], e; + } + }, { + key: "angle", + value: function angle(e, t) { + var n = e[0], + s = e[1], + r = t[0], + a = t[1], + i = Math.sqrt(n * n + s * s) * Math.sqrt(r * r + a * a), + c = i && (n * r + s * a) / i; + return Math.acos(Math.min(Math.max(c, -1), 1)); + } + }, { + key: "zero", + value: function zero(e) { + return e[0] = 0, e[1] = 0, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = t[0], + a = t[1]; + return Math.abs(n - r) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(r)) && Math.abs(s - a) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(a)); + } + }, { + key: "str", + value: function str(e) { + return "Vec2(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + I.prototype.sub = I.prototype.subtract; + I.prototype.mul = I.prototype.multiply; + I.prototype.div = I.prototype.divide; + I.prototype.dist = I.prototype.distance; + I.prototype.sqrDist = I.prototype.squaredDistance; + I.sub = I.subtract; + I.mul = I.multiply; + I.div = I.divide; + I.dist = I.distance; + I.sqrDist = I.squaredDistance; + I.sqrLen = I.squaredLength; + I.mag = I.magnitude; + I.length = I.magnitude; + I.len = I.magnitude; + var me = !1; + function _e() { + if (me) return; + var A = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"], + e = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"], + t = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"], + n = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function s(r) { + switch (r.length) { + case 2: + return function () { + return new I(this[n[r[0]]], this[n[r[1]]]); + }; + case 3: + return function () { + return new T(this[n[r[0]]], this[n[r[1]]], this[n[r[2]]]); + }; + case 4: + return function () { + return new q(this[n[r[0]]], this[n[r[1]]], this[n[r[2]]], this[n[r[3]]]); + }; + } + } + for (var _i = 0, _A = A; _i < _A.length; _i++) { + var r = _A[_i]; + var a = s(r); + Object.defineProperty(I.prototype, r, { + get: a + }), Object.defineProperty(T.prototype, r, { + get: a + }), Object.defineProperty(q.prototype, r, { + get: a + }); + } + for (var _i2 = 0, _e2 = e; _i2 < _e2.length; _i2++) { + var _r = _e2[_i2]; + var _a = s(_r); + Object.defineProperty(T.prototype, _r, { + get: _a + }), Object.defineProperty(q.prototype, _r, { + get: _a + }); + } + for (var _i3 = 0, _t2 = t; _i3 < _t2.length; _i3++) { + var _r2 = _t2[_i3]; + var _a2 = s(_r2); + Object.defineProperty(q.prototype, _r2, { + get: _a2 + }); + } + me = !0; + } + var oe = Math.PI / 180, + Re = 180 / Math.PI; + function tt(A) { + return A * Re; + } + function nt(A) { + return A * oe; + } + + exports.EnableSwizzles = _e; + exports.Mat2 = v; + exports.Mat2d = _; + exports.Mat3 = u; + exports.Mat4 = G; + exports.Quat = O; + exports.Quat2 = J; + exports.Vec2 = I; + exports.Vec3 = T; + exports.Vec4 = q; + exports.mat2 = v; + exports.mat2d = _; + exports.mat3 = u; + exports.mat4 = G; + exports.quat = O; + exports.quat2 = J; + exports.toDegree = tt; + exports.toRadian = nt; + exports.vec2 = I; + exports.vec3 = T; + exports.vec4 = q; + +})); +//# sourceMappingURL=gl-matrix-f32.min.cjs.map diff --git a/dist-cdn/umd/gl-matrix-f32.min.cjs.map b/dist-cdn/umd/gl-matrix-f32.min.cjs.map new file mode 100644 index 00000000..f051873c --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f32.min.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f32.min.cjs","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;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z=L*d-l*h,g=k*d-l*b,S=t*g-n*z+s*R,B=a*g-i*z+c*R,N=L*o-k*V+l*x,p=h*o-b*V+d*x;return y*S-r*B+m*N-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAoF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAArEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.cjs b/dist-cdn/umd/gl-matrix-f64.cjs new file mode 100644 index 00000000..5c2d4b4b --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f64.cjs @@ -0,0 +1,10670 @@ +[object Object] +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrix = {})); +})(this, (function (exports) { 'use strict'; + + function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; + } + function _callSuper(t, o, e) { + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); + } + function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); + } + function _construct(t, e, r) { + if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _setPrototypeOf(p, r.prototype), p; + } + function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); + } + } + function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; + } + function _get() { + return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = _superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, _get.apply(null, arguments); + } + function _getPrototypeOf(t) { + return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, _getPrototypeOf(t); + } + function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && _setPrototypeOf(t, e); + } + function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } + } + function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (_isNativeReflectConstruct = function () { + return !!t; + })(); + } + function _possibleConstructorReturn(t, e) { + if (e && ("object" == typeof e || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return _assertThisInitialized(t); + } + function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); + } + function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); + return t; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r ); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (String )(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return _wrapNativeSuper = function (t) { + if (null === t || !_isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return _construct(t, arguments, _getPrototypeOf(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), _setPrototypeOf(Wrapper, t); + }, _wrapNativeSuper(t); + } + + // glMatrix - v4.0.0-beta.3 + var __typeError = function __typeError(msg) { + throw TypeError(msg); + }; + var __accessCheck = function __accessCheck(obj, member, msg) { + return member.has(obj) || __typeError("Cannot " + msg); + }; + var __privateGet = function __privateGet(obj, member, getter) { + return __accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj); + }; + var __privateAdd = function __privateAdd(obj, member, value) { + return member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); + }; + + // src/common/index.ts + var GLM_EPSILON = 1e-6; + + // src/_lib/f64/Mat2.ts + var _IDENTITY_2X2; + var _Mat2 = /*#__PURE__*/function (_Float64Array) { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + function _Mat2() { + var _this; + _classCallCheck(this, _Mat2); + for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + switch (values.length) { + case 4: + _this = _callSuper(this, _Mat2, [values]); + break; + case 2: + _this = _callSuper(this, _Mat2, [values[0], values[1], 4]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this = _callSuper(this, _Mat2, [[v, v, v, v]]); + } else { + _this = _callSuper(this, _Mat2, [v, 0, 4]); + } + break; + default: + _this = _callSuper(this, _Mat2, [__privateGet(_Mat2, _IDENTITY_2X2)]); + break; + } + return _assertThisInitialized(_this); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + _inherits(_Mat2, _Float64Array); + return _createClass(_Mat2, [{ + key: "str", + get: function get() { + return _Mat2.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat2, _IDENTITY_2X2)); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + }, { + key: "transpose", + value: function transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + }, { + key: "invert", + value: function invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + }, { + key: "rotate", + value: function rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + }, { + key: "create", + value: function create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + values[_key2] = arguments[_key2]; + } + return _construct(_Mat2, values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "transpose", + value: function transpose(out, a) { + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "adjoint", + value: function adjoint(out, a) { + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, rad) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var v0 = v[0]; + var v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + }, { + key: "LDU", + value: function LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat2(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + _IDENTITY_2X2 = new WeakMap(); + __privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([1, 0, 0, 1])); + var Mat2 = _Mat2; + Mat2.prototype.mul = Mat2.prototype.multiply; + Mat2.mul = Mat2.multiply; + Mat2.sub = Mat2.subtract; + + // src/_lib/f64/Mat2d.ts + var _IDENTITY_2X3; + var _Mat2d = /*#__PURE__*/function (_Float64Array2) { + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + function _Mat2d() { + var _this2; + _classCallCheck(this, _Mat2d); + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + values[_key3] = arguments[_key3]; + } + switch (values.length) { + case 6: + _this2 = _callSuper(this, _Mat2d, [values]); + break; + case 2: + _this2 = _callSuper(this, _Mat2d, [values[0], values[1], 6]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this2 = _callSuper(this, _Mat2d, [[v, v, v, v, v, v]]); + } else { + _this2 = _callSuper(this, _Mat2d, [v, 0, 6]); + } + break; + default: + _this2 = _callSuper(this, _Mat2d, [__privateGet(_Mat2d, _IDENTITY_2X3)]); + break; + } + return _assertThisInitialized(_this2); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + _inherits(_Mat2d, _Float64Array2); + return _createClass(_Mat2d, [{ + key: "str", + get: function get() { + return _Mat2d.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat2d, _IDENTITY_2X3)); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + }, { + key: "translate", + value: function translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotate", + value: function rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat2d.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 6 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + }, { + key: "create", + value: function create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len4 = arguments.length, values = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + values[_key4] = arguments[_key4]; + } + return _construct(_Mat2d, values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + out[4] = arguments.length <= 5 ? undefined : arguments[5]; + out[5] = arguments.length <= 6 ? undefined : arguments[6]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var aa = a[0]; + var ab = a[1]; + var ac = a[2]; + var ad = a[3]; + var atx = a[4]; + var aty = a[5]; + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var v0 = v[0]; + var v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, rad) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var v0 = v[0]; + var v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat2d(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + _IDENTITY_2X3 = new WeakMap(); + __privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([1, 0, 0, 1, 0, 0])); + var Mat2d = _Mat2d; + Mat2d.mul = Mat2d.multiply; + Mat2d.sub = Mat2d.subtract; + + // src/_lib/f64/Mat3.ts + var _IDENTITY_3X3; + var _Mat3 = /*#__PURE__*/function (_Float64Array3) { + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + function _Mat3() { + var _this3; + _classCallCheck(this, _Mat3); + for (var _len5 = arguments.length, values = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + values[_key5] = arguments[_key5]; + } + switch (values.length) { + case 9: + _this3 = _callSuper(this, _Mat3, [values]); + break; + case 2: + _this3 = _callSuper(this, _Mat3, [values[0], values[1], 9]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this3 = _callSuper(this, _Mat3, [[v, v, v, v, v, v, v, v, v]]); + } else { + _this3 = _callSuper(this, _Mat3, [v, 0, 9]); + } + break; + default: + _this3 = _callSuper(this, _Mat3, [__privateGet(_Mat3, _IDENTITY_3X3)]); + break; + } + return _assertThisInitialized(_this3); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + _inherits(_Mat3, _Float64Array3); + return _createClass(_Mat3, [{ + key: "str", + get: function get() { + return _Mat3.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat3, _IDENTITY_3X3)); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "transpose", + value: function transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + }, { + key: "translate", + value: function translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotate", + value: function rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat3.scale(this, this, v); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 9 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + }, { + key: "create", + value: function create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len6 = arguments.length, values = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + values[_key6] = arguments[_key6]; + } + return _construct(_Mat3, values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + out[4] = arguments.length <= 5 ? undefined : arguments[5]; + out[5] = arguments.length <= 6 ? undefined : arguments[6]; + out[6] = arguments.length <= 7 ? undefined : arguments[7]; + out[7] = arguments.length <= 8 ? undefined : arguments[8]; + out[8] = arguments.length <= 9 ? undefined : arguments[9]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "transpose", + value: function transpose(out, a) { + if (out === a) { + var a01 = a[1], + a02 = a[2], + a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2]; + var a10 = a[3], + a11 = a[4], + a12 = a[5]; + var a20 = a[6], + a21 = a[7], + a22 = a[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + var det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "adjoint", + value: function adjoint(out, a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + var x = v[0]; + var y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, rad) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var x = v[0]; + var y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + }, { + key: "fromMat2d", + value: function fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + }, { + key: "fromQuat", + value: function fromQuat(out, q) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + }, { + key: "fromMat4", + value: function fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "normalFromMat4", + value: function normalFromMat4(out, a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(out, a) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var bx = a[4]; + var by = a[5]; + var bz = a[6]; + var cx = a[8]; + var cy = a[9]; + var cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + }, { + key: "projection", + value: function projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var a6 = a[6]; + var a7 = a[7]; + var a8 = a[8]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + var b6 = b[6]; + var b7 = b[7]; + var b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat3(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + _IDENTITY_3X3 = new WeakMap(); + __privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); + var Mat3 = _Mat3; + Mat3.prototype.mul = Mat3.prototype.multiply; + Mat3.mul = Mat3.multiply; + Mat3.sub = Mat3.subtract; + + // src/_lib/f64/Mat4.ts + var _IDENTITY_4X4, _TMP_VEC3; + var _Mat4 = /*#__PURE__*/function (_Float64Array4) { + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + function _Mat4() { + var _this4; + _classCallCheck(this, _Mat4); + for (var _len7 = arguments.length, values = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + values[_key7] = arguments[_key7]; + } + switch (values.length) { + case 16: + _this4 = _callSuper(this, _Mat4, [values]); + break; + case 2: + _this4 = _callSuper(this, _Mat4, [values[0], values[1], 16]); + break; + case 1: + var v = values[0]; + if (typeof v === "number") { + _this4 = _callSuper(this, _Mat4, [[v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v]]); + } else { + _this4 = _callSuper(this, _Mat4, [v, 0, 16]); + } + break; + default: + _this4 = _callSuper(this, _Mat4, [__privateGet(_Mat4, _IDENTITY_4X4)]); + break; + } + return _assertThisInitialized(_this4); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + _inherits(_Mat4, _Float64Array4); + return _createClass(_Mat4, [{ + key: "str", + get: function get() { + return _Mat4.str(this); + } + //=================== + // Instance methods + //=================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this.set(__privateGet(_Mat4, _IDENTITY_4X4)); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "transpose", + value: function transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + }, { + key: "translate", + value: function translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + }, { + key: "rotate", + value: function rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotateX", + value: function rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotateY", + value: function rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + }, { + key: "rotateZ", + value: function rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + }, { + key: "perspectiveNO", + value: function perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + }, { + key: "perspectiveZO", + value: function perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + }, { + key: "orthoNO", + value: function orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + }, { + key: "orthoZO", + value: function orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 16 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + }, { + key: "create", + value: function create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + }, { + key: "clone", + value: function clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + }, { + key: "fromValues", + value: function fromValues() { + for (var _len8 = arguments.length, values = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + values[_key8] = arguments[_key8]; + } + return _construct(_Mat4, values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + }, { + key: "set", + value: function set(out) { + out[0] = arguments.length <= 1 ? undefined : arguments[1]; + out[1] = arguments.length <= 2 ? undefined : arguments[2]; + out[2] = arguments.length <= 3 ? undefined : arguments[3]; + out[3] = arguments.length <= 4 ? undefined : arguments[4]; + out[4] = arguments.length <= 5 ? undefined : arguments[5]; + out[5] = arguments.length <= 6 ? undefined : arguments[6]; + out[6] = arguments.length <= 7 ? undefined : arguments[7]; + out[7] = arguments.length <= 8 ? undefined : arguments[8]; + out[8] = arguments.length <= 9 ? undefined : arguments[9]; + out[9] = arguments.length <= 10 ? undefined : arguments[10]; + out[10] = arguments.length <= 11 ? undefined : arguments[11]; + out[11] = arguments.length <= 12 ? undefined : arguments[12]; + out[12] = arguments.length <= 13 ? undefined : arguments[13]; + out[13] = arguments.length <= 14 ? undefined : arguments[14]; + out[14] = arguments.length <= 15 ? undefined : arguments[15]; + out[15] = arguments.length <= 16 ? undefined : arguments[16]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "transpose", + value: function transpose(out, a) { + if (out === a) { + var a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a12 = a[6], + a13 = a[7]; + var a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "invert", + value: function invert(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + }, { + key: "adjoint", + value: function adjoint(out, a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + }, { + key: "determinant", + value: function determinant(a) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3]; + var a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + var a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + var a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b0 = a00 * a11 - a01 * a10; + var b1 = a00 * a12 - a02 * a10; + var b2 = a01 * a12 - a02 * a11; + var b3 = a20 * a31 - a21 * a30; + var b4 = a20 * a32 - a22 * a30; + var b5 = a21 * a32 - a22 * a31; + var b6 = a00 * b5 - a01 * b4 + a02 * b3; + var b7 = a10 * b5 - a11 * b4 + a12 * b3; + var b8 = a20 * b2 - a21 * b1 + a22 * b0; + var b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var x = v[0]; + var y = v[1]; + var z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + }, { + key: "scale", + value: function scale(out, a, v) { + var x = v[0]; + var y = v[1]; + var z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + }, { + key: "rotate", + value: function rotate(out, a, rad, axis) { + var x = axis[0]; + var y = axis[1]; + var z = axis[2]; + var len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + }, { + key: "fromScaling", + value: function fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + }, { + key: "fromRotation", + value: function fromRotation(out, rad, axis) { + var x = axis[0]; + var y = axis[1]; + var z = axis[2]; + var len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromXRotation", + value: function fromXRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromYRotation", + value: function fromYRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + }, { + key: "fromZRotation", + value: function fromZRotation(out, rad) { + var s = Math.sin(rad); + var c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(out, q, v) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + }, { + key: "fromQuat2", + value: function fromQuat2(out, a) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3)); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertable + */ + }, { + key: "normalFromMat4", + value: function normalFromMat4(out, a) { + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(out, a) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var bx = a[4]; + var by = a[5]; + var bz = a[6]; + var cx = a[8]; + var cy = a[9]; + var cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + }, { + key: "getTranslation", + value: function getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + }, { + key: "getScaling", + value: function getScaling(out, mat) { + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + }, { + key: "getRotation", + value: function getRotation(out, mat) { + _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat); + var is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0]; + var is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1]; + var is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2]; + var sm11 = mat[0] * is1; + var sm12 = mat[1] * is2; + var sm13 = mat[2] * is3; + var sm21 = mat[4] * is1; + var sm22 = mat[5] * is2; + var sm23 = mat[6] * is3; + var sm31 = mat[8] * is1; + var sm32 = mat[9] * is2; + var sm33 = mat[10] * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + }, { + key: "decompose", + value: function decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + var m11 = mat[0]; + var m12 = mat[1]; + var m13 = mat[2]; + var m21 = mat[4]; + var m22 = mat[5]; + var m23 = mat[6]; + var m31 = mat[8]; + var m32 = mat[9]; + var m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + var is1 = 1 / out_s[0]; + var is2 = 1 / out_s[1]; + var is3 = 1 / out_s[2]; + var sm11 = m11 * is1; + var sm12 = m12 * is2; + var sm13 = m13 * is3; + var sm21 = m21 * is1; + var sm22 = m22 * is2; + var sm23 = m23 * is3; + var sm31 = m31 * is1; + var sm32 = m32 * is2; + var sm33 = m33 * is3; + var trace = sm11 + sm22 + sm33; + var S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + }, { + key: "fromRotationTranslationScale", + value: function fromRotationTranslationScale(out, q, v, s) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + }, { + key: "fromRotationTranslationScaleOrigin", + value: function fromRotationTranslationScaleOrigin(out, q, v, s, o) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + var sx = s[0]; + var sy = s[1]; + var sz = s[2]; + var ox = o[0]; + var oy = o[1]; + var oz = o[2]; + var out0 = (1 - (yy + zz)) * sx; + var out1 = (xy + wz) * sx; + var out2 = (xz - wy) * sx; + var out4 = (xy - wz) * sy; + var out5 = (1 - (xx + zz)) * sy; + var out6 = (yz + wx) * sy; + var out8 = (xz + wy) * sz; + var out9 = (yz - wx) * sz; + var out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + }, { + key: "fromQuat", + value: function fromQuat(out, q) { + var x = q[0]; + var y = q[1]; + var z = q[2]; + var w = q[3]; + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + var xx = x * x2; + var yx = y * x2; + var yy = y * y2; + var zx = z * x2; + var zy = z * y2; + var zz = z * z2; + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "frustumNO", + value: function frustumNO(out, left, right, bottom, top, near) { + var far = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : Infinity; + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + }, { + key: "frustum", + value: function frustum(out, left, right, bottom, top, near) { + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "frustumZO", + value: function frustumZO(out, left, right, bottom, top, near) { + var far = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : Infinity; + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "perspectiveNO", + value: function perspectiveNO(out, fovy, aspect, near) { + var far = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Infinity; + var f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + }, { + key: "perspective", + value: function perspective(out, fovy, aspect, near) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + }, { + key: "perspectiveZO", + value: function perspectiveZO(out, fovy, aspect, near) { + var far = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Infinity; + var f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + var nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + }, { + key: "perspectiveFromFieldOfView", + value: function perspectiveFromFieldOfView(out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI / 180); + var downTan = Math.tan(fov.downDegrees * Math.PI / 180); + var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + var xScale = 2 / (leftTan + rightTan); + var yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + }, { + key: "orthoNO", + value: function orthoNO(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + }, { + key: "ortho", + value: function ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + }, { + key: "orthoZO", + value: function orthoZO(out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right); + var bt = 1 / (bottom - top); + var nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. + * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + }, { + key: "lookAt", + value: function lookAt(out, eye, center, up) { + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var centerx = center[0]; + var centery = center[1]; + var centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + }, { + key: "targetTo", + value: function targetTo(out, eye, target, up) { + var eyex = eye[0]; + var eyey = eye[1]; + var eyez = eye[2]; + var upx = up[0]; + var upy = up[1]; + var upz = up[2]; + var z0 = eyex - target[0]; + var z1 = eyey - target[1]; + var z2 = eyez - target[2]; + var len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + }, { + key: "frob", + value: function frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + }, { + key: "multiplyScalar", + value: function multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var a6 = a[6]; + var a7 = a[7]; + var a8 = a[8]; + var a9 = a[9]; + var a10 = a[10]; + var a11 = a[11]; + var a12 = a[12]; + var a13 = a[13]; + var a14 = a[14]; + var a15 = a[15]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + var b6 = b[6]; + var b7 = b[7]; + var b8 = b[8]; + var b9 = b[9]; + var b10 = b[10]; + var b11 = b[11]; + var b12 = b[12]; + var b13 = b[13]; + var b14 = b[14]; + var b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + }, { + key: "str", + value: function str(a) { + return "Mat4(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + _IDENTITY_4X4 = new WeakMap(); + _TMP_VEC3 = new WeakMap(); + __privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])); + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + __privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3)); + var Mat4 = _Mat4; + Mat4.prototype.mul = Mat4.prototype.multiply; + Mat4.sub = Mat4.subtract; + Mat4.mul = Mat4.multiply; + Mat4.frustum = Mat4.frustumNO; + Mat4.perspective = Mat4.perspectiveNO; + Mat4.ortho = Mat4.orthoNO; + + // src/_lib/f64/Vec3.ts + var Vec3 = /*#__PURE__*/function (_Float64Array5) { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + function _Vec3() { + var _this5; + _classCallCheck(this, _Vec3); + for (var _len9 = arguments.length, values = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { + values[_key9] = arguments[_key9]; + } + switch (values.length) { + case 3: + _this5 = _callSuper(this, _Vec3, [values]); + break; + case 2: + _this5 = _callSuper(this, _Vec3, [values[0], values[1], 3]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this5 = _callSuper(this, _Vec3, [[v, v, v]]); + } else { + _this5 = _callSuper(this, _Vec3, [v, 0, 3]); + } + break; + } + default: + _this5 = _callSuper(this, _Vec3, [3]); + break; + } + return _assertThisInitialized(_this5); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + _inherits(_Vec3, _Float64Array5); + return _createClass(_Vec3, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + }, { + key: "squaredMagnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Vec3.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + }, { + key: "add", + value: function add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + }, { + key: "subtract", + value: function subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + }, { + key: "sub", + value: function sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + }, { + key: "divide", + value: function divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + }, { + key: "div", + value: function div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + }, { + key: "distance", + value: function distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + }, { + key: "dist", + value: function dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + }, { + key: "sqrDist", + value: function sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "negate", + value: function negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "abs", + value: function abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + }, { + key: "dot", + value: function dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "normalize", + value: function normalize() { + return _Vec3.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 3 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + }, { + key: "create", + value: function create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + }, { + key: "clone", + value: function clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + }, { + key: "magnitude", + value: function magnitude(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + }, { + key: "fromValues", + value: function fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "divide", + value: function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + }, { + key: "div", + value: function div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + }, { + key: "ceil", + value: function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + }, { + key: "floor", + value: function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "min", + value: function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "max", + value: function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /*static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, _scale) { + out[0] = a[0] * _scale; + out[1] = a[1] * _scale; + out[2] = a[2] * _scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + }, { + key: "distance", + value: function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + }, { + key: "dist", + value: function dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + }, { + key: "squaredDistance", + value: function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + }, { + key: "sqrDist", + value: function sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + }, { + key: "negate", + value: function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + }, { + key: "inverse", + value: function inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + }, { + key: "abs", + value: function abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "cross", + value: function cross(out, a, b) { + var ax = a[0], + ay = a[1], + az = a[2]; + var bx = b[0], + by = b[1], + bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "slerp", + value: function slerp(out, a, b, t) { + var angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + var sinTotal = Math.sin(angle); + var ratioA = Math.sin((1 - t) * angle) / sinTotal; + var ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "hermite", + value: function hermite(out, a, b, c, d, t) { + var factorTimes2 = t * t; + var factor1 = factorTimes2 * (2 * t - 3) + 1; + var factor2 = factorTimes2 * (t - 2) + t; + var factor3 = factorTimes2 * (t - 1); + var factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "bezier", + value: function bezier(out, a, b, c, d, t) { + var inverseFactor = 1 - t; + var inverseFactorTimesTwo = inverseFactor * inverseFactor; + var factorTimes2 = t * t; + var factor1 = inverseFactorTimesTwo * inverseFactor; + var factor2 = 3 * t * inverseFactorTimesTwo; + var factor3 = 3 * factorTimes2 * inverseFactor; + var factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + }, { + key: "transformMat4", + value: function transformMat4(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + var w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + }, { + key: "transformMat3", + value: function transformMat3(out, a, m) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + }, { + key: "transformQuat", + value: function transformQuat(out, a, q) { + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var w2 = q[3] * 2; + var x = a[0]; + var y = a[1]; + var z = a[2]; + var uvx = qy * z - qz * y; + var uvy = qz * x - qx * z; + var uvz = qx * y - qy * x; + var uuvx = (qy * uvz - qz * uvy) * 2; + var uuvy = (qz * uvx - qx * uvz) * 2; + var uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, b, rad) { + var by = b[1]; + var bz = b[2]; + var py = a[1] - by; + var pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, b, rad) { + var bx = b[0]; + var bz = b[2]; + var px = a[0] - bx; + var pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, b, rad) { + var bx = b[0]; + var by = b[1]; + var px = a[0] - bx; + var py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + }, { + key: "angle", + value: function angle(a, b) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var bx = b[0]; + var by = b[1]; + var bz = b[2]; + var mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + var cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + }, { + key: "zero", + value: function zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Vec3(".concat(a.join(", "), ")"); + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + Vec3.prototype.sub = Vec3.prototype.subtract; + Vec3.prototype.mul = Vec3.prototype.multiply; + Vec3.prototype.div = Vec3.prototype.divide; + Vec3.prototype.dist = Vec3.prototype.distance; + Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; + Vec3.sub = Vec3.subtract; + Vec3.mul = Vec3.multiply; + Vec3.div = Vec3.divide; + Vec3.dist = Vec3.distance; + Vec3.sqrDist = Vec3.squaredDistance; + Vec3.sqrLen = Vec3.squaredLength; + Vec3.mag = Vec3.magnitude; + Vec3.length = Vec3.magnitude; + Vec3.len = Vec3.magnitude; + + // src/_lib/f64/Vec4.ts + var Vec4 = /*#__PURE__*/function (_Float64Array6) { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + function _Vec4() { + var _this6; + _classCallCheck(this, _Vec4); + for (var _len10 = arguments.length, values = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { + values[_key10] = arguments[_key10]; + } + switch (values.length) { + case 4: + _this6 = _callSuper(this, _Vec4, [values]); + break; + case 2: + _this6 = _callSuper(this, _Vec4, [values[0], values[1], 4]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this6 = _callSuper(this, _Vec4, [[v, v, v, v]]); + } else { + _this6 = _callSuper(this, _Vec4, [v, 0, 4]); + } + break; + } + default: + _this6 = _callSuper(this, _Vec4, [4]); + break; + } + return _assertThisInitialized(_this6); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + _inherits(_Vec4, _Float64Array6); + return _createClass(_Vec4, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + }, { + key: "a", + get: function get() { + return this[3]; + }, + set: function set(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + var w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Vec4.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + _get(_getPrototypeOf(_Vec4.prototype), "set", this).call(this, a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + }, { + key: "add", + value: function add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + }, { + key: "subtract", + value: function subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + }, { + key: "sub", + value: function sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + }, { + key: "divide", + value: function divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + }, { + key: "div", + value: function div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + }, { + key: "distance", + value: function distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + }, { + key: "dist", + value: function dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + }, { + key: "sqrDist", + value: function sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "negate", + value: function negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "abs", + value: function abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + }, { + key: "dot", + value: function dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "normalize", + value: function normalize() { + return _Vec4.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + }, { + key: "create", + value: function create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + }, { + key: "clone", + value: function clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + }, { + key: "fromValues", + value: function fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "divide", + value: function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + }, { + key: "div", + value: function div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + }, { + key: "ceil", + value: function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + }, { + key: "floor", + value: function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "min", + value: function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "max", + value: function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + }, { + key: "round", + value: function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, _scale2) { + out[0] = a[0] * _scale2; + out[1] = a[1] * _scale2; + out[2] = a[2] * _scale2; + out[3] = a[3] * _scale2; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + }, { + key: "distance", + value: function distance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + }, { + key: "dist", + value: function dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + }, { + key: "squaredDistance", + value: function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + }, { + key: "sqrDist", + value: function sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + }, { + key: "magnitude", + value: function magnitude(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a) { + return 0; + } + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + }, { + key: "negate", + value: function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + }, { + key: "inverse", + value: function inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + }, { + key: "abs", + value: function abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + var len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + }, { + key: "cross", + value: function cross(out, u, v, w) { + var a = v[0] * w[1] - v[1] * w[0]; + var b = v[0] * w[2] - v[2] * w[0]; + var c = v[0] * w[3] - v[3] * w[0]; + var d = v[1] * w[2] - v[2] * w[1]; + var e = v[1] * w[3] - v[3] * w[1]; + var f = v[2] * w[3] - v[3] * w[2]; + var g = u[0]; + var h = u[1]; + var i = u[2]; + var j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /*static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + }, { + key: "transformMat4", + value: function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + }, { + key: "transformQuat", + value: function transformQuat(out, a, q) { + var x = a[0]; + var y = a[1]; + var z = a[2]; + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var qw = q[3]; + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + }, { + key: "zero", + value: function zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Vec4(".concat(a.join(", "), ")"); + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + Vec4.prototype.sub = Vec4.prototype.subtract; + Vec4.prototype.mul = Vec4.prototype.multiply; + Vec4.prototype.div = Vec4.prototype.divide; + Vec4.prototype.dist = Vec4.prototype.distance; + Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; + Vec4.sub = Vec4.subtract; + Vec4.mul = Vec4.multiply; + Vec4.div = Vec4.divide; + Vec4.dist = Vec4.distance; + Vec4.sqrDist = Vec4.squaredDistance; + Vec4.sqrLen = Vec4.squaredLength; + Vec4.mag = Vec4.magnitude; + Vec4.length = Vec4.magnitude; + Vec4.len = Vec4.magnitude; + + // src/_lib/f64/Quat.ts + var _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3; + var _Quat = /*#__PURE__*/function (_Float64Array7) { + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + function _Quat() { + var _this7; + _classCallCheck(this, _Quat); + for (var _len11 = arguments.length, values = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { + values[_key11] = arguments[_key11]; + } + switch (values.length) { + case 4: + _this7 = _callSuper(this, _Quat, [values]); + break; + case 2: + _this7 = _callSuper(this, _Quat, [values[0], values[1], 4]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this7 = _callSuper(this, _Quat, [[v, v, v, v]]); + } else { + _this7 = _callSuper(this, _Quat, [v, 0, 4]); + } + break; + } + default: + _this7 = _callSuper(this, _Quat, [4]); + _this7[3] = 1; + break; + } + return _assertThisInitialized(_this7); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + _inherits(_Quat, _Float64Array7); + return _createClass(_Quat, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + var z = this[2]; + var w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Quat.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + _get(_getPrototypeOf(_Quat.prototype), "set", this).call(this, a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + }, { + key: "identity", + value: function identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + }, { + key: "rotateX", + value: function rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + }, { + key: "rotateY", + value: function rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + }, { + key: "rotateZ", + value: function rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(_scale3) { + this[0] *= _scale3; + this[1] *= _scale3; + this[2] *= _scale3; + this[3] *= _scale3; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + }, { + key: "dot", + value: function dot(b) { + return _Quat.dot(this, b); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + }, { + key: "create", + value: function create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + }, { + key: "setAxisAngle", + value: function setAxisAngle(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + }, { + key: "getAxisAngle", + value: function getAxisAngle(out_axis, q) { + var rad = Math.acos(q[3]) * 2; + var s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + }, { + key: "getAngle", + value: function getAngle(a, b) { + var dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var bx = b[0]; + var by = b[1]; + var bz = b[2]; + var bw = b[3]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, rad) { + rad *= 0.5; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var bx = Math.sin(rad); + var bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, rad) { + rad *= 0.5; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var by = Math.sin(rad); + var bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, rad) { + rad *= 0.5; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + var bz = Math.sin(rad); + var bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + }, { + key: "calculateW", + value: function calculateW(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + }, { + key: "exp", + value: function exp(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var et = Math.exp(w); + var s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + }, { + key: "ln", + value: function ln(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var r = Math.sqrt(x * x + y * y + z * z); + var t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + }, { + key: "pow", + value: function pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "slerp", + value: function slerp(out, a, b, t) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + var bx = b[0], + by = b[1], + bz = b[2], + bw = b[3]; + var scale0; + var scale1; + var cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /*static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + }, { + key: "invert", + value: function invert(out, a) { + var a0 = a[0], + a1 = a[1], + a2 = a[2], + a3 = a[3]; + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + }, { + key: "conjugate", + value: function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + }, { + key: "fromMat3", + value: function fromMat3(out, m) { + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + var i = 0; + if (m[4] > m[0]) i = 1; + if (m[8] > m[i * 3 + i]) i = 2; + var j = (i + 1) % 3; + var k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + }, { + key: "fromEuler", + value: function fromEuler(out, x, y, z) { + var order = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : __privateGet(_Quat, _DEFAULT_ANGLE_ORDER); + var halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + var sx = Math.sin(x); + var cx = Math.cos(x); + var sy = Math.sin(y); + var cy = Math.cos(y); + var sz = Math.sin(z); + var cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error("Unknown angle order " + order); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Quat(".concat(a.join(", "), ")"); + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + }, { + key: "clone", + value: function clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + }, { + key: "fromValues", + value: function fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, _scale4) { + out[0] = a[0] * _scale4; + out[1] = a[1] * _scale4; + out[2] = a[2] * _scale4; + out[3] = a[3] * _scale4; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + }, { + key: "magnitude", + value: function magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + return out; + } + /** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return false; + } + /** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + }, { + key: "rotationTo", + value: function rotationTo(out, a, b) { + var dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); + _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b); + out[0] = __privateGet(_Quat, _TMP_VEC32)[0]; + out[1] = __privateGet(_Quat, _TMP_VEC32)[1]; + out[2] = __privateGet(_Quat, _TMP_VEC32)[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "sqlerp", + value: function sqlerp(out, a, b, c, d, t) { + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t); + _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t); + _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + }, { + key: "setAxes", + value: function setAxes(out, view, right, up) { + __privateGet(_Quat, _TMP_MAT3)[0] = right[0]; + __privateGet(_Quat, _TMP_MAT3)[3] = right[1]; + __privateGet(_Quat, _TMP_MAT3)[6] = right[2]; + __privateGet(_Quat, _TMP_MAT3)[1] = up[0]; + __privateGet(_Quat, _TMP_MAT3)[4] = up[1]; + __privateGet(_Quat, _TMP_MAT3)[7] = up[2]; + __privateGet(_Quat, _TMP_MAT3)[2] = -view[0]; + __privateGet(_Quat, _TMP_MAT3)[5] = -view[1]; + __privateGet(_Quat, _TMP_MAT3)[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3))); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + _DEFAULT_ANGLE_ORDER = new WeakMap(); + _TMP_QUAT1 = new WeakMap(); + _TMP_QUAT2 = new WeakMap(); + _TMP_MAT3 = new WeakMap(); + _TMP_VEC32 = new WeakMap(); + _X_UNIT_VEC3 = new WeakMap(); + _Y_UNIT_VEC3 = new WeakMap(); + __privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, "zyx"); + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + __privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4)); + __privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4)); + __privateAdd(_Quat, _TMP_MAT3, new Float64Array(9)); + __privateAdd(_Quat, _TMP_VEC32, new Float64Array(3)); + __privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0])); + __privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0])); + var Quat = _Quat; + Quat.set = Vec4.set; + Quat.add = Vec4.add; + Quat.lerp = Vec4.lerp; + Quat.normalize = Vec4.normalize; + Quat.squaredLength = Vec4.squaredLength; + Quat.sqrLen = Vec4.squaredLength; + Quat.exactEquals = Vec4.exactEquals; + Quat.equals = Vec4.equals; + Quat.magnitude = Vec4.magnitude; + Quat.prototype.mul = Quat.prototype.multiply; + Quat.mul = Quat.multiply; + Quat.mag = Quat.magnitude; + Quat.length = Quat.magnitude; + Quat.len = Quat.magnitude; + + // src/_lib/f64/Quat2.ts + var _TMP_QUAT, _TMP_VEC33; + var _Quat2 = /*#__PURE__*/function (_Float64Array8) { + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + function _Quat2() { + var _this8; + _classCallCheck(this, _Quat2); + for (var _len12 = arguments.length, values = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { + values[_key12] = arguments[_key12]; + } + switch (values.length) { + case 8: + _this8 = _callSuper(this, _Quat2, [values]); + break; + case 2: + _this8 = _callSuper(this, _Quat2, [values[0], values[1], 8]); + break; + case 1: + { + var v = values[0]; + if (typeof v === "number") { + _this8 = _callSuper(this, _Quat2, [[v, v, v, v, v, v, v, v]]); + } else { + _this8 = _callSuper(this, _Quat2, [v, 0, 8]); + } + break; + } + default: + _this8 = _callSuper(this, _Quat2, [8]); + _this8[3] = 1; + break; + } + return _assertThisInitialized(_this8); + } + //============ + // Accessors + //============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + _inherits(_Quat2, _Float64Array8); + return _createClass(_Quat2, [{ + key: "str", + get: function get() { + return _Quat2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + _get(_getPrototypeOf(_Quat2.prototype), "set", this).call(this, a); + return this; + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 8 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + }, { + key: "create", + value: function create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + }, { + key: "clone", + value: function clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + }, { + key: "fromValues", + value: function fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + }, { + key: "fromRotationTranslationValues", + value: function fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + var ax = x2 * 0.5; + var ay = y2 * 0.5; + var az = z2 * 0.5; + return new _Quat2(x1, y1, z1, w1, ax * w1 + ay * z1 - az * y1, ay * w1 + az * x1 - ax * z1, az * w1 + ax * y1 - ay * x1, -ax * x1 - ay * y1 - az * z1); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(out, q, t) { + var ax = t[0] * 0.5; + var ay = t[1] * 0.5; + var az = t[2] * 0.5; + var bx = q[0]; + var by = q[1]; + var bz = q[2]; + var bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + }, { + key: "fromTranslation", + value: function fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + }, { + key: "fromRotation", + value: function fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + }, { + key: "fromMat4", + value: function fromMat4(out, a) { + Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a); + Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a); + return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33)); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + }, { + key: "identity", + value: function identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + }, { + key: "getReal", + value: function getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + }, { + key: "getDual", + value: function getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + }, { + key: "setReal", + value: function setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + }, { + key: "setDual", + value: function setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + }, { + key: "getTranslation", + value: function getTranslation(out, a) { + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + }, { + key: "translate", + value: function translate(out, a, v) { + var ax1 = a[0]; + var ay1 = a[1]; + var az1 = a[2]; + var aw1 = a[3]; + var bx1 = v[0] * 0.5; + var by1 = v[1] * 0.5; + var bz1 = v[2] * 0.5; + var ax2 = a[4]; + var ay2 = a[5]; + var az2 = a[6]; + var aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateX", + value: function rotateX(out, a, rad) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var ax1 = ax * bw + aw * bx + ay * bz - az * by; + var ay1 = ay * bw + aw * by + az * bx - ax * bz; + var az1 = az * bw + aw * bz + ax * by - ay * bx; + var aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateY", + value: function rotateY(out, a, rad) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var ax1 = ax * bw + aw * bx + ay * bz - az * by; + var ay1 = ay * bw + aw * by + az * bx - ax * bz; + var az1 = az * bw + aw * bz + ax * by - ay * bx; + var aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + }, { + key: "rotateZ", + value: function rotateZ(out, a, rad) { + var bx = -a[0]; + var by = -a[1]; + var bz = -a[2]; + var bw = a[3]; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + var ax1 = ax * bw + aw * bx + ay * bz - az * by; + var ay1 = ay * bw + aw * by + az * bx - ax * bz; + var az1 = az * bw + aw * bz + ax * by - ay * bx; + var aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + }, { + key: "rotateByQuatAppend", + value: function rotateByQuatAppend(out, a, q) { + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var qw = q[3]; + var ax = a[0]; + var ay = a[1]; + var az = a[2]; + var aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + }, { + key: "rotateByQuatPrepend", + value: function rotateByQuatPrepend(out, q, a) { + var qx = q[0]; + var qy = q[1]; + var qz = q[2]; + var qw = q[3]; + var bx = a[0]; + var by = a[1]; + var bz = a[2]; + var bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + }, { + key: "rotateAroundAxis", + value: function rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + var axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad = rad * 0.5; + var s = Math.sin(rad); + var bx = s * axis[0] / axisLength; + var by = s * axis[1] / axisLength; + var bz = s * axis[2] / axisLength; + var bw = Math.cos(rad); + var ax1 = a[0]; + var ay1 = a[1]; + var az1 = a[2]; + var aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + var ax = a[4]; + var ay = a[5]; + var az = a[6]; + var aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + var ax0 = a[0]; + var ay0 = a[1]; + var az0 = a[2]; + var aw0 = a[3]; + var bx1 = b[4]; + var by1 = b[5]; + var bz1 = b[6]; + var bw1 = b[7]; + var ax1 = a[4]; + var ay1 = a[5]; + var az1 = a[6]; + var aw1 = a[7]; + var bx0 = b[0]; + var by0 = b[1]; + var bz0 = b[2]; + var bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + }, { + key: "dot", + value: function dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var mt = 1 - t; + if (_Quat2.dot(a, b) < 0) t = -t; + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + }, { + key: "invert", + value: function invert(out, a) { + var sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2} + * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + }, { + key: "conjugate", + value: function conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + }, { + key: "magnitude", + value: function magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a) { + return 0; + } + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + var a0 = a[0] / magnitude; + var a1 = a[1] / magnitude; + var a2 = a[2] / magnitude; + var a3 = a[3] / magnitude; + var b0 = a[4]; + var b1 = a[5]; + var b2 = a[6]; + var b3 = a[7]; + var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Quat2(".concat(a.join(", "), ")"); + } + /** + * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(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]; + } + /** + * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var a2 = a[2]; + var a3 = a[3]; + var a4 = a[4]; + var a5 = a[5]; + var a6 = a[6]; + var a7 = a[7]; + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + var b4 = b[4]; + var b5 = b[5]; + var b6 = b[6]; + var b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + _TMP_QUAT = new WeakMap(); + _TMP_VEC33 = new WeakMap(); + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + __privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4)); + __privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3)); + var Quat2 = _Quat2; + Quat2.dot = Quat.dot; + Quat2.squaredLength = Quat.squaredLength; + Quat2.sqrLen = Quat.squaredLength; + Quat2.mag = Quat.magnitude; + Quat2.length = Quat.magnitude; + Quat2.len = Quat.magnitude; + Quat2.mul = Quat2.multiply; + + // src/_lib/f64/Vec2.ts + var Vec2 = /*#__PURE__*/function (_Float64Array9) { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + function _Vec2() { + var _this9; + _classCallCheck(this, _Vec2); + switch (arguments.length) { + case 2: + { + var v = arguments.length <= 0 ? undefined : arguments[0]; + if (typeof v === "number") { + _this9 = _callSuper(this, _Vec2, [[v, arguments.length <= 1 ? undefined : arguments[1]]]); + } else { + _this9 = _callSuper(this, _Vec2, [v, arguments.length <= 1 ? undefined : arguments[1], 2]); + } + break; + } + case 1: + { + var _v = arguments.length <= 0 ? undefined : arguments[0]; + if (typeof _v === "number") { + _this9 = _callSuper(this, _Vec2, [[_v, _v]]); + } else { + _this9 = _callSuper(this, _Vec2, [_v, 0, 2]); + } + break; + } + default: + _this9 = _callSuper(this, _Vec2, [2]); + break; + } + return _assertThisInitialized(_this9); + } + //============ + // Accessors + //============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + _inherits(_Vec2, _Float64Array9); + return _createClass(_Vec2, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + }, { + key: "magnitude", + get: function get() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + }, { + key: "squaredMagnitude", + get: function get() { + var x = this[0]; + var y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + }, { + key: "str", + get: function get() { + return _Vec2.str(this); + } + //=================== + // Instances methods + //=================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + }, { + key: "copy", + value: function copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + }, { + key: "add", + value: function add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + }, { + key: "subtract", + value: function subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + }, { + key: "sub", + value: function sub(b) { + return this; + } + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + }, { + key: "multiply", + value: function multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + }, { + key: "mul", + value: function mul(b) { + return this; + } + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + }, { + key: "divide", + value: function divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + }, { + key: "div", + value: function div(b) { + return this; + } + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + }, { + key: "scale", + value: function scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + }, { + key: "distance", + value: function distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + }, { + key: "dist", + value: function dist(b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + }, { + key: "sqrDist", + value: function sqrDist(b) { + return 0; + } + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "negate", + value: function negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "invert", + value: function invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "abs", + value: function abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + }, { + key: "dot", + value: function dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + }, { + key: "normalize", + value: function normalize() { + return _Vec2.normalize(this, this); + } + //=================== + // Static accessors + //=================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 2 * Float64Array.BYTES_PER_ELEMENT; + } + //=================== + // Static methods + //=================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + }, { + key: "create", + value: function create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + }, { + key: "clone", + value: function clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + }, { + key: "fromValues", + value: function fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + }, { + key: "copy", + value: function copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + }, { + key: "set", + value: function set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "add", + value: function add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "subtract", + value: function subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + }, { + key: "sub", + value: function sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "multiply", + value: function multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + }, { + key: "mul", + value: function mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "divide", + value: function divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + }, { + key: "div", + value: function div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + }, { + key: "ceil", + value: function ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + }, { + key: "floor", + value: function floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "min", + value: function min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "max", + value: function max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + }, { + key: "round", + value: function round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + }, { + key: "scale", + value: function scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + }, { + key: "distance", + value: function distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + }, { + key: "dist", + value: function dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + }, { + key: "squaredDistance", + value: function squaredDistance(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + }, { + key: "sqrDist", + value: function sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + }, { + key: "magnitude", + value: function magnitude(a) { + var x = a[0]; + var y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + }, { + key: "mag", + value: function mag(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // @ts-ignore: Length conflicts with Function.length + }, { + key: "length", + value: function length(a) { + return 0; + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + }, { + key: "len", + value: function len(a) { + return 0; + } + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + }, { + key: "squaredLength", + value: function squaredLength(a) { + var x = a[0]; + var y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + }, { + key: "sqrLen", + value: function sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + }, { + key: "negate", + value: function negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + }, { + key: "inverse", + value: function inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + }, { + key: "abs", + value: function abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + }, { + key: "normalize", + value: function normalize(out, a) { + var x = a[0]; + var y = a[1]; + var len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + }, { + key: "dot", + value: function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + }, { + key: "cross", + value: function cross(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + }, { + key: "lerp", + value: function lerp(out, a, b, t) { + var ax = a[0]; + var ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat2", + value: function transformMat2(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat2d", + value: function transformMat2d(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat3", + value: function transformMat3(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + }, { + key: "transformMat4", + value: function transformMat4(out, a, m) { + var x = a[0]; + var y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + }, { + key: "rotate", + value: function rotate(out, a, b, rad) { + var p0 = a[0] - b[0]; + var p1 = a[1] - b[1]; + var sinC = Math.sin(rad); + var cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + }, { + key: "angle", + value: function angle(a, b) { + var x1 = a[0]; + var y1 = a[1]; + var x2 = b[0]; + var y2 = b[1]; + var mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + var cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + }, { + key: "zero", + value: function zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + }, { + key: "exactEquals", + value: function exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether or not the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + }, { + key: "equals", + value: function equals(a, b) { + var a0 = a[0]; + var a1 = a[1]; + var b0 = b[0]; + var b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + }, { + key: "str", + value: function str(a) { + return "Vec2(".concat(a.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + Vec2.prototype.sub = Vec2.prototype.subtract; + Vec2.prototype.mul = Vec2.prototype.multiply; + Vec2.prototype.div = Vec2.prototype.divide; + Vec2.prototype.dist = Vec2.prototype.distance; + Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; + Vec2.sub = Vec2.subtract; + Vec2.mul = Vec2.multiply; + Vec2.div = Vec2.divide; + Vec2.dist = Vec2.distance; + Vec2.sqrDist = Vec2.squaredDistance; + Vec2.sqrLen = Vec2.squaredLength; + Vec2.mag = Vec2.magnitude; + Vec2.length = Vec2.magnitude; + Vec2.len = Vec2.magnitude; + + // src/swizzle/f64/index.ts + var GLM_SWIZZLES_ENABLED_F64 = false; + function EnableSwizzlesF64() { + if (GLM_SWIZZLES_ENABLED_F64) { + return; + } + var VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + var VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + var VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + var SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function () { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function () { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + }; + case 4: + return function () { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; + } + } + for (var _i = 0, _VEC2_SWIZZLES = VEC2_SWIZZLES; _i < _VEC2_SWIZZLES.length; _i++) { + var swizzle = _VEC2_SWIZZLES[_i]; + var impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (var _i2 = 0, _VEC3_SWIZZLES = VEC3_SWIZZLES; _i2 < _VEC3_SWIZZLES.length; _i2++) { + var _swizzle = _VEC3_SWIZZLES[_i2]; + var _impl = getSwizzleImpl(_swizzle); + Object.defineProperty(Vec3.prototype, _swizzle, { + get: _impl + }); + Object.defineProperty(Vec4.prototype, _swizzle, { + get: _impl + }); + } + for (var _i3 = 0, _VEC4_SWIZZLES = VEC4_SWIZZLES; _i3 < _VEC4_SWIZZLES.length; _i3++) { + var _swizzle2 = _VEC4_SWIZZLES[_i3]; + var _impl2 = getSwizzleImpl(_swizzle2); + Object.defineProperty(Vec4.prototype, _swizzle2, { + get: _impl2 + }); + } + GLM_SWIZZLES_ENABLED_F64 = true; + } + + // src/util/angleConversion.ts + var GLM_DEG_TO_RAD = Math.PI / 180; + var GLM_RAD_TO_DEG = 180 / Math.PI; + function toDegree(value) { + return value * GLM_RAD_TO_DEG; + } + function toRadian(value) { + return value * GLM_DEG_TO_RAD; + } + + exports.EnableSwizzlesF64 = EnableSwizzlesF64; + exports.Mat2 = Mat2; + exports.Mat2d = Mat2d; + exports.Mat3 = Mat3; + exports.Mat4 = Mat4; + exports.Quat = Quat; + exports.Quat2 = Quat2; + exports.Vec2 = Vec2; + exports.Vec3 = Vec3; + exports.Vec4 = Vec4; + exports.toDegree = toDegree; + exports.toRadian = toRadian; + +})); +//# sourceMappingURL=gl-matrix-f64.cjs.map diff --git a/dist-cdn/umd/gl-matrix-f64.cjs.map b/dist-cdn/umd/gl-matrix-f64.cjs.map new file mode 100644 index 00000000..c48eb123 --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f64.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f64.cjs","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.min.cjs b/dist-cdn/umd/gl-matrix-f64.min.cjs new file mode 100644 index 00000000..3372d6f2 --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f64.min.cjs @@ -0,0 +1,4436 @@ +[object Object] +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrix = {})); +})(this, (function (exports) { 'use strict'; + + function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; + } + function _callSuper(t, o, e) { + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); + } + function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); + } + function _construct(t, e, r) { + if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _setPrototypeOf(p, r.prototype), p; + } + function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); + } + } + function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; + } + function _get() { + return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = _superPropBase(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, _get.apply(null, arguments); + } + function _getPrototypeOf(t) { + return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, _getPrototypeOf(t); + } + function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && _setPrototypeOf(t, e); + } + function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } + } + function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (_isNativeReflectConstruct = function () { + return !!t; + })(); + } + function _possibleConstructorReturn(t, e) { + if (e && ("object" == typeof e || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return _assertThisInitialized(t); + } + function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); + } + function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); + return t; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r ); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (String )(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return _wrapNativeSuper = function (t) { + if (null === t || !_isNativeFunction(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return _construct(t, arguments, _getPrototypeOf(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), _setPrototypeOf(Wrapper, t); + }, _wrapNativeSuper(t); + } + + // glMatrix - v4.0.0-beta.3 + var de = function de(A) { + throw TypeError(A); + }; + var xe = function xe(A, e, t) { + return e.has(A) || de("Cannot " + t); + }; + var E = function E(A, e, t) { + return xe(A, e, "read from private field"), t ? t.call(A) : e.get(A); + }, + Z = function Z(A, e, t) { + return e.has(A) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(A) : e.set(A, t); + }; + var ne, + C = /*#__PURE__*/function (_Float64Array) { + function C() { + var _this; + _classCallCheck(this, C); + for (var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++) { + e[_key] = arguments[_key]; + } + switch (e.length) { + case 4: + _this = _callSuper(this, C, [e]); + break; + case 2: + _this = _callSuper(this, C, [e[0], e[1], 4]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this = _callSuper(this, C, [[t, t, t, t]]) : _this = _callSuper(this, C, [t, 0, 4]); + break; + default: + _this = _callSuper(this, C, [E(C, ne)]); + break; + } + return _assertThisInitialized(_this); + } + _inherits(C, _Float64Array); + return _createClass(C, [{ + key: "str", + get: function get() { + return C.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E(C, ne)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return C.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "transpose", + value: function transpose() { + return C.transpose(this, this); + } + }, { + key: "invert", + value: function invert() { + return C.invert(this, this); + } + }, { + key: "scale", + value: function scale(e) { + return C.scale(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e) { + return C.rotate(this, this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new C(); + } + }, { + key: "clone", + value: function clone(e) { + return new C(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + e[_key2] = arguments[_key2]; + } + return _construct(C, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e; + } + }, { + key: "transpose", + value: function transpose(e, t) { + if (e === t) { + var n = t[1]; + e[1] = t[2], e[2] = n; + } else e[0] = t[0], e[1] = t[2], e[2] = t[1], e[3] = t[3]; + return e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = n * i - r * s; + return a ? (a = 1 / a, e[0] = i * a, e[1] = -s * a, e[2] = -r * a, e[3] = n * a, e) : null; + } + }, { + key: "adjoint", + value: function adjoint(e, t) { + var n = t[0]; + return e[0] = t[3], e[1] = -t[1], e[2] = -t[2], e[3] = n, e; + } + }, { + key: "determinant", + value: function determinant(e) { + return e[0] * e[3] - e[2] * e[1]; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = n[0], + y = n[1], + L = n[2], + k = n[3]; + return e[0] = s * c + i * y, e[1] = r * c + a * y, e[2] = s * L + i * k, e[3] = r * L + a * k, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "rotate", + value: function rotate(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y + i * c, e[1] = r * y + a * c, e[2] = s * -c + i * y, e[3] = r * -c + a * y, e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = n[0], + y = n[1]; + return e[0] = s * c, e[1] = r * c, e[2] = i * y, e[3] = a * y, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = -n, e[3] = s, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = t[1], e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3]); + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e; + } + }, { + key: "LDU", + value: function LDU(e, t, n, s) { + return e[2] = s[2] / s[0], n[0] = s[0], n[1] = s[1], n[3] = s[3] - e[2] * n[1], [e, t, n]; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = e[3], + a = t[0], + c = t[1], + y = t[2], + L = t[3]; + return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(i - L) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(L)); + } + }, { + key: "str", + value: function str(e) { + return "Mat2(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + ne = new WeakMap(), Z(C, ne, new Float64Array([1, 0, 0, 1])); + var v = C; + v.prototype.mul = v.prototype.multiply; + v.mul = v.multiply; + v.sub = v.subtract; + var se, + $ = /*#__PURE__*/function (_Float64Array2) { + function $() { + var _this2; + _classCallCheck(this, $); + for (var _len3 = arguments.length, e = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + e[_key3] = arguments[_key3]; + } + switch (e.length) { + case 6: + _this2 = _callSuper(this, $, [e]); + break; + case 2: + _this2 = _callSuper(this, $, [e[0], e[1], 6]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this2 = _callSuper(this, $, [[t, t, t, t, t, t]]) : _this2 = _callSuper(this, $, [t, 0, 6]); + break; + default: + _this2 = _callSuper(this, $, [E($, se)]); + break; + } + return _assertThisInitialized(_this2); + } + _inherits($, _Float64Array2); + return _createClass($, [{ + key: "str", + get: function get() { + return $.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E($, se)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return $.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "translate", + value: function translate(e) { + return $.translate(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e) { + return $.rotate(this, this, e); + } + }, { + key: "scale", + value: function scale(e) { + return $.scale(this, this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 6 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new $(); + } + }, { + key: "clone", + value: function clone(e) { + return new $(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len4 = arguments.length, e = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + e[_key4] = arguments[_key4]; + } + return _construct($, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e[4] = arguments.length <= 5 ? undefined : arguments[5], e[5] = arguments.length <= 6 ? undefined : arguments[6], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = n * i - s * r; + return y ? (y = 1 / y, e[0] = i * y, e[1] = -s * y, e[2] = -r * y, e[3] = n * y, e[4] = (r * c - i * a) * y, e[5] = (s * a - n * c) * y, e) : null; + } + }, { + key: "determinant", + value: function determinant(e) { + return e[0] * e[3] - e[1] * e[2]; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e[4] = t[4] - n[4], e[5] = t[5] - n[5], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = n[0], + k = n[1], + l = n[2], + b = n[3], + h = n[4], + M = n[5]; + return e[0] = s * L + i * k, e[1] = r * L + a * k, e[2] = s * l + i * b, e[3] = r * l + a * b, e[4] = s * h + i * M + c, e[5] = r * h + a * M + y, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = n[0], + k = n[1]; + return e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = s * L + i * k + c, e[5] = r * L + a * k + y, e; + } + }, { + key: "rotate", + value: function rotate(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = Math.sin(n), + k = Math.cos(n); + return e[0] = s * k + i * L, e[1] = r * k + a * L, e[2] = s * -L + i * k, e[3] = r * -L + a * k, e[4] = c, e[5] = y, e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = n[0], + k = n[1]; + return e[0] = s * L, e[1] = r * L, e[2] = i * k, e[3] = a * k, e[4] = c, e[5] = y, e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = t[0], e[5] = t[1], e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = -n, e[3] = s, e[4] = 0, e[5] = 0, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = t[1], e[4] = 0, e[5] = 0, e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3] + e[4] * e[4] + e[5] * e[5] + 1); + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e[4] = t[4] + n[4] * s, e[5] = t[5] + n[5] * s, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = e[3], + a = e[4], + c = e[5], + y = t[0], + L = t[1], + k = t[2], + l = t[3], + b = t[4], + h = t[5]; + return Math.abs(n - y) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(y)) && Math.abs(s - L) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(L)) && Math.abs(r - k) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(k)) && Math.abs(i - l) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(l)) && Math.abs(a - b) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(c - h) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(h)); + } + }, { + key: "str", + value: function str(e) { + return "Mat2d(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + se = new WeakMap(), Z($, se, new Float64Array([1, 0, 0, 1, 0, 0])); + var _ = $; + _.mul = _.multiply; + _.sub = _.subtract; + var re, + X = /*#__PURE__*/function (_Float64Array3) { + function X() { + var _this3; + _classCallCheck(this, X); + for (var _len5 = arguments.length, e = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + e[_key5] = arguments[_key5]; + } + switch (e.length) { + case 9: + _this3 = _callSuper(this, X, [e]); + break; + case 2: + _this3 = _callSuper(this, X, [e[0], e[1], 9]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this3 = _callSuper(this, X, [[t, t, t, t, t, t, t, t, t]]) : _this3 = _callSuper(this, X, [t, 0, 9]); + break; + default: + _this3 = _callSuper(this, X, [E(X, re)]); + break; + } + return _assertThisInitialized(_this3); + } + _inherits(X, _Float64Array3); + return _createClass(X, [{ + key: "str", + get: function get() { + return X.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E(X, re)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return X.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "transpose", + value: function transpose() { + return X.transpose(this, this); + } + }, { + key: "invert", + value: function invert() { + return X.invert(this, this); + } + }, { + key: "translate", + value: function translate(e) { + return X.translate(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e) { + return X.rotate(this, this, e); + } + }, { + key: "scale", + value: function scale(e) { + return X.scale(this, this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 9 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new X(); + } + }, { + key: "clone", + value: function clone(e) { + return new X(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len6 = arguments.length, e = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + e[_key6] = arguments[_key6]; + } + return _construct(X, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e[4] = arguments.length <= 5 ? undefined : arguments[5], e[5] = arguments.length <= 6 ? undefined : arguments[6], e[6] = arguments.length <= 7 ? undefined : arguments[7], e[7] = arguments.length <= 8 ? undefined : arguments[8], e[8] = arguments.length <= 9 ? undefined : arguments[9], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 1, e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e; + } + }, { + key: "transpose", + value: function transpose(e, t) { + if (e === t) { + var n = t[1], + s = t[2], + r = t[5]; + e[1] = t[3], e[2] = t[6], e[3] = n, e[5] = t[7], e[6] = s, e[7] = r; + } else e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8]; + return e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = k * a - c * L, + b = -k * i + c * y, + h = L * i - a * y, + M = n * l + s * b + r * h; + return M ? (M = 1 / M, e[0] = l * M, e[1] = (-k * s + r * L) * M, e[2] = (c * s - r * a) * M, e[3] = b * M, e[4] = (k * n - r * y) * M, e[5] = (-c * n + r * i) * M, e[6] = h * M, e[7] = (-L * n + s * y) * M, e[8] = (a * n - s * i) * M, e) : null; + } + }, { + key: "adjoint", + value: function adjoint(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8]; + return e[0] = a * k - c * L, e[1] = r * L - s * k, e[2] = s * c - r * a, e[3] = c * y - i * k, e[4] = n * k - r * y, e[5] = r * i - n * c, e[6] = i * L - a * y, e[7] = s * y - n * L, e[8] = n * a - s * i, e; + } + }, { + key: "determinant", + value: function determinant(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3], + i = e[4], + a = e[5], + c = e[6], + y = e[7], + L = e[8]; + return t * (L * i - a * y) + n * (-L * r + a * c) + s * (y * r - i * c); + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e[6] = t[6] + n[6], e[7] = t[7] + n[7], e[8] = t[8] + n[8], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e[4] = t[4] - n[4], e[5] = t[5] - n[5], e[6] = t[6] - n[6], e[7] = t[7] - n[7], e[8] = t[8] - n[8], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + b = n[0], + h = n[1], + M = n[2]; + return e[0] = b * s + h * a + M * L, e[1] = b * r + h * c + M * k, e[2] = b * i + h * y + M * l, b = n[3], h = n[4], M = n[5], e[3] = b * s + h * a + M * L, e[4] = b * r + h * c + M * k, e[5] = b * i + h * y + M * l, b = n[6], h = n[7], M = n[8], e[6] = b * s + h * a + M * L, e[7] = b * r + h * c + M * k, e[8] = b * i + h * y + M * l, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + b = n[0], + h = n[1]; + return e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = c, e[5] = y, e[6] = b * s + h * a + L, e[7] = b * r + h * c + k, e[8] = b * i + h * y + l, e; + } + }, { + key: "rotate", + value: function rotate(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + b = Math.sin(n), + h = Math.cos(n); + return e[0] = h * s + b * a, e[1] = h * r + b * c, e[2] = h * i + b * y, e[3] = h * a - b * s, e[4] = h * c - b * r, e[5] = h * y - b * i, e[6] = L, e[7] = k, e[8] = l, e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = n[0], + r = n[1]; + return e[0] = s * t[0], e[1] = s * t[1], e[2] = s * t[2], e[3] = r * t[3], e[4] = r * t[4], e[5] = r * t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 1, e[5] = 0, e[6] = t[0], e[7] = t[1], e[8] = 1, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = 0, e[3] = -n, e[4] = s, e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = 0, e[4] = t[1], e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e; + } + }, { + key: "fromMat2d", + value: function fromMat2d(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = 0, e[3] = t[2], e[4] = t[3], e[5] = 0, e[6] = t[4], e[7] = t[5], e[8] = 1, e; + } + }, { + key: "fromQuat", + value: function fromQuat(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = n + n, + c = s + s, + y = r + r, + L = n * a, + k = s * a, + l = s * c, + b = r * a, + h = r * c, + M = r * y, + d = i * a, + m = i * c, + x = i * y; + return e[0] = 1 - l - M, e[3] = k - x, e[6] = b + m, e[1] = k + x, e[4] = 1 - L - M, e[7] = h - d, e[2] = b - m, e[5] = h + d, e[8] = 1 - L - l, e; + } + }, { + key: "fromMat4", + value: function fromMat4(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[4], e[4] = t[5], e[5] = t[6], e[6] = t[8], e[7] = t[9], e[8] = t[10], e; + } + }, { + key: "normalFromMat4", + value: function normalFromMat4(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + b = t[10], + h = t[11], + M = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * a, + o = n * y - r * a, + R = n * L - i * a, + z = s * y - r * c, + g = s * L - i * c, + S = r * L - i * y, + B = k * d - l * M, + N = k * m - b * M, + p = k * x - h * M, + Y = l * m - b * d, + I = l * x - h * d, + P = b * x - h * m, + Q = V * P - o * I + R * Y + z * p - g * N + S * B; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - a * P - L * N) * Q, e[2] = (a * I - c * p + L * B) * Q, e[3] = (r * I - s * P - i * Y) * Q, e[4] = (n * P - r * p + i * N) * Q, e[5] = (s * p - n * I - i * B) * Q, e[6] = (d * S - m * g + x * z) * Q, e[7] = (m * R - M * S - x * o) * Q, e[8] = (M * g - d * R + x * V) * Q, e) : null; + } + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[4], + a = t[5], + c = t[6], + y = t[8], + L = t[9], + k = t[10]; + return e[0] = a * k - k * L, e[1] = c * y - y * k, e[2] = i * L - L * y, e[3] = L * r - k * s, e[4] = k * n - y * r, e[5] = y * s - L * n, e[6] = s * c - r * a, e[7] = r * i - n * c, e[8] = n * a - s * i, e; + } + }, { + key: "projection", + value: function projection(e, t, n) { + return e[0] = 2 / t, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = -2 / n, e[5] = 0, e[6] = -1, e[7] = 1, e[8] = 1, e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3] + e[4] * e[4] + e[5] * e[5] + e[6] * e[6] + e[7] * e[7] + e[8] * e[8]); + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e[6] = t[6] * n, e[7] = t[7] * n, e[8] = t[8] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e[4] = t[4] + n[4] * s, e[5] = t[5] + n[5] * s, e[6] = t[6] + n[6] * s, e[7] = t[7] + n[7] * s, e[8] = t[8] + n[8] * s, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7] && e[8] === t[8]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = e[3], + a = e[4], + c = e[5], + y = e[6], + L = e[7], + k = e[8], + l = t[0], + b = t[1], + h = t[2], + M = t[3], + d = t[4], + m = t[5], + x = t[6], + V = t[7], + o = t[8]; + return Math.abs(n - l) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(l)) && Math.abs(s - b) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(b)) && Math.abs(r - h) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(h)) && Math.abs(i - M) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(M)) && Math.abs(a - d) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(d)) && Math.abs(c - m) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(y - x) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(x)) && Math.abs(L - V) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(V)) && Math.abs(k - o) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(o)); + } + }, { + key: "str", + value: function str(e) { + return "Mat3(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + re = new WeakMap(), Z(X, re, new Float64Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); + var u = X; + u.prototype.mul = u.prototype.multiply; + u.mul = u.multiply; + u.sub = u.subtract; + var ie, + H, + D = /*#__PURE__*/function (_Float64Array4) { + function D() { + var _this4; + _classCallCheck(this, D); + for (var _len7 = arguments.length, e = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + e[_key7] = arguments[_key7]; + } + switch (e.length) { + case 16: + _this4 = _callSuper(this, D, [e]); + break; + case 2: + _this4 = _callSuper(this, D, [e[0], e[1], 16]); + break; + case 1: + var t = e[0]; + typeof t == "number" ? _this4 = _callSuper(this, D, [[t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]]) : _this4 = _callSuper(this, D, [t, 0, 16]); + break; + default: + _this4 = _callSuper(this, D, [E(D, ie)]); + break; + } + return _assertThisInitialized(_this4); + } + _inherits(D, _Float64Array4); + return _createClass(D, [{ + key: "str", + get: function get() { + return D.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "identity", + value: function identity() { + return this.set(E(D, ie)), this; + } + }, { + key: "multiply", + value: function multiply(e) { + return D.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "transpose", + value: function transpose() { + return D.transpose(this, this); + } + }, { + key: "invert", + value: function invert() { + return D.invert(this, this); + } + }, { + key: "translate", + value: function translate(e) { + return D.translate(this, this, e); + } + }, { + key: "rotate", + value: function rotate(e, t) { + return D.rotate(this, this, e, t); + } + }, { + key: "scale", + value: function scale(e) { + return D.scale(this, this, e); + } + }, { + key: "rotateX", + value: function rotateX(e) { + return D.rotateX(this, this, e); + } + }, { + key: "rotateY", + value: function rotateY(e) { + return D.rotateY(this, this, e); + } + }, { + key: "rotateZ", + value: function rotateZ(e) { + return D.rotateZ(this, this, e); + } + }, { + key: "perspectiveNO", + value: function perspectiveNO(e, t, n, s) { + return D.perspectiveNO(this, e, t, n, s); + } + }, { + key: "perspectiveZO", + value: function perspectiveZO(e, t, n, s) { + return D.perspectiveZO(this, e, t, n, s); + } + }, { + key: "orthoNO", + value: function orthoNO(e, t, n, s, r, i) { + return D.orthoNO(this, e, t, n, s, r, i); + } + }, { + key: "orthoZO", + value: function orthoZO(e, t, n, s, r, i) { + return D.orthoZO(this, e, t, n, s, r, i); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 16 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new D(); + } + }, { + key: "clone", + value: function clone(e) { + return new D(e); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; + } + }, { + key: "fromValues", + value: function fromValues() { + for (var _len8 = arguments.length, e = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + e[_key8] = arguments[_key8]; + } + return _construct(D, e); + } + }, { + key: "set", + value: function set(e) { + return e[0] = arguments.length <= 1 ? undefined : arguments[1], e[1] = arguments.length <= 2 ? undefined : arguments[2], e[2] = arguments.length <= 3 ? undefined : arguments[3], e[3] = arguments.length <= 4 ? undefined : arguments[4], e[4] = arguments.length <= 5 ? undefined : arguments[5], e[5] = arguments.length <= 6 ? undefined : arguments[6], e[6] = arguments.length <= 7 ? undefined : arguments[7], e[7] = arguments.length <= 8 ? undefined : arguments[8], e[8] = arguments.length <= 9 ? undefined : arguments[9], e[9] = arguments.length <= 10 ? undefined : arguments[10], e[10] = arguments.length <= 11 ? undefined : arguments[11], e[11] = arguments.length <= 12 ? undefined : arguments[12], e[12] = arguments.length <= 13 ? undefined : arguments[13], e[13] = arguments.length <= 14 ? undefined : arguments[14], e[14] = arguments.length <= 15 ? undefined : arguments[15], e[15] = arguments.length <= 16 ? undefined : arguments[16], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "transpose", + value: function transpose(e, t) { + if (e === t) { + var n = t[1], + s = t[2], + r = t[3], + i = t[6], + a = t[7], + c = t[11]; + e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = n, e[6] = t[9], e[7] = t[13], e[8] = s, e[9] = i, e[11] = t[14], e[12] = r, e[13] = a, e[14] = c; + } else e[0] = t[0], e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = t[1], e[5] = t[5], e[6] = t[9], e[7] = t[13], e[8] = t[2], e[9] = t[6], e[10] = t[10], e[11] = t[14], e[12] = t[3], e[13] = t[7], e[14] = t[11], e[15] = t[15]; + return e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + b = t[10], + h = t[11], + M = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * a, + o = n * y - r * a, + R = n * L - i * a, + z = s * y - r * c, + g = s * L - i * c, + S = r * L - i * y, + B = k * d - l * M, + N = k * m - b * M, + p = k * x - h * M, + Y = l * m - b * d, + I = l * x - h * d, + P = b * x - h * m, + Q = V * P - o * I + R * Y + z * p - g * N + S * B; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (r * I - s * P - i * Y) * Q, e[2] = (d * S - m * g + x * z) * Q, e[3] = (b * g - l * S - h * z) * Q, e[4] = (y * p - a * P - L * N) * Q, e[5] = (n * P - r * p + i * N) * Q, e[6] = (m * R - M * S - x * o) * Q, e[7] = (k * S - b * R + h * o) * Q, e[8] = (a * I - c * p + L * B) * Q, e[9] = (s * p - n * I - i * B) * Q, e[10] = (M * g - d * R + x * V) * Q, e[11] = (l * R - k * g - h * V) * Q, e[12] = (c * N - a * Y - y * B) * Q, e[13] = (n * Y - s * N + r * B) * Q, e[14] = (d * o - M * z - m * V) * Q, e[15] = (k * z - l * o + b * V) * Q, e) : null; + } + }, { + key: "adjoint", + value: function adjoint(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + b = t[10], + h = t[11], + M = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * a, + o = n * y - r * a, + R = n * L - i * a, + z = s * y - r * c, + g = s * L - i * c, + S = r * L - i * y, + B = k * d - l * M, + N = k * m - b * M, + p = k * x - h * M, + Y = l * m - b * d, + I = l * x - h * d, + P = b * x - h * m; + return e[0] = c * P - y * I + L * Y, e[1] = r * I - s * P - i * Y, e[2] = d * S - m * g + x * z, e[3] = b * g - l * S - h * z, e[4] = y * p - a * P - L * N, e[5] = n * P - r * p + i * N, e[6] = m * R - M * S - x * o, e[7] = k * S - b * R + h * o, e[8] = a * I - c * p + L * B, e[9] = s * p - n * I - i * B, e[10] = M * g - d * R + x * V, e[11] = l * R - k * g - h * V, e[12] = c * N - a * Y - y * B, e[13] = n * Y - s * N + r * B, e[14] = d * o - M * z - m * V, e[15] = k * z - l * o + b * V, e; + } + }, { + key: "determinant", + value: function determinant(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3], + i = e[4], + a = e[5], + c = e[6], + y = e[7], + L = e[8], + k = e[9], + l = e[10], + b = e[11], + h = e[12], + M = e[13], + d = e[14], + m = e[15], + x = t * a - n * i, + V = t * c - s * i, + o = n * c - s * a, + R = L * M - k * h, + z = L * d - l * h, + g = k * d - l * M, + S = t * g - n * z + s * R, + B = i * g - a * z + c * R, + N = L * o - k * V + l * x, + p = h * o - M * V + d * x; + return y * S - r * B + m * N - b * p; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = t[8], + b = t[9], + h = t[10], + M = t[11], + d = t[12], + m = t[13], + x = t[14], + V = t[15], + o = n[0], + R = n[1], + z = n[2], + g = n[3]; + return e[0] = o * s + R * c + z * l + g * d, e[1] = o * r + R * y + z * b + g * m, e[2] = o * i + R * L + z * h + g * x, e[3] = o * a + R * k + z * M + g * V, o = n[4], R = n[5], z = n[6], g = n[7], e[4] = o * s + R * c + z * l + g * d, e[5] = o * r + R * y + z * b + g * m, e[6] = o * i + R * L + z * h + g * x, e[7] = o * a + R * k + z * M + g * V, o = n[8], R = n[9], z = n[10], g = n[11], e[8] = o * s + R * c + z * l + g * d, e[9] = o * r + R * y + z * b + g * m, e[10] = o * i + R * L + z * h + g * x, e[11] = o * a + R * k + z * M + g * V, o = n[12], R = n[13], z = n[14], g = n[15], e[12] = o * s + R * c + z * l + g * d, e[13] = o * r + R * y + z * b + g * m, e[14] = o * i + R * L + z * h + g * x, e[15] = o * a + R * k + z * M + g * V, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = n[0], + r = n[1], + i = n[2]; + if (t === e) e[12] = t[0] * s + t[4] * r + t[8] * i + t[12], e[13] = t[1] * s + t[5] * r + t[9] * i + t[13], e[14] = t[2] * s + t[6] * r + t[10] * i + t[14], e[15] = t[3] * s + t[7] * r + t[11] * i + t[15];else { + var a = t[0], + c = t[1], + y = t[2], + L = t[3], + k = t[4], + l = t[5], + b = t[6], + h = t[7], + M = t[8], + d = t[9], + m = t[10], + x = t[11]; + e[0] = a, e[1] = c, e[2] = y, e[3] = L, e[4] = k, e[5] = l, e[6] = b, e[7] = h, e[8] = M, e[9] = d, e[10] = m, e[11] = x, e[12] = a * s + k * r + M * i + t[12], e[13] = c * s + l * r + d * i + t[13], e[14] = y * s + b * r + m * i + t[14], e[15] = L * s + h * r + x * i + t[15]; + } + return e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + var s = n[0], + r = n[1], + i = n[2]; + return e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s, e[3] = t[3] * s, e[4] = t[4] * r, e[5] = t[5] * r, e[6] = t[6] * r, e[7] = t[7] * r, e[8] = t[8] * i, e[9] = t[9] * i, e[10] = t[10] * i, e[11] = t[11] * i, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; + } + }, { + key: "rotate", + value: function rotate(e, t, n, s) { + var r = s[0], + i = s[1], + a = s[2], + c = Math.sqrt(r * r + i * i + a * a); + if (c < 1e-6) return null; + c = 1 / c, r *= c, i *= c, a *= c; + var y = Math.sin(n), + L = Math.cos(n), + k = 1 - L, + l = t[0], + b = t[1], + h = t[2], + M = t[3], + d = t[4], + m = t[5], + x = t[6], + V = t[7], + o = t[8], + R = t[9], + z = t[10], + g = t[11], + S = r * r * k + L, + B = i * r * k + a * y, + N = a * r * k - i * y, + p = r * i * k - a * y, + Y = i * i * k + L, + I = a * i * k + r * y, + P = r * a * k + i * y, + Q = i * a * k - r * y, + K = a * a * k + L; + return e[0] = l * S + d * B + o * N, e[1] = b * S + m * B + R * N, e[2] = h * S + x * B + z * N, e[3] = M * S + V * B + g * N, e[4] = l * p + d * Y + o * I, e[5] = b * p + m * Y + R * I, e[6] = h * p + x * Y + z * I, e[7] = M * p + V * Y + g * I, e[8] = l * P + d * Q + o * K, e[9] = b * P + m * Q + R * K, e[10] = h * P + x * Q + z * K, e[11] = M * P + V * Q + g * K, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n) { + var s = Math.sin(n), + r = Math.cos(n), + i = t[4], + a = t[5], + c = t[6], + y = t[7], + L = t[8], + k = t[9], + l = t[10], + b = t[11]; + return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = i * r + L * s, e[5] = a * r + k * s, e[6] = c * r + l * s, e[7] = y * r + b * s, e[8] = L * r - i * s, e[9] = k * r - a * s, e[10] = l * r - c * s, e[11] = b * r - y * s, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n) { + var s = Math.sin(n), + r = Math.cos(n), + i = t[0], + a = t[1], + c = t[2], + y = t[3], + L = t[8], + k = t[9], + l = t[10], + b = t[11]; + return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = i * r - L * s, e[1] = a * r - k * s, e[2] = c * r - l * s, e[3] = y * r - b * s, e[8] = i * s + L * r, e[9] = a * s + k * r, e[10] = c * s + l * r, e[11] = y * s + b * r, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n) { + var s = Math.sin(n), + r = Math.cos(n), + i = t[0], + a = t[1], + c = t[2], + y = t[3], + L = t[4], + k = t[5], + l = t[6], + b = t[7]; + return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = i * r + L * s, e[1] = a * r + k * s, e[2] = c * r + l * s, e[3] = y * r + b * s, e[4] = L * r - i * s, e[5] = k * r - a * s, e[6] = l * r - c * s, e[7] = b * r - y * s, e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = t[0], e[13] = t[1], e[14] = t[2], e[15] = 1, e; + } + }, { + key: "fromScaling", + value: function fromScaling(e, t) { + return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = t[1], e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = t[2], e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t, n) { + var s = n[0], + r = n[1], + i = n[2], + a = Math.sqrt(s * s + r * r + i * i); + if (a < 1e-6) return null; + a = 1 / a, s *= a, r *= a, i *= a; + var c = Math.sin(t), + y = Math.cos(t), + L = 1 - y; + return e[0] = s * s * L + y, e[1] = r * s * L + i * c, e[2] = i * s * L - r * c, e[3] = 0, e[4] = s * r * L - i * c, e[5] = r * r * L + y, e[6] = i * r * L + s * c, e[7] = 0, e[8] = s * i * L + r * c, e[9] = r * i * L - s * c, e[10] = i * i * L + y, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromXRotation", + value: function fromXRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = s, e[6] = n, e[7] = 0, e[8] = 0, e[9] = -n, e[10] = s, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromYRotation", + value: function fromYRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = 0, e[2] = -n, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = n, e[9] = 0, e[10] = s, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromZRotation", + value: function fromZRotation(e, t) { + var n = Math.sin(t), + s = Math.cos(t); + return e[0] = s, e[1] = n, e[2] = 0, e[3] = 0, e[4] = -n, e[5] = s, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = s + s, + y = r + r, + L = i + i, + k = s * c, + l = s * y, + b = s * L, + h = r * y, + M = r * L, + d = i * L, + m = a * c, + x = a * y, + V = a * L; + return e[0] = 1 - (h + d), e[1] = l + V, e[2] = b - x, e[3] = 0, e[4] = l - V, e[5] = 1 - (k + d), e[6] = M + m, e[7] = 0, e[8] = b + x, e[9] = M - m, e[10] = 1 - (k + h), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + } + }, { + key: "fromQuat2", + value: function fromQuat2(e, t) { + var n = -t[0], + s = -t[1], + r = -t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = n * n + s * s + r * r + i * i; + return k > 0 ? (E(D, H)[0] = (a * i + L * n + c * r - y * s) * 2 / k, E(D, H)[1] = (c * i + L * s + y * n - a * r) * 2 / k, E(D, H)[2] = (y * i + L * r + a * s - c * n) * 2 / k) : (E(D, H)[0] = (a * i + L * n + c * r - y * s) * 2, E(D, H)[1] = (c * i + L * s + y * n - a * r) * 2, E(D, H)[2] = (y * i + L * r + a * s - c * n) * 2), D.fromRotationTranslation(e, t, E(D, H)), e; + } + }, { + key: "normalFromMat4", + value: function normalFromMat4(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = t[4], + c = t[5], + y = t[6], + L = t[7], + k = t[8], + l = t[9], + b = t[10], + h = t[11], + M = t[12], + d = t[13], + m = t[14], + x = t[15], + V = n * c - s * a, + o = n * y - r * a, + R = n * L - i * a, + z = s * y - r * c, + g = s * L - i * c, + S = r * L - i * y, + B = k * d - l * M, + N = k * m - b * M, + p = k * x - h * M, + Y = l * m - b * d, + I = l * x - h * d, + P = b * x - h * m, + Q = V * P - o * I + R * Y + z * p - g * N + S * B; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - a * P - L * N) * Q, e[2] = (a * I - c * p + L * B) * Q, e[3] = 0, e[4] = (r * I - s * P - i * Y) * Q, e[5] = (n * P - r * p + i * N) * Q, e[6] = (s * p - n * I - i * B) * Q, e[7] = 0, e[8] = (d * S - m * g + x * z) * Q, e[9] = (m * R - M * S - x * o) * Q, e[10] = (M * g - d * R + x * V) * Q, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e) : null; + } + }, { + key: "normalFromMat4Fast", + value: function normalFromMat4Fast(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[4], + a = t[5], + c = t[6], + y = t[8], + L = t[9], + k = t[10]; + return e[0] = a * k - k * L, e[1] = c * y - y * k, e[2] = i * L - L * y, e[3] = 0, e[4] = L * r - k * s, e[5] = k * n - y * r, e[6] = y * s - L * n, e[7] = 0, e[8] = s * c - r * a, e[9] = r * i - n * c, e[10] = n * a - s * i, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "getTranslation", + value: function getTranslation(e, t) { + return e[0] = t[12], e[1] = t[13], e[2] = t[14], e; + } + }, { + key: "getScaling", + value: function getScaling(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[4], + a = t[5], + c = t[6], + y = t[8], + L = t[9], + k = t[10]; + return e[0] = Math.sqrt(n * n + s * s + r * r), e[1] = Math.sqrt(i * i + a * a + c * c), e[2] = Math.sqrt(y * y + L * L + k * k), e; + } + }, { + key: "getRotation", + value: function getRotation(e, t) { + D.getScaling(E(D, H), t); + var n = 1 / E(D, H)[0], + s = 1 / E(D, H)[1], + r = 1 / E(D, H)[2], + i = t[0] * n, + a = t[1] * s, + c = t[2] * r, + y = t[4] * n, + L = t[5] * s, + k = t[6] * r, + l = t[8] * n, + b = t[9] * s, + h = t[10] * r, + M = i + L + h, + d = 0; + return M > 0 ? (d = Math.sqrt(M + 1) * 2, e[3] = .25 * d, e[0] = (k - b) / d, e[1] = (l - c) / d, e[2] = (a - y) / d) : i > L && i > h ? (d = Math.sqrt(1 + i - L - h) * 2, e[3] = (k - b) / d, e[0] = .25 * d, e[1] = (a + y) / d, e[2] = (l + c) / d) : L > h ? (d = Math.sqrt(1 + L - i - h) * 2, e[3] = (l - c) / d, e[0] = (a + y) / d, e[1] = .25 * d, e[2] = (k + b) / d) : (d = Math.sqrt(1 + h - i - L) * 2, e[3] = (a - y) / d, e[0] = (l + c) / d, e[1] = (k + b) / d, e[2] = .25 * d), e; + } + }, { + key: "decompose", + value: function decompose(e, t, n, s) { + t[0] = s[12], t[1] = s[13], t[2] = s[14]; + var r = s[0], + i = s[1], + a = s[2], + c = s[4], + y = s[5], + L = s[6], + k = s[8], + l = s[9], + b = s[10]; + n[0] = Math.sqrt(r * r + i * i + a * a), n[1] = Math.sqrt(c * c + y * y + L * L), n[2] = Math.sqrt(k * k + l * l + b * b); + var h = 1 / n[0], + M = 1 / n[1], + d = 1 / n[2], + m = r * h, + x = i * M, + V = a * d, + o = c * h, + R = y * M, + z = L * d, + g = k * h, + S = l * M, + B = b * d, + N = m + R + B, + p = 0; + return N > 0 ? (p = Math.sqrt(N + 1) * 2, e[3] = .25 * p, e[0] = (z - S) / p, e[1] = (g - V) / p, e[2] = (x - o) / p) : m > R && m > B ? (p = Math.sqrt(1 + m - R - B) * 2, e[3] = (z - S) / p, e[0] = .25 * p, e[1] = (x + o) / p, e[2] = (g + V) / p) : R > B ? (p = Math.sqrt(1 + R - m - B) * 2, e[3] = (g - V) / p, e[0] = (x + o) / p, e[1] = .25 * p, e[2] = (z + S) / p) : (p = Math.sqrt(1 + B - m - R) * 2, e[3] = (x - o) / p, e[0] = (g + V) / p, e[1] = (z + S) / p, e[2] = .25 * p), e; + } + }, { + key: "fromRotationTranslationScale", + value: function fromRotationTranslationScale(e, t, n, s) { + var r = t[0], + i = t[1], + a = t[2], + c = t[3], + y = r + r, + L = i + i, + k = a + a, + l = r * y, + b = r * L, + h = r * k, + M = i * L, + d = i * k, + m = a * k, + x = c * y, + V = c * L, + o = c * k, + R = s[0], + z = s[1], + g = s[2]; + return e[0] = (1 - (M + m)) * R, e[1] = (b + o) * R, e[2] = (h - V) * R, e[3] = 0, e[4] = (b - o) * z, e[5] = (1 - (l + m)) * z, e[6] = (d + x) * z, e[7] = 0, e[8] = (h + V) * g, e[9] = (d - x) * g, e[10] = (1 - (l + M)) * g, e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + } + }, { + key: "fromRotationTranslationScaleOrigin", + value: function fromRotationTranslationScaleOrigin(e, t, n, s, r) { + var i = t[0], + a = t[1], + c = t[2], + y = t[3], + L = i + i, + k = a + a, + l = c + c, + b = i * L, + h = i * k, + M = i * l, + d = a * k, + m = a * l, + x = c * l, + V = y * L, + o = y * k, + R = y * l, + z = s[0], + g = s[1], + S = s[2], + B = r[0], + N = r[1], + p = r[2], + Y = (1 - (d + x)) * z, + I = (h + R) * z, + P = (M - o) * z, + Q = (h - R) * g, + K = (1 - (b + x)) * g, + ee = (m + V) * g, + te = (M + o) * S, + be = (m - V) * S, + Me = (1 - (b + d)) * S; + return e[0] = Y, e[1] = I, e[2] = P, e[3] = 0, e[4] = Q, e[5] = K, e[6] = ee, e[7] = 0, e[8] = te, e[9] = be, e[10] = Me, e[11] = 0, e[12] = n[0] + B - (Y * B + Q * N + te * p), e[13] = n[1] + N - (I * B + K * N + be * p), e[14] = n[2] + p - (P * B + ee * N + Me * p), e[15] = 1, e; + } + }, { + key: "fromQuat", + value: function fromQuat(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = n + n, + c = s + s, + y = r + r, + L = n * a, + k = s * a, + l = s * c, + b = r * a, + h = r * c, + M = r * y, + d = i * a, + m = i * c, + x = i * y; + return e[0] = 1 - l - M, e[1] = k + x, e[2] = b - m, e[3] = 0, e[4] = k - x, e[5] = 1 - L - M, e[6] = h + d, e[7] = 0, e[8] = b + m, e[9] = h - d, e[10] = 1 - L - l, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + } + }, { + key: "frustumNO", + value: function frustumNO(e, t, n, s, r, i) { + var a = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; + var c = 1 / (n - t), + y = 1 / (r - s); + if (e[0] = i * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, a != null && a !== 1 / 0) { + var L = 1 / (i - a); + e[10] = (a + i) * L, e[14] = 2 * a * i * L; + } else e[10] = -1, e[14] = -2 * i; + return e; + } + }, { + key: "frustum", + value: function frustum(e, t, n, s, r, i) { + return e; + } + }, { + key: "frustumZO", + value: function frustumZO(e, t, n, s, r, i) { + var a = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; + var c = 1 / (n - t), + y = 1 / (r - s); + if (e[0] = i * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, a != null && a !== 1 / 0) { + var L = 1 / (i - a); + e[10] = a * L, e[14] = a * i * L; + } else e[10] = -1, e[14] = -i; + return e; + } + }, { + key: "perspectiveNO", + value: function perspectiveNO(e, t, n, s) { + var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1 / 0; + var i = 1 / Math.tan(t / 2); + if (e[0] = i / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { + var a = 1 / (s - r); + e[10] = (r + s) * a, e[14] = 2 * r * s * a; + } else e[10] = -1, e[14] = -2 * s; + return e; + } + }, { + key: "perspective", + value: function perspective(e, t, n, s) { + return e; + } + }, { + key: "perspectiveZO", + value: function perspectiveZO(e, t, n, s) { + var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1 / 0; + var i = 1 / Math.tan(t / 2); + if (e[0] = i / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { + var a = 1 / (s - r); + e[10] = r * a, e[14] = r * s * a; + } else e[10] = -1, e[14] = -s; + return e; + } + }, { + key: "perspectiveFromFieldOfView", + value: function perspectiveFromFieldOfView(e, t, n, s) { + var r = Math.tan(t.upDegrees * Math.PI / 180), + i = Math.tan(t.downDegrees * Math.PI / 180), + a = Math.tan(t.leftDegrees * Math.PI / 180), + c = Math.tan(t.rightDegrees * Math.PI / 180), + y = 2 / (a + c), + L = 2 / (r + i); + return e[0] = y, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = L, e[6] = 0, e[7] = 0, e[8] = -((a - c) * y * .5), e[9] = (r - i) * L * .5, e[10] = s / (n - s), e[11] = -1, e[12] = 0, e[13] = 0, e[14] = s * n / (n - s), e[15] = 0, e; + } + }, { + key: "orthoNO", + value: function orthoNO(e, t, n, s, r, i, a) { + var c = 1 / (t - n), + y = 1 / (s - r), + L = 1 / (i - a); + return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 2 * L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = (a + i) * L, e[15] = 1, e; + } + }, { + key: "ortho", + value: function ortho(e, t, n, s, r, i, a) { + return e; + } + }, { + key: "orthoZO", + value: function orthoZO(e, t, n, s, r, i, a) { + var c = 1 / (t - n), + y = 1 / (s - r), + L = 1 / (i - a); + return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = i * L, e[15] = 1, e; + } + }, { + key: "lookAt", + value: function lookAt(e, t, n, s) { + var r = t[0], + i = t[1], + a = t[2], + c = s[0], + y = s[1], + L = s[2], + k = n[0], + l = n[1], + b = n[2]; + if (Math.abs(r - k) < 1e-6 && Math.abs(i - l) < 1e-6 && Math.abs(a - b) < 1e-6) return D.identity(e); + var h = r - k, + M = i - l, + d = a - b, + m = 1 / Math.sqrt(h * h + M * M + d * d); + h *= m, M *= m, d *= m; + var x = y * d - L * M, + V = L * h - c * d, + o = c * M - y * h; + m = Math.sqrt(x * x + V * V + o * o), m ? (m = 1 / m, x *= m, V *= m, o *= m) : (x = 0, V = 0, o = 0); + var R = M * o - d * V, + z = d * x - h * o, + g = h * V - M * x; + return m = Math.sqrt(R * R + z * z + g * g), m ? (m = 1 / m, R *= m, z *= m, g *= m) : (R = 0, z = 0, g = 0), e[0] = x, e[1] = R, e[2] = h, e[3] = 0, e[4] = V, e[5] = z, e[6] = M, e[7] = 0, e[8] = o, e[9] = g, e[10] = d, e[11] = 0, e[12] = -(x * r + V * i + o * a), e[13] = -(R * r + z * i + g * a), e[14] = -(h * r + M * i + d * a), e[15] = 1, e; + } + }, { + key: "targetTo", + value: function targetTo(e, t, n, s) { + var r = t[0], + i = t[1], + a = t[2], + c = s[0], + y = s[1], + L = s[2], + k = r - n[0], + l = i - n[1], + b = a - n[2], + h = k * k + l * l + b * b; + h > 0 && (h = 1 / Math.sqrt(h), k *= h, l *= h, b *= h); + var M = y * b - L * l, + d = L * k - c * b, + m = c * l - y * k; + return h = M * M + d * d + m * m, h > 0 && (h = 1 / Math.sqrt(h), M *= h, d *= h, m *= h), e[0] = M, e[1] = d, e[2] = m, e[3] = 0, e[4] = l * m - b * d, e[5] = b * M - k * m, e[6] = k * d - l * M, e[7] = 0, e[8] = k, e[9] = l, e[10] = b, e[11] = 0, e[12] = r, e[13] = i, e[14] = a, e[15] = 1, e; + } + }, { + key: "frob", + value: function frob(e) { + return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2] + e[3] * e[3] + e[4] * e[4] + e[5] * e[5] + e[6] * e[6] + e[7] * e[7] + e[8] * e[8] + e[9] * e[9] + e[10] * e[10] + e[11] * e[11] + e[12] * e[12] + e[13] * e[13] + e[14] * e[14] + e[15] * e[15]); + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e[6] = t[6] + n[6], e[7] = t[7] + n[7], e[8] = t[8] + n[8], e[9] = t[9] + n[9], e[10] = t[10] + n[10], e[11] = t[11] + n[11], e[12] = t[12] + n[12], e[13] = t[13] + n[13], e[14] = t[14] + n[14], e[15] = t[15] + n[15], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e[4] = t[4] - n[4], e[5] = t[5] - n[5], e[6] = t[6] - n[6], e[7] = t[7] - n[7], e[8] = t[8] - n[8], e[9] = t[9] - n[9], e[10] = t[10] - n[10], e[11] = t[11] - n[11], e[12] = t[12] - n[12], e[13] = t[13] - n[13], e[14] = t[14] - n[14], e[15] = t[15] - n[15], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e[6] = t[6] * n, e[7] = t[7] * n, e[8] = t[8] * n, e[9] = t[9] * n, e[10] = t[10] * n, e[11] = t[11] * n, e[12] = t[12] * n, e[13] = t[13] * n, e[14] = t[14] * n, e[15] = t[15] * n, e; + } + }, { + key: "multiplyScalarAndAdd", + value: function multiplyScalarAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e[4] = t[4] + n[4] * s, e[5] = t[5] + n[5] * s, e[6] = t[6] + n[6] * s, e[7] = t[7] + n[7] * s, e[8] = t[8] + n[8] * s, e[9] = t[9] + n[9] * s, e[10] = t[10] + n[10] * s, e[11] = t[11] + n[11] * s, e[12] = t[12] + n[12] * s, e[13] = t[13] + n[13] * s, e[14] = t[14] + n[14] * s, e[15] = t[15] + n[15] * s, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7] && e[8] === t[8] && e[9] === t[9] && e[10] === t[10] && e[11] === t[11] && e[12] === t[12] && e[13] === t[13] && e[14] === t[14] && e[15] === t[15]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = e[3], + a = e[4], + c = e[5], + y = e[6], + L = e[7], + k = e[8], + l = e[9], + b = e[10], + h = e[11], + M = e[12], + d = e[13], + m = e[14], + x = e[15], + V = t[0], + o = t[1], + R = t[2], + z = t[3], + g = t[4], + S = t[5], + B = t[6], + N = t[7], + p = t[8], + Y = t[9], + I = t[10], + P = t[11], + Q = t[12], + K = t[13], + ee = t[14], + te = t[15]; + return Math.abs(n - V) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(V)) && Math.abs(s - o) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(o)) && Math.abs(r - R) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(R)) && Math.abs(i - z) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(z)) && Math.abs(a - g) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(g)) && Math.abs(c - S) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(S)) && Math.abs(y - B) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(B)) && Math.abs(L - N) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(N)) && Math.abs(k - p) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(p)) && Math.abs(l - Y) <= 1e-6 * Math.max(1, Math.abs(l), Math.abs(Y)) && Math.abs(b - I) <= 1e-6 * Math.max(1, Math.abs(b), Math.abs(I)) && Math.abs(h - P) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(P)) && Math.abs(M - Q) <= 1e-6 * Math.max(1, Math.abs(M), Math.abs(Q)) && Math.abs(d - K) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(K)) && Math.abs(m - ee) <= 1e-6 * Math.max(1, Math.abs(m), Math.abs(ee)) && Math.abs(x - te) <= 1e-6 * Math.max(1, Math.abs(x), Math.abs(te)); + } + }, { + key: "str", + value: function str(e) { + return "Mat4(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + ie = new WeakMap(), H = new WeakMap(), Z(D, ie, new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(D, H, new Float64Array(3)); + var G = D; + G.prototype.mul = G.prototype.multiply; + G.sub = G.subtract; + G.mul = G.multiply; + G.frustum = G.frustumNO; + G.perspective = G.perspectiveNO; + G.ortho = G.orthoNO; + var T = /*#__PURE__*/function (_Float64Array5) { + function A() { + var _this5; + _classCallCheck(this, A); + for (var _len9 = arguments.length, e = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { + e[_key9] = arguments[_key9]; + } + switch (e.length) { + case 3: + _this5 = _callSuper(this, A, [e]); + break; + case 2: + _this5 = _callSuper(this, A, [e[0], e[1], 3]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this5 = _callSuper(this, A, [[t, t, t]]) : _this5 = _callSuper(this, A, [t, 0, 3]); + break; + } + default: + _this5 = _callSuper(this, A, [3]); + break; + } + return _assertThisInitialized(_this5); + } + _inherits(A, _Float64Array5); + return _createClass(A, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "magnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2]; + return Math.sqrt(e * e + t * t + n * n); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "squaredMagnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2]; + return e * e + t * t + n * n; + } + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + }, { + key: "str", + get: function get() { + return A.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "add", + value: function add(e) { + return this[0] += e[0], this[1] += e[1], this[2] += e[2], this; + } + }, { + key: "subtract", + value: function subtract(e) { + return this[0] -= e[0], this[1] -= e[1], this[2] -= e[2], this; + } + }, { + key: "sub", + value: function sub(e) { + return this; + } + }, { + key: "multiply", + value: function multiply(e) { + return this[0] *= e[0], this[1] *= e[1], this[2] *= e[2], this; + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "divide", + value: function divide(e) { + return this[0] /= e[0], this[1] /= e[1], this[2] /= e[2], this; + } + }, { + key: "div", + value: function div(e) { + return this; + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this[2] *= e, this; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t) { + return this[0] += e[0] * t, this[1] += e[1] * t, this[2] += e[2] * t, this; + } + }, { + key: "distance", + value: function distance(e) { + return A.distance(this, e); + } + }, { + key: "dist", + value: function dist(e) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e) { + return A.squaredDistance(this, e); + } + }, { + key: "sqrDist", + value: function sqrDist(e) { + return 0; + } + }, { + key: "negate", + value: function negate() { + return this[0] *= -1, this[1] *= -1, this[2] *= -1, this; + } + }, { + key: "invert", + value: function invert() { + return this[0] = 1 / this[0], this[1] = 1 / this[1], this[2] = 1 / this[2], this; + } + }, { + key: "abs", + value: function abs() { + return this[0] = Math.abs(this[0]), this[1] = Math.abs(this[1]), this[2] = Math.abs(this[2]), this; + } + }, { + key: "dot", + value: function dot(e) { + return this[0] * e[0] + this[1] * e[1] + this[2] * e[2]; + } + }, { + key: "normalize", + value: function normalize() { + return A.normalize(this, this); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 3 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new A(); + } + }, { + key: "clone", + value: function clone(e) { + return new A(e); + } + }, { + key: "magnitude", + value: function magnitude(e) { + var t = e[0], + n = e[1], + s = e[2]; + return Math.sqrt(t * t + n * n + s * s); + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "fromValues", + value: function fromValues(e, t, n) { + return new A(e, t, n); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e; + } + }, { + key: "set", + value: function set(e, t, n, s) { + return e[0] = t, e[1] = n, e[2] = s, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return [0, 0, 0]; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + return e[0] = t[0] * n[0], e[1] = t[1] * n[1], e[2] = t[2] * n[2], e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return [0, 0, 0]; + } + }, { + key: "divide", + value: function divide(e, t, n) { + return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e[2] = t[2] / n[2], e; + } + }, { + key: "div", + value: function div(e, t, n) { + return [0, 0, 0]; + } + }, { + key: "ceil", + value: function ceil(e, t) { + return e[0] = Math.ceil(t[0]), e[1] = Math.ceil(t[1]), e[2] = Math.ceil(t[2]), e; + } + }, { + key: "floor", + value: function floor(e, t) { + return e[0] = Math.floor(t[0]), e[1] = Math.floor(t[1]), e[2] = Math.floor(t[2]), e; + } + }, { + key: "min", + value: function min(e, t, n) { + return e[0] = Math.min(t[0], n[0]), e[1] = Math.min(t[1], n[1]), e[2] = Math.min(t[2], n[2]), e; + } + }, { + key: "max", + value: function max(e, t, n) { + return e[0] = Math.max(t[0], n[0]), e[1] = Math.max(t[1], n[1]), e[2] = Math.max(t[2], n[2]), e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e; + } + }, { + key: "distance", + value: function distance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2]; + return Math.sqrt(n * n + s * s + r * r); + } + }, { + key: "dist", + value: function dist(e, t) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2]; + return n * n + s * s + r * r; + } + }, { + key: "sqrDist", + value: function sqrDist(e, t) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + var t = e[0], + n = e[1], + s = e[2]; + return t * t + n * n + s * s; + } + }, { + key: "sqrLen", + value: function sqrLen(e, t) { + return 0; + } + }, { + key: "negate", + value: function negate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e; + } + }, { + key: "inverse", + value: function inverse(e, t) { + return e[0] = 1 / t[0], e[1] = 1 / t[1], e[2] = 1 / t[2], e; + } + }, { + key: "abs", + value: function abs(e, t) { + return e[0] = Math.abs(t[0]), e[1] = Math.abs(t[1]), e[2] = Math.abs(t[2]), e; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = n * n + s * s + r * r; + return i > 0 && (i = 1 / Math.sqrt(i)), e[0] = t[0] * i, e[1] = t[1] * i, e[2] = t[2] * i, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1] + e[2] * t[2]; + } + }, { + key: "cross", + value: function cross(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = n[0], + c = n[1], + y = n[2]; + return e[0] = r * y - i * c, e[1] = i * a - s * y, e[2] = s * c - r * a, e; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = t[0], + i = t[1], + a = t[2]; + return e[0] = r + s * (n[0] - r), e[1] = i + s * (n[1] - i), e[2] = a + s * (n[2] - a), e; + } + }, { + key: "slerp", + value: function slerp(e, t, n, s) { + var r = Math.acos(Math.min(Math.max(A.dot(t, n), -1), 1)), + i = Math.sin(r), + a = Math.sin((1 - s) * r) / i, + c = Math.sin(s * r) / i; + return e[0] = a * t[0] + c * n[0], e[1] = a * t[1] + c * n[1], e[2] = a * t[2] + c * n[2], e; + } + }, { + key: "hermite", + value: function hermite(e, t, n, s, r, i) { + var a = i * i, + c = a * (2 * i - 3) + 1, + y = a * (i - 2) + i, + L = a * (i - 1), + k = a * (3 - 2 * i); + return e[0] = t[0] * c + n[0] * y + s[0] * L + r[0] * k, e[1] = t[1] * c + n[1] * y + s[1] * L + r[1] * k, e[2] = t[2] * c + n[2] * y + s[2] * L + r[2] * k, e; + } + }, { + key: "bezier", + value: function bezier(e, t, n, s, r, i) { + var a = 1 - i, + c = a * a, + y = i * i, + L = c * a, + k = 3 * i * c, + l = 3 * y * a, + b = y * i; + return e[0] = t[0] * L + n[0] * k + s[0] * l + r[0] * b, e[1] = t[1] * L + n[1] * k + s[1] * l + r[1] * b, e[2] = t[2] * L + n[2] * k + s[2] * l + r[2] * b, e; + } + }, { + key: "transformMat4", + value: function transformMat4(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = n[3] * s + n[7] * r + n[11] * i + n[15] || 1; + return e[0] = (n[0] * s + n[4] * r + n[8] * i + n[12]) / a, e[1] = (n[1] * s + n[5] * r + n[9] * i + n[13]) / a, e[2] = (n[2] * s + n[6] * r + n[10] * i + n[14]) / a, e; + } + }, { + key: "transformMat3", + value: function transformMat3(e, t, n) { + var s = t[0], + r = t[1], + i = t[2]; + return e[0] = s * n[0] + r * n[3] + i * n[6], e[1] = s * n[1] + r * n[4] + i * n[7], e[2] = s * n[2] + r * n[5] + i * n[8], e; + } + }, { + key: "transformQuat", + value: function transformQuat(e, t, n) { + var s = n[0], + r = n[1], + i = n[2], + a = n[3] * 2, + c = t[0], + y = t[1], + L = t[2], + k = r * L - i * y, + l = i * c - s * L, + b = s * y - r * c, + h = (r * b - i * l) * 2, + M = (i * k - s * b) * 2, + d = (s * l - r * k) * 2; + return e[0] = c + k * a + h, e[1] = y + l * a + M, e[2] = L + b * a + d, e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n, s) { + var r = n[1], + i = n[2], + a = t[1] - r, + c = t[2] - i; + return e[0] = t[0], e[1] = a * Math.cos(s) - c * Math.sin(s) + r, e[2] = a * Math.sin(s) + c * Math.cos(s) + i, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n, s) { + var r = n[0], + i = n[2], + a = t[0] - r, + c = t[2] - i; + return e[0] = c * Math.sin(s) + a * Math.cos(s) + r, e[1] = t[1], e[2] = c * Math.cos(s) - a * Math.sin(s) + i, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n, s) { + var r = n[0], + i = n[1], + a = t[0] - r, + c = t[1] - i; + return e[0] = a * Math.cos(s) - c * Math.sin(s) + r, e[1] = a * Math.sin(s) + c * Math.cos(s) + i, e[2] = n[2], e; + } + }, { + key: "angle", + value: function angle(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = t[0], + a = t[1], + c = t[2], + y = Math.sqrt((n * n + s * s + r * r) * (i * i + a * a + c * c)), + L = y && A.dot(e, t) / y; + return Math.acos(Math.min(Math.max(L, -1), 1)); + } + }, { + key: "zero", + value: function zero(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e; + } + }, { + key: "str", + value: function str(e) { + return "Vec3(".concat(e.join(", "), ")"); + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = t[0], + a = t[1], + c = t[2]; + return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - a) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(a)) && Math.abs(r - c) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(c)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + T.prototype.sub = T.prototype.subtract; + T.prototype.mul = T.prototype.multiply; + T.prototype.div = T.prototype.divide; + T.prototype.dist = T.prototype.distance; + T.prototype.sqrDist = T.prototype.squaredDistance; + T.sub = T.subtract; + T.mul = T.multiply; + T.div = T.divide; + T.dist = T.distance; + T.sqrDist = T.squaredDistance; + T.sqrLen = T.squaredLength; + T.mag = T.magnitude; + T.length = T.magnitude; + T.len = T.magnitude; + var q = /*#__PURE__*/function (_Float64Array6) { + function A() { + var _this6; + _classCallCheck(this, A); + for (var _len10 = arguments.length, e = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { + e[_key10] = arguments[_key10]; + } + switch (e.length) { + case 4: + _this6 = _callSuper(this, A, [e]); + break; + case 2: + _this6 = _callSuper(this, A, [e[0], e[1], 4]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this6 = _callSuper(this, A, [[t, t, t, t]]) : _this6 = _callSuper(this, A, [t, 0, 4]); + break; + } + default: + _this6 = _callSuper(this, A, [4]); + break; + } + return _assertThisInitialized(_this6); + } + _inherits(A, _Float64Array6); + return _createClass(A, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(e) { + this[3] = e; + } + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "b", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "a", + get: function get() { + return this[3]; + }, + set: function set(e) { + this[3] = e; + } + }, { + key: "magnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2], + s = this[3]; + return Math.sqrt(e * e + t * t + n * n + s * s); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "str", + get: function get() { + return A.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return _get(_getPrototypeOf(A.prototype), "set", this).call(this, e), this; + } + }, { + key: "add", + value: function add(e) { + return this[0] += e[0], this[1] += e[1], this[2] += e[2], this[3] += e[3], this; + } + }, { + key: "subtract", + value: function subtract(e) { + return this[0] -= e[0], this[1] -= e[1], this[2] -= e[2], this[3] -= e[3], this; + } + }, { + key: "sub", + value: function sub(e) { + return this; + } + }, { + key: "multiply", + value: function multiply(e) { + return this[0] *= e[0], this[1] *= e[1], this[2] *= e[2], this[3] *= e[3], this; + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "divide", + value: function divide(e) { + return this[0] /= e[0], this[1] /= e[1], this[2] /= e[2], this[3] /= e[3], this; + } + }, { + key: "div", + value: function div(e) { + return this; + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this[2] *= e, this[3] *= e, this; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t) { + return this[0] += e[0] * t, this[1] += e[1] * t, this[2] += e[2] * t, this[3] += e[3] * t, this; + } + }, { + key: "distance", + value: function distance(e) { + return A.distance(this, e); + } + }, { + key: "dist", + value: function dist(e) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e) { + return A.squaredDistance(this, e); + } + }, { + key: "sqrDist", + value: function sqrDist(e) { + return 0; + } + }, { + key: "negate", + value: function negate() { + return this[0] *= -1, this[1] *= -1, this[2] *= -1, this[3] *= -1, this; + } + }, { + key: "invert", + value: function invert() { + return this[0] = 1 / this[0], this[1] = 1 / this[1], this[2] = 1 / this[2], this[3] = 1 / this[3], this; + } + }, { + key: "abs", + value: function abs() { + return this[0] = Math.abs(this[0]), this[1] = Math.abs(this[1]), this[2] = Math.abs(this[2]), this[3] = Math.abs(this[3]), this; + } + }, { + key: "dot", + value: function dot(e) { + return this[0] * e[0] + this[1] * e[1] + this[2] * e[2] + this[3] * e[3]; + } + }, { + key: "normalize", + value: function normalize() { + return A.normalize(this, this); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new A(); + } + }, { + key: "clone", + value: function clone(e) { + return new A(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t, n, s) { + return new A(e, t, n, s); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "set", + value: function set(e, t, n, s, r) { + return e[0] = t, e[1] = n, e[2] = s, e[3] = r, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + return e[0] = t[0] * n[0], e[1] = t[1] * n[1], e[2] = t[2] * n[2], e[3] = t[3] * n[3], e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "divide", + value: function divide(e, t, n) { + return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e[2] = t[2] / n[2], e[3] = t[3] / n[3], e; + } + }, { + key: "div", + value: function div(e, t, n) { + return e; + } + }, { + key: "ceil", + value: function ceil(e, t) { + return e[0] = Math.ceil(t[0]), e[1] = Math.ceil(t[1]), e[2] = Math.ceil(t[2]), e[3] = Math.ceil(t[3]), e; + } + }, { + key: "floor", + value: function floor(e, t) { + return e[0] = Math.floor(t[0]), e[1] = Math.floor(t[1]), e[2] = Math.floor(t[2]), e[3] = Math.floor(t[3]), e; + } + }, { + key: "min", + value: function min(e, t, n) { + return e[0] = Math.min(t[0], n[0]), e[1] = Math.min(t[1], n[1]), e[2] = Math.min(t[2], n[2]), e[3] = Math.min(t[3], n[3]), e; + } + }, { + key: "max", + value: function max(e, t, n) { + return e[0] = Math.max(t[0], n[0]), e[1] = Math.max(t[1], n[1]), e[2] = Math.max(t[2], n[2]), e[3] = Math.max(t[3], n[3]), e; + } + }, { + key: "round", + value: function round(e, t) { + return e[0] = Math.round(t[0]), e[1] = Math.round(t[1]), e[2] = Math.round(t[2]), e[3] = Math.round(t[3]), e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e[2] = t[2] + n[2] * s, e[3] = t[3] + n[3] * s, e; + } + }, { + key: "distance", + value: function distance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2], + i = t[3] - e[3]; + return Math.hypot(n, s, r, i); + } + }, { + key: "dist", + value: function dist(e, t) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1], + r = t[2] - e[2], + i = t[3] - e[3]; + return n * n + s * s + r * r + i * i; + } + }, { + key: "sqrDist", + value: function sqrDist(e, t) { + return 0; + } + }, { + key: "magnitude", + value: function magnitude(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3]; + return Math.sqrt(t * t + n * n + s * s + r * r); + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + var t = e[0], + n = e[1], + s = e[2], + r = e[3]; + return t * t + n * n + s * s + r * r; + } + }, { + key: "sqrLen", + value: function sqrLen(e) { + return 0; + } + }, { + key: "negate", + value: function negate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = -t[3], e; + } + }, { + key: "inverse", + value: function inverse(e, t) { + return e[0] = 1 / t[0], e[1] = 1 / t[1], e[2] = 1 / t[2], e[3] = 1 / t[3], e; + } + }, { + key: "abs", + value: function abs(e, t) { + return e[0] = Math.abs(t[0]), e[1] = Math.abs(t[1]), e[2] = Math.abs(t[2]), e[3] = Math.abs(t[3]), e; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = n * n + s * s + r * r + i * i; + return a > 0 && (a = 1 / Math.sqrt(a)), e[0] = n * a, e[1] = s * a, e[2] = r * a, e[3] = i * a, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3]; + } + }, { + key: "cross", + value: function cross(e, t, n, s) { + var r = n[0] * s[1] - n[1] * s[0], + i = n[0] * s[2] - n[2] * s[0], + a = n[0] * s[3] - n[3] * s[0], + c = n[1] * s[2] - n[2] * s[1], + y = n[1] * s[3] - n[3] * s[1], + L = n[2] * s[3] - n[3] * s[2], + k = t[0], + l = t[1], + b = t[2], + h = t[3]; + return e[0] = l * L - b * y + h * c, e[1] = -(k * L) + b * a - h * i, e[2] = k * y - l * a + h * r, e[3] = -(k * c) + l * i - b * r, e; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = t[0], + i = t[1], + a = t[2], + c = t[3]; + return e[0] = r + s * (n[0] - r), e[1] = i + s * (n[1] - i), e[2] = a + s * (n[2] - a), e[3] = c + s * (n[3] - c), e; + } + }, { + key: "transformMat4", + value: function transformMat4(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3]; + return e[0] = n[0] * s + n[4] * r + n[8] * i + n[12] * a, e[1] = n[1] * s + n[5] * r + n[9] * i + n[13] * a, e[2] = n[2] * s + n[6] * r + n[10] * i + n[14] * a, e[3] = n[3] * s + n[7] * r + n[11] * i + n[15] * a, e; + } + }, { + key: "transformQuat", + value: function transformQuat(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = n[0], + c = n[1], + y = n[2], + L = n[3], + k = L * s + c * i - y * r, + l = L * r + y * s - a * i, + b = L * i + a * r - c * s, + h = -a * s - c * r - y * i; + return e[0] = k * L + h * -a + l * -y - b * -c, e[1] = l * L + h * -c + b * -a - k * -y, e[2] = b * L + h * -y + k * -c - l * -a, e[3] = t[3], e; + } + }, { + key: "zero", + value: function zero(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 0, e; + } + }, { + key: "str", + value: function str(e) { + return "Vec4(".concat(e.join(", "), ")"); + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = e[3], + a = t[0], + c = t[1], + y = t[2], + L = t[3]; + return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(i - L) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(L)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + q.prototype.sub = q.prototype.subtract; + q.prototype.mul = q.prototype.multiply; + q.prototype.div = q.prototype.divide; + q.prototype.dist = q.prototype.distance; + q.prototype.sqrDist = q.prototype.squaredDistance; + q.sub = q.subtract; + q.mul = q.multiply; + q.div = q.divide; + q.dist = q.distance; + q.sqrDist = q.squaredDistance; + q.sqrLen = q.squaredLength; + q.mag = q.magnitude; + q.length = q.magnitude; + q.len = q.magnitude; + var ke, + ae, + ce, + W, + U, + le, + he, + f = /*#__PURE__*/function (_Float64Array7) { + function f() { + var _this7; + _classCallCheck(this, f); + for (var _len11 = arguments.length, e = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { + e[_key11] = arguments[_key11]; + } + switch (e.length) { + case 4: + _this7 = _callSuper(this, f, [e]); + break; + case 2: + _this7 = _callSuper(this, f, [e[0], e[1], 4]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this7 = _callSuper(this, f, [[t, t, t, t]]) : _this7 = _callSuper(this, f, [t, 0, 4]); + break; + } + default: + _this7 = _callSuper(this, f, [4]), _this7[3] = 1; + break; + } + return _assertThisInitialized(_this7); + } + _inherits(f, _Float64Array7); + return _createClass(f, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "z", + get: function get() { + return this[2]; + }, + set: function set(e) { + this[2] = e; + } + }, { + key: "w", + get: function get() { + return this[3]; + }, + set: function set(e) { + this[3] = e; + } + }, { + key: "magnitude", + get: function get() { + var e = this[0], + t = this[1], + n = this[2], + s = this[3]; + return Math.sqrt(e * e + t * t + n * n + s * s); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "str", + get: function get() { + return f.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return _get(_getPrototypeOf(f.prototype), "set", this).call(this, e), this; + } + }, { + key: "identity", + value: function identity() { + return this[0] = 0, this[1] = 0, this[2] = 0, this[3] = 1, this; + } + }, { + key: "multiply", + value: function multiply(e) { + return f.multiply(this, this, e); + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "rotateX", + value: function rotateX(e) { + return f.rotateX(this, this, e); + } + }, { + key: "rotateY", + value: function rotateY(e) { + return f.rotateY(this, this, e); + } + }, { + key: "rotateZ", + value: function rotateZ(e) { + return f.rotateZ(this, this, e); + } + }, { + key: "invert", + value: function invert() { + return f.invert(this, this); + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this[2] *= e, this[3] *= e, this; + } + }, { + key: "dot", + value: function dot(e) { + return f.dot(this, e); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new f(); + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e; + } + }, { + key: "setAxisAngle", + value: function setAxisAngle(e, t, n) { + n = n * .5; + var s = Math.sin(n); + return e[0] = s * t[0], e[1] = s * t[1], e[2] = s * t[2], e[3] = Math.cos(n), e; + } + }, { + key: "getAxisAngle", + value: function getAxisAngle(e, t) { + var n = Math.acos(t[3]) * 2, + s = Math.sin(n / 2); + return s > 1e-6 ? (e[0] = t[0] / s, e[1] = t[1] / s, e[2] = t[2] / s) : (e[0] = 1, e[1] = 0, e[2] = 0), n; + } + }, { + key: "getAngle", + value: function getAngle(e, t) { + var n = f.dot(e, t); + return Math.acos(2 * n * n - 1); + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = n[0], + y = n[1], + L = n[2], + k = n[3]; + return e[0] = s * k + a * c + r * L - i * y, e[1] = r * k + a * y + i * c - s * L, e[2] = i * k + a * L + s * y - r * c, e[3] = a * k - s * c - r * y - i * L, e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n) { + n *= .5; + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y + a * c, e[1] = r * y + i * c, e[2] = i * y - r * c, e[3] = a * y - s * c, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n) { + n *= .5; + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y - i * c, e[1] = r * y + a * c, e[2] = i * y + s * c, e[3] = a * y - r * c, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n) { + n *= .5; + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = Math.sin(n), + y = Math.cos(n); + return e[0] = s * y + r * c, e[1] = r * y - s * c, e[2] = i * y + a * c, e[3] = a * y - i * c, e; + } + }, { + key: "calculateW", + value: function calculateW(e, t) { + var n = t[0], + s = t[1], + r = t[2]; + return e[0] = n, e[1] = s, e[2] = r, e[3] = Math.sqrt(Math.abs(1 - n * n - s * s - r * r)), e; + } + }, { + key: "exp", + value: function exp(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = Math.sqrt(n * n + s * s + r * r), + c = Math.exp(i), + y = a > 0 ? c * Math.sin(a) / a : 0; + return e[0] = n * y, e[1] = s * y, e[2] = r * y, e[3] = c * Math.cos(a), e; + } + }, { + key: "ln", + value: function ln(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = Math.sqrt(n * n + s * s + r * r), + c = a > 0 ? Math.atan2(a, i) / a : 0; + return e[0] = n * c, e[1] = s * c, e[2] = r * c, e[3] = .5 * Math.log(n * n + s * s + r * r + i * i), e; + } + }, { + key: "pow", + value: function pow(e, t, n) { + return f.ln(e, t), f.scale(e, e, n), f.exp(e, e), e; + } + }, { + key: "slerp", + value: function slerp(e, t, n, s) { + var r = t[0], + i = t[1], + a = t[2], + c = t[3], + y = n[0], + L = n[1], + k = n[2], + l = n[3], + b, + h, + M = r * y + i * L + a * k + c * l; + if (M < 0 && (M = -M, y = -y, L = -L, k = -k, l = -l), 1 - M > 1e-6) { + var d = Math.acos(M), + m = Math.sin(d); + b = Math.sin((1 - s) * d) / m, h = Math.sin(s * d) / m; + } else b = 1 - s, h = s; + return e[0] = b * r + h * y, e[1] = b * i + h * L, e[2] = b * a + h * k, e[3] = b * c + h * l, e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = t[0], + s = t[1], + r = t[2], + i = t[3], + a = n * n + s * s + r * r + i * i, + c = a ? 1 / a : 0; + return e[0] = -n * c, e[1] = -s * c, e[2] = -r * c, e[3] = i * c, e; + } + }, { + key: "conjugate", + value: function conjugate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = t[3], e; + } + }, { + key: "fromMat3", + value: function fromMat3(e, t) { + var n = t[0] + t[4] + t[8], + s; + if (n > 0) s = Math.sqrt(n + 1), e[3] = .5 * s, s = .5 / s, e[0] = (t[5] - t[7]) * s, e[1] = (t[6] - t[2]) * s, e[2] = (t[1] - t[3]) * s;else { + var r = 0; + t[4] > t[0] && (r = 1), t[8] > t[r * 3 + r] && (r = 2); + var i = (r + 1) % 3, + a = (r + 2) % 3; + s = Math.sqrt(t[r * 3 + r] - t[i * 3 + i] - t[a * 3 + a] + 1), e[r] = .5 * s, s = .5 / s, e[3] = (t[i * 3 + a] - t[a * 3 + i]) * s, e[i] = (t[i * 3 + r] + t[r * 3 + i]) * s, e[a] = (t[a * 3 + r] + t[r * 3 + a]) * s; + } + return e; + } + }, { + key: "fromEuler", + value: function fromEuler(e, t, n, s) { + var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : E(f, ke); + var i = .5 * Math.PI / 180; + t *= i, n *= i, s *= i; + var a = Math.sin(t), + c = Math.cos(t), + y = Math.sin(n), + L = Math.cos(n), + k = Math.sin(s), + l = Math.cos(s); + switch (r) { + case "xyz": + e[0] = a * L * l + c * y * k, e[1] = c * y * l - a * L * k, e[2] = c * L * k + a * y * l, e[3] = c * L * l - a * y * k; + break; + case "xzy": + e[0] = a * L * l - c * y * k, e[1] = c * y * l - a * L * k, e[2] = c * L * k + a * y * l, e[3] = c * L * l + a * y * k; + break; + case "yxz": + e[0] = a * L * l + c * y * k, e[1] = c * y * l - a * L * k, e[2] = c * L * k - a * y * l, e[3] = c * L * l + a * y * k; + break; + case "yzx": + e[0] = a * L * l + c * y * k, e[1] = c * y * l + a * L * k, e[2] = c * L * k - a * y * l, e[3] = c * L * l - a * y * k; + break; + case "zxy": + e[0] = a * L * l - c * y * k, e[1] = c * y * l + a * L * k, e[2] = c * L * k + a * y * l, e[3] = c * L * l - a * y * k; + break; + case "zyx": + e[0] = a * L * l - c * y * k, e[1] = c * y * l + a * L * k, e[2] = c * L * k - a * y * l, e[3] = c * L * l + a * y * k; + break; + default: + throw new Error("Unknown angle order " + r); + } + return e; + } + }, { + key: "str", + value: function str(e) { + return "Quat(".concat(e.join(", "), ")"); + } + }, { + key: "clone", + value: function clone(e) { + return new f(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t, n, s) { + return new f(e, t, n, s); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "set", + value: function set(e, t, n, s, r) { + return e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3]; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + return e; + } + }, { + key: "magnitude", + value: function magnitude(e) { + return 0; + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + return 0; + } + }, { + key: "sqrLen", + value: function sqrLen(e) { + return 0; + } + }, { + key: "normalize", + value: function normalize(e, t) { + return e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return !1; + } + }, { + key: "equals", + value: function equals(e, t) { + return !1; + } + }, { + key: "rotationTo", + value: function rotationTo(e, t, n) { + var s = T.dot(t, n); + return s < -.999999 ? (T.cross(E(f, U), E(f, le), t), T.mag(E(f, U)) < 1e-6 && T.cross(E(f, U), E(f, he), t), T.normalize(E(f, U), E(f, U)), f.setAxisAngle(e, E(f, U), Math.PI), e) : s > .999999 ? (e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e) : (T.cross(E(f, U), t, n), e[0] = E(f, U)[0], e[1] = E(f, U)[1], e[2] = E(f, U)[2], e[3] = 1 + s, f.normalize(e, e)); + } + }, { + key: "sqlerp", + value: function sqlerp(e, t, n, s, r, i) { + return f.slerp(E(f, ae), t, r, i), f.slerp(E(f, ce), n, s, i), f.slerp(e, E(f, ae), E(f, ce), 2 * i * (1 - i)), e; + } + }, { + key: "setAxes", + value: function setAxes(e, t, n, s) { + return E(f, W)[0] = n[0], E(f, W)[3] = n[1], E(f, W)[6] = n[2], E(f, W)[1] = s[0], E(f, W)[4] = s[1], E(f, W)[7] = s[2], E(f, W)[2] = -t[0], E(f, W)[5] = -t[1], E(f, W)[8] = -t[2], f.normalize(e, f.fromMat3(e, E(f, W))); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + ke = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), U = new WeakMap(), le = new WeakMap(), he = new WeakMap(), Z(f, ke, "zyx"), Z(f, ae, new Float64Array(4)), Z(f, ce, new Float64Array(4)), Z(f, W, new Float64Array(9)), Z(f, U, new Float64Array(3)), Z(f, le, new Float64Array([1, 0, 0])), Z(f, he, new Float64Array([0, 1, 0])); + var O = f; + O.set = q.set; + O.add = q.add; + O.lerp = q.lerp; + O.normalize = q.normalize; + O.squaredLength = q.squaredLength; + O.sqrLen = q.squaredLength; + O.exactEquals = q.exactEquals; + O.equals = q.equals; + O.magnitude = q.magnitude; + O.prototype.mul = O.prototype.multiply; + O.mul = O.multiply; + O.mag = O.magnitude; + O.length = O.magnitude; + O.len = O.magnitude; + var ye, + Le, + j = /*#__PURE__*/function (_Float64Array8) { + function j() { + var _this8; + _classCallCheck(this, j); + for (var _len12 = arguments.length, e = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { + e[_key12] = arguments[_key12]; + } + switch (e.length) { + case 8: + _this8 = _callSuper(this, j, [e]); + break; + case 2: + _this8 = _callSuper(this, j, [e[0], e[1], 8]); + break; + case 1: + { + var t = e[0]; + typeof t == "number" ? _this8 = _callSuper(this, j, [[t, t, t, t, t, t, t, t]]) : _this8 = _callSuper(this, j, [t, 0, 8]); + break; + } + default: + _this8 = _callSuper(this, j, [8]), _this8[3] = 1; + break; + } + return _assertThisInitialized(_this8); + } + _inherits(j, _Float64Array8); + return _createClass(j, [{ + key: "str", + get: function get() { + return j.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return _get(_getPrototypeOf(j.prototype), "set", this).call(this, e), this; + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 8 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new j(); + } + }, { + key: "clone", + value: function clone(e) { + return new j(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t, n, s, r, i, a, c) { + return new j(e, t, n, s, r, i, a, c); + } + }, { + key: "fromRotationTranslationValues", + value: function fromRotationTranslationValues(e, t, n, s, r, i, a) { + var c = r * .5, + y = i * .5, + L = a * .5; + return new j(e, t, n, s, c * s + y * n - L * t, y * s + L * e - c * n, L * s + c * t - y * e, -c * e - y * t - L * n); + } + }, { + key: "fromRotationTranslation", + value: function fromRotationTranslation(e, t, n) { + var s = n[0] * .5, + r = n[1] * .5, + i = n[2] * .5, + a = t[0], + c = t[1], + y = t[2], + L = t[3]; + return e[0] = a, e[1] = c, e[2] = y, e[3] = L, e[4] = s * L + r * y - i * c, e[5] = r * L + i * a - s * y, e[6] = i * L + s * c - r * a, e[7] = -s * a - r * c - i * y, e; + } + }, { + key: "fromTranslation", + value: function fromTranslation(e, t) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = t[0] * .5, e[5] = t[1] * .5, e[6] = t[2] * .5, e[7] = 0, e; + } + }, { + key: "fromRotation", + value: function fromRotation(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = 0, e[5] = 0, e[6] = 0, e[7] = 0, e; + } + }, { + key: "fromMat4", + value: function fromMat4(e, t) { + return G.getRotation(E(j, ye), t), G.getTranslation(E(j, Le), t), j.fromRotationTranslation(e, E(j, ye), E(j, Le)); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e; + } + }, { + key: "identity", + value: function identity(e) { + return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e[6] = 0, e[7] = 0, e; + } + }, { + key: "set", + value: function set(e, t, n, s, r, i, a, c, y) { + return e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = i, e[5] = a, e[6] = c, e[7] = y, e; + } + }, { + key: "getReal", + value: function getReal(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "getDual", + value: function getDual(e, t) { + return e[0] = t[4], e[1] = t[5], e[2] = t[6], e[3] = t[7], e; + } + }, { + key: "setReal", + value: function setReal(e, t) { + return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e; + } + }, { + key: "setDual", + value: function setDual(e, t) { + return e[4] = t[0], e[5] = t[1], e[6] = t[2], e[7] = t[3], e; + } + }, { + key: "getTranslation", + value: function getTranslation(e, t) { + var n = t[4], + s = t[5], + r = t[6], + i = t[7], + a = -t[0], + c = -t[1], + y = -t[2], + L = t[3]; + return e[0] = (n * L + i * a + s * y - r * c) * 2, e[1] = (s * L + i * c + r * a - n * y) * 2, e[2] = (r * L + i * y + n * c - s * a) * 2, e; + } + }, { + key: "translate", + value: function translate(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = n[0] * .5, + y = n[1] * .5, + L = n[2] * .5, + k = t[4], + l = t[5], + b = t[6], + h = t[7]; + return e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = a * c + r * L - i * y + k, e[5] = a * y + i * c - s * L + l, e[6] = a * L + s * y - r * c + b, e[7] = -s * c - r * y - i * L + h, e; + } + }, { + key: "rotateX", + value: function rotateX(e, t, n) { + var s = -t[0], + r = -t[1], + i = -t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = c * a + k * s + y * i - L * r, + b = y * a + k * r + L * s - c * i, + h = L * a + k * i + c * r - y * s, + M = k * a - c * s - y * r - L * i; + return O.rotateX(e, t, n), s = e[0], r = e[1], i = e[2], a = e[3], e[4] = l * a + M * s + b * i - h * r, e[5] = b * a + M * r + h * s - l * i, e[6] = h * a + M * i + l * r - b * s, e[7] = M * a - l * s - b * r - h * i, e; + } + }, { + key: "rotateY", + value: function rotateY(e, t, n) { + var s = -t[0], + r = -t[1], + i = -t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = c * a + k * s + y * i - L * r, + b = y * a + k * r + L * s - c * i, + h = L * a + k * i + c * r - y * s, + M = k * a - c * s - y * r - L * i; + return O.rotateY(e, t, n), s = e[0], r = e[1], i = e[2], a = e[3], e[4] = l * a + M * s + b * i - h * r, e[5] = b * a + M * r + h * s - l * i, e[6] = h * a + M * i + l * r - b * s, e[7] = M * a - l * s - b * r - h * i, e; + } + }, { + key: "rotateZ", + value: function rotateZ(e, t, n) { + var s = -t[0], + r = -t[1], + i = -t[2], + a = t[3], + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = c * a + k * s + y * i - L * r, + b = y * a + k * r + L * s - c * i, + h = L * a + k * i + c * r - y * s, + M = k * a - c * s - y * r - L * i; + return O.rotateZ(e, t, n), s = e[0], r = e[1], i = e[2], a = e[3], e[4] = l * a + M * s + b * i - h * r, e[5] = b * a + M * r + h * s - l * i, e[6] = h * a + M * i + l * r - b * s, e[7] = M * a - l * s - b * r - h * i, e; + } + }, { + key: "rotateByQuatAppend", + value: function rotateByQuatAppend(e, t, n) { + var s = n[0], + r = n[1], + i = n[2], + a = n[3], + c = t[0], + y = t[1], + L = t[2], + k = t[3]; + return e[0] = c * a + k * s + y * i - L * r, e[1] = y * a + k * r + L * s - c * i, e[2] = L * a + k * i + c * r - y * s, e[3] = k * a - c * s - y * r - L * i, c = t[4], y = t[5], L = t[6], k = t[7], e[4] = c * a + k * s + y * i - L * r, e[5] = y * a + k * r + L * s - c * i, e[6] = L * a + k * i + c * r - y * s, e[7] = k * a - c * s - y * r - L * i, e; + } + }, { + key: "rotateByQuatPrepend", + value: function rotateByQuatPrepend(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = n[0], + y = n[1], + L = n[2], + k = n[3]; + return e[0] = s * k + a * c + r * L - i * y, e[1] = r * k + a * y + i * c - s * L, e[2] = i * k + a * L + s * y - r * c, e[3] = a * k - s * c - r * y - i * L, c = n[4], y = n[5], L = n[6], k = n[7], e[4] = s * k + a * c + r * L - i * y, e[5] = r * k + a * y + i * c - s * L, e[6] = i * k + a * L + s * y - r * c, e[7] = a * k - s * c - r * y - i * L, e; + } + }, { + key: "rotateAroundAxis", + value: function rotateAroundAxis(e, t, n, s) { + if (Math.abs(s) < 1e-6) return j.copy(e, t); + var r = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); + s = s * .5; + var i = Math.sin(s), + a = i * n[0] / r, + c = i * n[1] / r, + y = i * n[2] / r, + L = Math.cos(s), + k = t[0], + l = t[1], + b = t[2], + h = t[3]; + e[0] = k * L + h * a + l * y - b * c, e[1] = l * L + h * c + b * a - k * y, e[2] = b * L + h * y + k * c - l * a, e[3] = h * L - k * a - l * c - b * y; + var M = t[4], + d = t[5], + m = t[6], + x = t[7]; + return e[4] = M * L + x * a + d * y - m * c, e[5] = d * L + x * c + m * a - M * y, e[6] = m * L + x * y + M * c - d * a, e[7] = x * L - M * a - d * c - m * y, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e[4] = t[4] + n[4], e[5] = t[5] + n[5], e[6] = t[6] + n[6], e[7] = t[7] + n[7], e; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + var s = t[0], + r = t[1], + i = t[2], + a = t[3], + c = n[4], + y = n[5], + L = n[6], + k = n[7], + l = t[4], + b = t[5], + h = t[6], + M = t[7], + d = n[0], + m = n[1], + x = n[2], + V = n[3]; + return e[0] = s * V + a * d + r * x - i * m, e[1] = r * V + a * m + i * d - s * x, e[2] = i * V + a * x + s * m - r * d, e[3] = a * V - s * d - r * m - i * x, e[4] = s * k + a * c + r * L - i * y + l * V + M * d + b * x - h * m, e[5] = r * k + a * y + i * c - s * L + b * V + M * m + h * d - l * x, e[6] = i * k + a * L + s * y - r * c + h * V + M * x + l * m - b * d, e[7] = a * k - s * c - r * y - i * L + M * V - l * d - b * m - h * x, e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * n, e[5] = t[5] * n, e[6] = t[6] * n, e[7] = t[7] * n, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return 0; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = 1 - s; + return j.dot(t, n) < 0 && (s = -s), e[0] = t[0] * r + n[0] * s, e[1] = t[1] * r + n[1] * s, e[2] = t[2] * r + n[2] * s, e[3] = t[3] * r + n[3] * s, e[4] = t[4] * r + n[4] * s, e[5] = t[5] * r + n[5] * s, e[6] = t[6] * r + n[6] * s, e[7] = t[7] * r + n[7] * s, e; + } + }, { + key: "invert", + value: function invert(e, t) { + var n = j.squaredLength(t); + return e[0] = -t[0] / n, e[1] = -t[1] / n, e[2] = -t[2] / n, e[3] = t[3] / n, e[4] = -t[4] / n, e[5] = -t[5] / n, e[6] = -t[6] / n, e[7] = t[7] / n, e; + } + }, { + key: "conjugate", + value: function conjugate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = t[3], e[4] = -t[4], e[5] = -t[5], e[6] = -t[6], e[7] = t[7], e; + } + }, { + key: "magnitude", + value: function magnitude(e) { + return 0; + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + return 0; + } + }, { + key: "sqrLen", + value: function sqrLen(e) { + return 0; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = j.squaredLength(t); + if (n > 0) { + n = Math.sqrt(n); + var s = t[0] / n, + r = t[1] / n, + i = t[2] / n, + a = t[3] / n, + c = t[4], + y = t[5], + L = t[6], + k = t[7], + l = s * c + r * y + i * L + a * k; + e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = (c - s * l) / n, e[5] = (y - r * l) / n, e[6] = (L - i * l) / n, e[7] = (k - a * l) / n; + } + return e; + } + }, { + key: "str", + value: function str(e) { + return "Quat2(".concat(e.join(", "), ")"); + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = e[2], + i = e[3], + a = e[4], + c = e[5], + y = e[6], + L = e[7], + k = t[0], + l = t[1], + b = t[2], + h = t[3], + M = t[4], + d = t[5], + m = t[6], + x = t[7]; + return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - b) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(b)) && Math.abs(i - h) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(h)) && Math.abs(a - M) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(M)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - x) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(x)); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + ye = new WeakMap(), Le = new WeakMap(), Z(j, ye, new Float64Array(4)), Z(j, Le, new Float64Array(3)); + var J = j; + J.dot = O.dot; + J.squaredLength = O.squaredLength; + J.sqrLen = O.squaredLength; + J.mag = O.magnitude; + J.length = O.magnitude; + J.len = O.magnitude; + J.mul = J.multiply; + var F = /*#__PURE__*/function (_Float64Array9) { + function A() { + var _this9; + _classCallCheck(this, A); + switch (arguments.length) { + case 2: + { + var t = arguments.length <= 0 ? undefined : arguments[0]; + typeof t == "number" ? _this9 = _callSuper(this, A, [[t, arguments.length <= 1 ? undefined : arguments[1]]]) : _this9 = _callSuper(this, A, [t, arguments.length <= 1 ? undefined : arguments[1], 2]); + break; + } + case 1: + { + var _t = arguments.length <= 0 ? undefined : arguments[0]; + typeof _t == "number" ? _this9 = _callSuper(this, A, [[_t, _t]]) : _this9 = _callSuper(this, A, [_t, 0, 2]); + break; + } + default: + _this9 = _callSuper(this, A, [2]); + break; + } + return _assertThisInitialized(_this9); + } + _inherits(A, _Float64Array9); + return _createClass(A, [{ + key: "x", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "y", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "r", + get: function get() { + return this[0]; + }, + set: function set(e) { + this[0] = e; + } + }, { + key: "g", + get: function get() { + return this[1]; + }, + set: function set(e) { + this[1] = e; + } + }, { + key: "magnitude", + get: function get() { + return Math.hypot(this[0], this[1]); + } + }, { + key: "mag", + get: function get() { + return this.magnitude; + } + }, { + key: "squaredMagnitude", + get: function get() { + var e = this[0], + t = this[1]; + return e * e + t * t; + } + }, { + key: "sqrMag", + get: function get() { + return this.squaredMagnitude; + } + }, { + key: "str", + get: function get() { + return A.str(this); + } + }, { + key: "copy", + value: function copy(e) { + return this.set(e), this; + } + }, { + key: "add", + value: function add(e) { + return this[0] += e[0], this[1] += e[1], this; + } + }, { + key: "subtract", + value: function subtract(e) { + return this[0] -= e[0], this[1] -= e[1], this; + } + }, { + key: "sub", + value: function sub(e) { + return this; + } + }, { + key: "multiply", + value: function multiply(e) { + return this[0] *= e[0], this[1] *= e[1], this; + } + }, { + key: "mul", + value: function mul(e) { + return this; + } + }, { + key: "divide", + value: function divide(e) { + return this[0] /= e[0], this[1] /= e[1], this; + } + }, { + key: "div", + value: function div(e) { + return this; + } + }, { + key: "scale", + value: function scale(e) { + return this[0] *= e, this[1] *= e, this; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t) { + return this[0] += e[0] * t, this[1] += e[1] * t, this; + } + }, { + key: "distance", + value: function distance(e) { + return A.distance(this, e); + } + }, { + key: "dist", + value: function dist(e) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e) { + return A.squaredDistance(this, e); + } + }, { + key: "sqrDist", + value: function sqrDist(e) { + return 0; + } + }, { + key: "negate", + value: function negate() { + return this[0] *= -1, this[1] *= -1, this; + } + }, { + key: "invert", + value: function invert() { + return this[0] = 1 / this[0], this[1] = 1 / this[1], this; + } + }, { + key: "abs", + value: function abs() { + return this[0] = Math.abs(this[0]), this[1] = Math.abs(this[1]), this; + } + }, { + key: "dot", + value: function dot(e) { + return this[0] * e[0] + this[1] * e[1]; + } + }, { + key: "normalize", + value: function normalize() { + return A.normalize(this, this); + } + }], [{ + key: "BYTE_LENGTH", + get: function get() { + return 2 * Float64Array.BYTES_PER_ELEMENT; + } + }, { + key: "create", + value: function create() { + return new A(); + } + }, { + key: "clone", + value: function clone(e) { + return new A(e); + } + }, { + key: "fromValues", + value: function fromValues(e, t) { + return new A(e, t); + } + }, { + key: "copy", + value: function copy(e, t) { + return e[0] = t[0], e[1] = t[1], e; + } + }, { + key: "set", + value: function set(e, t, n) { + return e[0] = t, e[1] = n, e; + } + }, { + key: "add", + value: function add(e, t, n) { + return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e; + } + }, { + key: "subtract", + value: function subtract(e, t, n) { + return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e; + } + }, { + key: "sub", + value: function sub(e, t, n) { + return [0, 0]; + } + }, { + key: "multiply", + value: function multiply(e, t, n) { + return e[0] = t[0] * n[0], e[1] = t[1] * n[1], e; + } + }, { + key: "mul", + value: function mul(e, t, n) { + return [0, 0]; + } + }, { + key: "divide", + value: function divide(e, t, n) { + return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e; + } + }, { + key: "div", + value: function div(e, t, n) { + return [0, 0]; + } + }, { + key: "ceil", + value: function ceil(e, t) { + return e[0] = Math.ceil(t[0]), e[1] = Math.ceil(t[1]), e; + } + }, { + key: "floor", + value: function floor(e, t) { + return e[0] = Math.floor(t[0]), e[1] = Math.floor(t[1]), e; + } + }, { + key: "min", + value: function min(e, t, n) { + return e[0] = Math.min(t[0], n[0]), e[1] = Math.min(t[1], n[1]), e; + } + }, { + key: "max", + value: function max(e, t, n) { + return e[0] = Math.max(t[0], n[0]), e[1] = Math.max(t[1], n[1]), e; + } + }, { + key: "round", + value: function round(e, t) { + return e[0] = Math.round(t[0]), e[1] = Math.round(t[1]), e; + } + }, { + key: "scale", + value: function scale(e, t, n) { + return e[0] = t[0] * n, e[1] = t[1] * n, e; + } + }, { + key: "scaleAndAdd", + value: function scaleAndAdd(e, t, n, s) { + return e[0] = t[0] + n[0] * s, e[1] = t[1] + n[1] * s, e; + } + }, { + key: "distance", + value: function distance(e, t) { + return Math.hypot(t[0] - e[0], t[1] - e[1]); + } + }, { + key: "dist", + value: function dist(e, t) { + return 0; + } + }, { + key: "squaredDistance", + value: function squaredDistance(e, t) { + var n = t[0] - e[0], + s = t[1] - e[1]; + return n * n + s * s; + } + }, { + key: "sqrDist", + value: function sqrDist(e, t) { + return 0; + } + }, { + key: "magnitude", + value: function magnitude(e) { + var t = e[0], + n = e[1]; + return Math.sqrt(t * t + n * n); + } + }, { + key: "mag", + value: function mag(e) { + return 0; + } + }, { + key: "length", + value: function length(e) { + return 0; + } + }, { + key: "len", + value: function len(e) { + return 0; + } + }, { + key: "squaredLength", + value: function squaredLength(e) { + var t = e[0], + n = e[1]; + return t * t + n * n; + } + }, { + key: "sqrLen", + value: function sqrLen(e, t) { + return 0; + } + }, { + key: "negate", + value: function negate(e, t) { + return e[0] = -t[0], e[1] = -t[1], e; + } + }, { + key: "inverse", + value: function inverse(e, t) { + return e[0] = 1 / t[0], e[1] = 1 / t[1], e; + } + }, { + key: "abs", + value: function abs(e, t) { + return e[0] = Math.abs(t[0]), e[1] = Math.abs(t[1]), e; + } + }, { + key: "normalize", + value: function normalize(e, t) { + var n = t[0], + s = t[1], + r = n * n + s * s; + return r > 0 && (r = 1 / Math.sqrt(r)), e[0] = t[0] * r, e[1] = t[1] * r, e; + } + }, { + key: "dot", + value: function dot(e, t) { + return e[0] * t[0] + e[1] * t[1]; + } + }, { + key: "cross", + value: function cross(e, t, n) { + var s = t[0] * n[1] - t[1] * n[0]; + return e[0] = e[1] = 0, e[2] = s, e; + } + }, { + key: "lerp", + value: function lerp(e, t, n, s) { + var r = t[0], + i = t[1]; + return e[0] = r + s * (n[0] - r), e[1] = i + s * (n[1] - i), e; + } + }, { + key: "transformMat2", + value: function transformMat2(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[2] * r, e[1] = n[1] * s + n[3] * r, e; + } + }, { + key: "transformMat2d", + value: function transformMat2d(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[2] * r + n[4], e[1] = n[1] * s + n[3] * r + n[5], e; + } + }, { + key: "transformMat3", + value: function transformMat3(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[3] * r + n[6], e[1] = n[1] * s + n[4] * r + n[7], e; + } + }, { + key: "transformMat4", + value: function transformMat4(e, t, n) { + var s = t[0], + r = t[1]; + return e[0] = n[0] * s + n[4] * r + n[12], e[1] = n[1] * s + n[5] * r + n[13], e; + } + }, { + key: "rotate", + value: function rotate(e, t, n, s) { + var r = t[0] - n[0], + i = t[1] - n[1], + a = Math.sin(s), + c = Math.cos(s); + return e[0] = r * c - i * a + n[0], e[1] = r * a + i * c + n[1], e; + } + }, { + key: "angle", + value: function angle(e, t) { + var n = e[0], + s = e[1], + r = t[0], + i = t[1], + a = Math.sqrt(n * n + s * s) * Math.sqrt(r * r + i * i), + c = a && (n * r + s * i) / a; + return Math.acos(Math.min(Math.max(c, -1), 1)); + } + }, { + key: "zero", + value: function zero(e) { + return e[0] = 0, e[1] = 0, e; + } + }, { + key: "exactEquals", + value: function exactEquals(e, t) { + return e[0] === t[0] && e[1] === t[1]; + } + }, { + key: "equals", + value: function equals(e, t) { + var n = e[0], + s = e[1], + r = t[0], + i = t[1]; + return Math.abs(n - r) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(r)) && Math.abs(s - i) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(i)); + } + }, { + key: "str", + value: function str(e) { + return "Vec2(".concat(e.join(", "), ")"); + } + }]); + }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + F.prototype.sub = F.prototype.subtract; + F.prototype.mul = F.prototype.multiply; + F.prototype.div = F.prototype.divide; + F.prototype.dist = F.prototype.distance; + F.prototype.sqrDist = F.prototype.squaredDistance; + F.sub = F.subtract; + F.mul = F.multiply; + F.div = F.divide; + F.dist = F.distance; + F.sqrDist = F.squaredDistance; + F.sqrLen = F.squaredLength; + F.mag = F.magnitude; + F.length = F.magnitude; + F.len = F.magnitude; + var me = !1; + function ve() { + if (me) return; + var A = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"], + e = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"], + t = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"], + n = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function s(r) { + switch (r.length) { + case 2: + return function () { + return new F(this[n[r[0]]], this[n[r[1]]]); + }; + case 3: + return function () { + return new T(this[n[r[0]]], this[n[r[1]]], this[n[r[2]]]); + }; + case 4: + return function () { + return new q(this[n[r[0]]], this[n[r[1]]], this[n[r[2]]], this[n[r[3]]]); + }; + } + } + for (var _i = 0, _A = A; _i < _A.length; _i++) { + var r = _A[_i]; + var i = s(r); + Object.defineProperty(F.prototype, r, { + get: i + }), Object.defineProperty(T.prototype, r, { + get: i + }), Object.defineProperty(q.prototype, r, { + get: i + }); + } + for (var _i2 = 0, _e2 = e; _i2 < _e2.length; _i2++) { + var _r = _e2[_i2]; + var _i3 = s(_r); + Object.defineProperty(T.prototype, _r, { + get: _i3 + }), Object.defineProperty(q.prototype, _r, { + get: _i3 + }); + } + for (var _i4 = 0, _t2 = t; _i4 < _t2.length; _i4++) { + var _r2 = _t2[_i4]; + var _i5 = s(_r2); + Object.defineProperty(q.prototype, _r2, { + get: _i5 + }); + } + me = !0; + } + var oe = Math.PI / 180, + Re = 180 / Math.PI; + function _e(A) { + return A * Re; + } + function et(A) { + return A * oe; + } + + exports.EnableSwizzlesF64 = ve; + exports.Mat2 = v; + exports.Mat2d = _; + exports.Mat3 = u; + exports.Mat4 = G; + exports.Quat = O; + exports.Quat2 = J; + exports.Vec2 = F; + exports.Vec3 = T; + exports.Vec4 = q; + exports.toDegree = _e; + exports.toRadian = et; + +})); +//# sourceMappingURL=gl-matrix-f64.min.cjs.map diff --git a/dist-cdn/umd/gl-matrix-f64.min.cjs.map b/dist-cdn/umd/gl-matrix-f64.min.cjs.map new file mode 100644 index 00000000..9f966fd4 --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f64.min.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f64.min.cjs","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]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[5]=n*P-r*p+i*N,e[6]=m*R-M*S-x*o,e[7]=k*S-b*R+h*o,e[8]=a*I-c*p+L*B,e[9]=s*p-n*I-i*B,e[10]=M*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-a*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-M*z-m*V,e[15]=k*z-l*o+b*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],b=e[11],h=e[12],M=e[13],d=e[14],m=e[15],x=t*a-n*i,V=t*c-s*i,o=n*c-s*a,R=L*M-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,k=s*c,l=s*y,b=s*L,h=r*y,M=r*L,d=i*L,m=a*c,x=a*y,V=a*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=b-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=M+m,e[7]=0,e[8]=b+x,e[9]=M-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+i*i;return k>0?(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2/k,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2/k):(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=0,e[4]=(r*I-s*P-i*Y)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(s*p-n*I-i*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-M*S-x*o)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"xzy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case\"yxz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case\"yzx\":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case\"zxy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"zyx\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(\", \")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","i","a","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/esm-d-ts.config.js b/esm-d-ts.config.js index 3906523d..b90ba3ef 100644 --- a/esm-d-ts.config.js +++ b/esm-d-ts.config.js @@ -22,7 +22,11 @@ const configs = [ { input: './src/types/index.ts', output: './dist/types/index.d.mts', importsLocal }, { input: './src/types/swizzle/index.ts', output: './dist/types/swizzle/index.d.mts', importsLocal, dtsReplace }, { input: './src/types/swizzle/f64/index.ts', output: './dist/types/swizzle/f64/index.d.mts', importsLocal, dtsReplace }, - { input: './src/util/index.ts', output: './dist/util/index.d.mts', importsLocal } + { input: './src/util/index.ts', output: './dist/util/index.d.mts', importsLocal }, + + // Bundles CDN types. + { input: './scripts/bundle/cdn-entry-f32.ts', output: './dist-cdn/types/gl-matrix-f32.d.mts' }, + { input: './scripts/bundle/cdn-entry-f64.ts', output: './dist-cdn/types/gl-matrix-f64.d.mts' } ]; export default configs; diff --git a/package-lock.json b/package-lock.json index 3a67c60d..21676a09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,16 @@ "version": "4.0.0-beta.3", "license": "MIT", "devDependencies": { + "@babel/core": "^7.24.7", + "@babel/preset-env": "^7.24.7", + "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", "@typhonjs-utils/file-util": "^0.1.0", "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.6.0", "esbuild": "^0.21.0", + "rollup": "^4.18.0", "typedoc": "0.25.12", "typescript": "^5.4.0", "vitest": "^1.6.0" @@ -34,1632 +38,1771 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", - "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, - "optional": true, "dependencies": { - "@babel/highlight": "^7.24.6", + "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-string-parser": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", - "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", + "node_modules/@babel/compat-data": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", + "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", - "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "node_modules/@babel/core": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", + "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helpers": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, "engines": { "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/highlight": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", - "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", "dev": true, - "optional": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.6", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", "dev": true, - "optional": true + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@babel/parser": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.6.tgz", - "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", + "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { - "node": ">=6.0.0" + "node": ">=6.9.0" } }, - "node_modules/@babel/types": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.6.tgz", - "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", + "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.6", - "@babel/helper-validator-identifier": "^7.24.6", - "to-fast-properties": "^2.0.0" + "@babel/compat-data": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } }, - "node_modules/@es-joy/jsdoccomment": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", - "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", + "integrity": "sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==", "dev": true, "dependencies": { - "@types/eslint": "^8.56.5", - "@types/estree": "^1.0.5", - "@typescript-eslint/types": "^7.2.0", - "comment-parser": "1.4.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.7", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "semver": "^6.3.1" }, "engines": { - "node": ">=16" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", - "cpu": [ - "ppc64" - ], + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", - "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", - "cpu": [ - "arm" - ], + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz", + "integrity": "sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==", "dev": true, - "optional": true, - "os": [ - "android" - ], + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", + "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.7.tgz", + "integrity": "sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", - "cpu": [ - "arm" - ], + "node_modules/@babel/helper-module-imports": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/helper-module-transforms": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", + "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", - "cpu": [ - "ia32" - ], + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", + "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", - "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", - "cpu": [ - "loong64" - ], + "node_modules/@babel/helper-plugin-utils": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.7.tgz", + "integrity": "sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", - "cpu": [ - "mips64el" - ], + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.7.tgz", + "integrity": "sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-wrap-function": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", - "cpu": [ - "ppc64" - ], + "node_modules/@babel/helper-replace-supers": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.7.tgz", + "integrity": "sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.7", + "@babel/helper-optimise-call-expression": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", - "cpu": [ - "riscv64" - ], + "node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", - "cpu": [ - "s390x" - ], + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", + "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", - "cpu": [ - "x64" - ], + "node_modules/@babel/helper-validator-option": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", + "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", "dev": true, - "optional": true, - "os": [ - "sunos" - ], "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/helper-wrap-function": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.24.7.tgz", + "integrity": "sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@babel/helper-function-name": "^7.24.7", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", - "cpu": [ - "ia32" - ], + "node_modules/@babel/helpers": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", + "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", - "cpu": [ - "x64" - ], + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "node_modules/@babel/highlight/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + "bin": { + "parser": "bin/babel-parser.js" }, "engines": { - "node": ">=12" + "node": ">=6.0.0" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.7.tgz", + "integrity": "sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==", "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.7.tgz", + "integrity": "sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg==", "dev": true, "dependencies": { - "@sinclair/typebox": "^0.27.8" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", + "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7" }, "engines": { - "node": ">=6.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.7.tgz", + "integrity": "sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg==", "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=6.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "@babel/helper-plugin-utils": "^7.12.13" }, - "engines": { - "node": ">= 8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, "engines": { - "node": ">= 8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">= 8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", "dev": true, - "optional": true, - "engines": { - "node": ">=14" + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@polka/url": { - "version": "1.0.0-next.25", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", - "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", - "dev": true - }, - "node_modules/@rollup/plugin-alias": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz", - "integrity": "sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==", + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", + "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", "dev": true, "dependencies": { - "slash": "^4.0.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=14.0.0" + "node": ">=6.9.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "@babel/core": "^7.0.0-0" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", - "cpu": [ - "arm" - ], + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", + "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", "dev": true, - "optional": true, - "os": [ - "android" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, - "optional": true, - "os": [ - "android" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", - "cpu": [ - "x64" - ], + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", - "cpu": [ - "arm" - ], + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", - "cpu": [ - "arm" - ], + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", - "cpu": [ - "ppc64" - ], + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", - "cpu": [ - "riscv64" - ], + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", - "cpu": [ - "s390x" - ], + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", - "cpu": [ - "x64" - ], + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", - "cpu": [ - "x64" - ], + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", + "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", - "cpu": [ - "arm64" - ], + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.7.tgz", + "integrity": "sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g==", "dev": true, - "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-remap-async-to-generator": "^7.24.7", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", - "cpu": [ - "ia32" - ], + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz", + "integrity": "sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==", "dev": true, - "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-remap-async-to-generator": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", - "cpu": [ - "x64" - ], + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", + "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } }, - "node_modules/@ts-morph/common": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", - "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.7.tgz", + "integrity": "sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==", "dev": true, "dependencies": { - "fast-glob": "^3.3.2", - "minimatch": "^9.0.3", - "mkdirp": "^3.0.1", - "path-browserify": "^1.0.1" + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@types/cytoscape": { - "version": "3.21.2", - "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.2.tgz", - "integrity": "sha512-eadSCH9hbRV9Ej93S8wact/Oe0DuQV4qlWfST/I6k4lBu6RgqI6mVFzvppcIGzWpzZRu7iyFjFhS2qW0w7KFRA==", - "dev": true - }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.7.tgz", + "integrity": "sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==", "dev": true, "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/@typescript-eslint/types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", - "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz", + "integrity": "sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==", "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": ">=6.9.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependencies": { + "@babel/core": "^7.12.0" } }, - "node_modules/@typhonjs-build-test/esm-d-ts": { - "version": "0.3.0-next.7", - "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", - "integrity": "sha512-xZS7Zz0LJZhdCV6z5NpwrKIMdghQdzypxSZ5iYB0FY+UQers5YkGW7BRs19XW8os0+LnP2ktZzWR2W5SkyHNuQ==", + "node_modules/@babel/plugin-transform-classes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.7.tgz", + "integrity": "sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "^0.43.0", - "@rollup/plugin-alias": "^5.1.0", - "@types/cytoscape": "^3.21.2", - "@typhonjs-build-test/rollup-plugin-pkg-imports": "^0.5.0", - "@typhonjs-plugin/manager": "^0.1.2", - "@typhonjs-utils/file-util": "^0.1.0", - "@typhonjs-utils/logger-color": "^0.1.0", - "@typhonjs-utils/object": "^0.1.0", - "@typhonjs-utils/package-json": "^0.7.0", - "comment-parser": "^1.4.0", - "cytoscape": "^3.29.0", - "es-module-lexer": "^1.5.0", - "fs-extra": "^11.2.0", - "glob-to-regexp": "^0.4.0", - "import-meta-resolve": "^4.1.0", - "prettier": "^3.2.0", - "resolve.exports": "^2.0.2", - "rollup-plugin-dts": "^6.1.0", - "sade": "^1.8.1", - "ts-morph": "^22.0.0", - "type-fest": "^4.18.0", - "upath": "^2.0.1" - }, - "bin": { - "esm-d-ts": "src/cli/index.js" + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "globals": "^11.1.0" }, "engines": { - "node": ">=18" + "node": ">=6.9.0" }, "peerDependencies": { - "rollup": "3.3 - 4", - "typescript": ">=5.1" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-build-test/rollup-plugin-pkg-imports": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@typhonjs-build-test/rollup-plugin-pkg-imports/-/rollup-plugin-pkg-imports-0.5.0.tgz", - "integrity": "sha512-YAcRIETyEw4zMuQsJNQrOFHo/lqml88lligtClSSAQXnGT6ez0jiluDhxjzkJAQ2NGdALh09CGNL/xZgtUecCQ==", + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", + "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", "dev": true, "dependencies": { - "@typhonjs-utils/package-json": "^0.7.0", - "glob-to-regexp": "^0.4.1", - "import-meta-resolve": "^4.0.0", - "resolve.exports": "^2.0.2" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/template": "^7.24.7" }, "engines": { - "node": ">=18.0" + "node": ">=6.9.0" }, "peerDependencies": { - "rollup": "3.3 - 4" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-plugin/manager": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@typhonjs-plugin/manager/-/manager-0.1.2.tgz", - "integrity": "sha512-bMtnjVlqeiPjmW/U+rBm5Mb+ZoZs7uKyZYN3Rtq0DXzndyMrIDBOiQyssSwGxpFVDC7V9yArvt0EoGWDxAIYLQ==", + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.7.tgz", + "integrity": "sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=14.18" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-typedoc/ts-lib-docs": { - "version": "2023.7.12", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2023.7.12.tgz", - "integrity": "sha512-vaiDbYGjnx7+gMM7KWSgNpGFxqr2Gw5MYpi9hvLWt8/nZ98EaTo1M4WjT6XtgbCw0w0x7greMlYWLgk7Mak/TA==", + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", + "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, "peerDependencies": { - "typedoc": ">=0.24.8" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-typedoc/typedoc-pkg": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.0.5.tgz", - "integrity": "sha512-+0sLiuJJqEpptYizN/od1tzEmJIkheWIeJ+xV8ONzbNeXtWkUAHA5PzBEmXr2xxJQRpUhV5cYI0fQOAwOFcx5Q==", + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", + "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", "dev": true, "dependencies": { - "@typhonjs-typedoc/ts-lib-docs": "2023.7.12", - "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0-next.14", - "@typhonjs-utils/file-util": "^0.1.0", - "@typhonjs-utils/logger-color": "^0.1.0", - "@typhonjs-utils/object": "^0.1.0", - "@typhonjs-utils/package-json": "^0.7.0", - "glob": "^10.3.10", - "is-glob": "^4.0.3", - "resolve.exports": "^2.0.2", - "sade": "^1.8.1", - "upath": "^2" - }, - "bin": { - "typedoc-pkg": "src/cli/index.js" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=18" + "node": ">=6.9.0" }, "peerDependencies": { - "typedoc": ">=0.25.10 <0.26.0", - "typescript": ">=5.1.0 <6" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { - "version": "0.2.0-next.14", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0-next.14.tgz", - "integrity": "sha512-ucMzhwtF/MKGqHxkCIpfrWMgZxdhfWLcAvwiEkgWpbmCmQUKhh6V+yGyHUG9TqRkZJCGXvgqNoziVyEYQKt/xw==", + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", + "integrity": "sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==", "dev": true, "dependencies": { - "cheerio": "^1.0.0-rc.12" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" }, "peerDependencies": { - "typedoc": ">=0.25.10" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-utils/file-util": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", - "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", + "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", "dev": true, "dependencies": { - "upath": "^2" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=16" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-utils/logger-color": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/logger-color/-/logger-color-0.1.0.tgz", - "integrity": "sha512-BWXSwxs5ZDVs4vi/YxJLLN3287+i4Z/KXqQuKUN5o5qWc4ioYU+ws9svZSL1XzqkLpF+j2oALhE8l0pmPydWxg==", + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz", + "integrity": "sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, "engines": { - "node": ">=14.18" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-utils/object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/object/-/object-0.1.0.tgz", - "integrity": "sha512-XCG2Qae6FZzzm81q0ya3D/xBRKlXF8lELi5T2E+nNYjqzi9T+2LTCUKR84dpo856wXAFn3CdTvDQKn5OVVnLlQ==", + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", + "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + }, "engines": { - "node": ">=14.18" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@typhonjs-utils/package-json": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/package-json/-/package-json-0.7.0.tgz", - "integrity": "sha512-aFoXJuGJqUuPJ+00/voU/iIc1bPDx0nJBGHt0ntyc1XmQOZDuwq7mLpHGsdIXZlF1lMSX/B9AFtlLATSyVWrVQ==", + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.7.tgz", + "integrity": "sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==", "dev": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/coverage-v8": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", - "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz", + "integrity": "sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.2.1", - "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.4", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.4", - "istanbul-reports": "^3.1.6", - "magic-string": "^0.30.5", - "magicast": "^0.3.3", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-json-strings": "^7.8.3" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" }, "peerDependencies": { - "vitest": "1.6.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "node_modules/@babel/plugin-transform-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz", + "integrity": "sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" + "@babel/helper-plugin-utils": "^7.24.7" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz", + "integrity": "sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", + "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", "dev": true, "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@babel/helper-plugin-utils": "^7.24.7" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", + "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", "dev": true, "dependencies": { - "tinyspy": "^2.2.0" + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/ui": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", - "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.7.tgz", + "integrity": "sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "fast-glob": "^3.3.2", - "fflate": "^0.8.1", - "flatted": "^3.2.9", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "sirv": "^2.0.4" + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" }, "peerDependencies": { - "vitest": "1.6.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.7.tgz", + "integrity": "sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw==", "dev": true, "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", + "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=0.4.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", + "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=0.4.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", + "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=12" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", - "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", - "dev": true - }, - "node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz", + "integrity": "sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz", + "integrity": "sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, "engines": { - "node": "*" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.7.tgz", + "integrity": "sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", + "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", "dev": true, "dependencies": { - "fill-range": "^7.1.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz", + "integrity": "sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.7.tgz", + "integrity": "sha512-tK+0N9yd4j+x/4hxF3F0e0fu/VdcxU18y5SevtyM/PCFlQvXbR0Zmlo2eBrKtVipGNFzpq56o8WsIIKcJFUCRQ==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", + "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", "dev": true, - "optional": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/chalk/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.7.tgz", + "integrity": "sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==", "dev": true, - "optional": true, "dependencies": { - "color-convert": "^1.9.0" + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz", + "integrity": "sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==", "dev": true, "dependencies": { - "get-func-name": "^2.0.2" + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { - "node": "*" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", + "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", "dev": true, "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">= 6" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", + "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", "dev": true, "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" + "@babel/helper-plugin-utils": "^7.24.7", + "regenerator-transform": "^0.15.2" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/code-block-writer": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", - "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==", - "dev": true - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", + "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", "dev": true, - "optional": true, "dependencies": { - "color-name": "1.1.3" + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "optional": true - }, - "node_modules/comment-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", - "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", + "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">= 12.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/@babel/plugin-transform-spread": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", + "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" }, "engines": { - "node": ">= 8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", + "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", "dev": true, "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" + "@babel/helper-plugin-utils": "^7.24.7" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", + "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">= 6" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/cytoscape": { - "version": "3.29.2", - "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.29.2.tgz", - "integrity": "sha512-2G1ycU28Nh7OHT9rkXRLpCDP30MKH1dXJORZuBhtEhEW7pKwgPi77ImqlCWinouyE1PNepIOGZBOrE84DG7LyQ==", + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.7.tgz", + "integrity": "sha512-VtR8hDy7YLB7+Pet9IarXjg/zgCMSF+1mNS/EQEiEaUPoFXCVsHG64SIxcaaI2zJgRiv+YmgaQESUfWAdbjzgg==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": ">=0.10" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", + "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", "dev": true, "dependencies": { - "ms": "2.1.2" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=6.0" + "node": ">=6.9.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz", + "integrity": "sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==", "dev": true, "dependencies": { - "type-detect": "^4.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { - "node": ">=6" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", + "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.7.tgz", + "integrity": "sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg==", "dev": true, "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "node_modules/@babel/preset-env": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.7.tgz", + "integrity": "sha512-1YZNsc+y6cTvWlDHidMBsQZrZfEFjRIo/BZCT906PMdzOyXtSLTgqGdrpcuTDCXyd11Am5uQULtDIcCfnTc8fQ==", "dev": true, "dependencies": { - "domelementtype": "^2.3.0" + "@babel/compat-data": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.7", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.24.7", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.24.7", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoped-functions": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.24.7", + "@babel/plugin-transform-class-properties": "^7.24.7", + "@babel/plugin-transform-class-static-block": "^7.24.7", + "@babel/plugin-transform-classes": "^7.24.7", + "@babel/plugin-transform-computed-properties": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.7", + "@babel/plugin-transform-dotall-regex": "^7.24.7", + "@babel/plugin-transform-duplicate-keys": "^7.24.7", + "@babel/plugin-transform-dynamic-import": "^7.24.7", + "@babel/plugin-transform-exponentiation-operator": "^7.24.7", + "@babel/plugin-transform-export-namespace-from": "^7.24.7", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.24.7", + "@babel/plugin-transform-json-strings": "^7.24.7", + "@babel/plugin-transform-literals": "^7.24.7", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", + "@babel/plugin-transform-member-expression-literals": "^7.24.7", + "@babel/plugin-transform-modules-amd": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.7", + "@babel/plugin-transform-modules-systemjs": "^7.24.7", + "@babel/plugin-transform-modules-umd": "^7.24.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-new-target": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-numeric-separator": "^7.24.7", + "@babel/plugin-transform-object-rest-spread": "^7.24.7", + "@babel/plugin-transform-object-super": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7", + "@babel/plugin-transform-parameters": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-property-literals": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-reserved-words": "^7.24.7", + "@babel/plugin-transform-shorthand-properties": "^7.24.7", + "@babel/plugin-transform-spread": "^7.24.7", + "@babel/plugin-transform-sticky-regex": "^7.24.7", + "@babel/plugin-transform-template-literals": "^7.24.7", + "@babel/plugin-transform-typeof-symbol": "^7.24.7", + "@babel/plugin-transform-unicode-escapes": "^7.24.7", + "@babel/plugin-transform-unicode-property-regex": "^7.24.7", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.24.7", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.4", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.31.0", + "semver": "^6.3.1" }, "engines": { - "node": ">= 4" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "node_modules/@babel/preset-env/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", "dev": true, "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", "dev": true }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "node_modules/@babel/runtime": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + }, "engines": { - "node": ">=0.12" + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", + "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7", + "debug": "^4.3.1", + "globals": "^11.1.0" }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "engines": { + "node": ">=6.9.0" } }, - "node_modules/es-module-lexer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", - "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/esbuild": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", - "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", + "node_modules/@es-joy/jsdoccomment": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", + "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" + "dependencies": { + "@types/eslint": "^8.56.5", + "@types/estree": "^1.0.5", + "@typescript-eslint/types": "^7.2.0", + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" }, "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.4", - "@esbuild/android-arm": "0.21.4", - "@esbuild/android-arm64": "0.21.4", - "@esbuild/android-x64": "0.21.4", - "@esbuild/darwin-arm64": "0.21.4", - "@esbuild/darwin-x64": "0.21.4", - "@esbuild/freebsd-arm64": "0.21.4", - "@esbuild/freebsd-x64": "0.21.4", - "@esbuild/linux-arm": "0.21.4", - "@esbuild/linux-arm64": "0.21.4", - "@esbuild/linux-ia32": "0.21.4", - "@esbuild/linux-loong64": "0.21.4", - "@esbuild/linux-mips64el": "0.21.4", - "@esbuild/linux-ppc64": "0.21.4", - "@esbuild/linux-riscv64": "0.21.4", - "@esbuild/linux-s390x": "0.21.4", - "@esbuild/linux-x64": "0.21.4", - "@esbuild/netbsd-x64": "0.21.4", - "@esbuild/openbsd-x64": "0.21.4", - "@esbuild/sunos-x64": "0.21.4", - "@esbuild/win32-arm64": "0.21.4", - "@esbuild/win32-ia32": "0.21.4", - "@esbuild/win32-x64": "0.21.4" + "node": ">=16" } }, - "node_modules/esbuild/node_modules/@esbuild/aix-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", - "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -1672,10 +1815,26 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/android-arm64": { + "node_modules/@esbuild/android-arm": { "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", - "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", + "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -1688,10 +1847,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/android-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", - "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", + "node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -1704,10 +1863,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", - "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -1720,10 +1879,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", - "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -1736,10 +1895,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", - "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -1752,10 +1911,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", - "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -1768,10 +1927,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", - "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", + "node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -1784,10 +1943,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", - "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -1800,10 +1959,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", - "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -1816,10 +1975,26 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": { + "node_modules/@esbuild/linux-loong64": { "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", - "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", + "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -1832,10 +2007,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", - "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -1848,10 +2023,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", - "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -1864,10 +2039,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-s390x": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", - "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -1880,10 +2055,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", - "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", + "node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -1896,10 +2071,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", - "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -1912,10 +2087,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", - "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -1928,10 +2103,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/sunos-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", - "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -1944,10 +2119,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/win32-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", - "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -1960,10 +2135,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/win32-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", - "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -1976,10 +2151,10 @@ "node": ">=12" } }, - "node_modules/esbuild/node_modules/@esbuild/win32-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", - "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", + "node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -1992,1994 +2167,5092 @@ "node": ">=12" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, - "optional": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, "engines": { - "node": ">=0.8.0" + "node": ">=12" } }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, "engines": { - "node": ">=0.10" + "node": ">=8" } }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, "engines": { - "node": ">=4.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@types/estree": "^1.0.0" + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" } }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "node": ">=6.0.0" } }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, "engines": { - "node": ">=8.6.0" + "node": ">=6.0.0" } }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "reusify": "^1.0.4" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/fflate": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", - "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", - "dev": true - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": ">=8" + "node": ">= 8" } }, - "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true - }, - "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 8" } }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">=14.14" + "node": ">= 8" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "hasInstallScript": true, "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=14" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } + "node_modules/@polka/url": { + "version": "1.0.0-next.25", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", + "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", + "dev": true }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "node_modules/@rollup/plugin-alias": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz", + "integrity": "sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==", "dev": true, + "dependencies": { + "slash": "^4.0.0" + }, "engines": { - "node": ">=16" + "node": ">=14.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } } }, - "node_modules/glob": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "node_modules/@rollup/plugin-babel": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", + "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", "dev": true, "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" + "@babel/helper-module-imports": "^7.18.6", + "@rollup/pluginutils": "^5.0.1" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": ">=14.0.0" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependencies": { + "@babel/core": "^7.0.0", + "@types/babel__core": "^7.1.9", + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "@types/babel__core": { + "optional": true + }, + "rollup": { + "optional": true + } } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/@rollup/pluginutils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": ">= 6" + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } } }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "optional": true, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@ts-morph/common": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", + "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", + "dev": true, + "dependencies": { + "fast-glob": "^3.3.2", + "minimatch": "^9.0.3", + "mkdirp": "^3.0.1", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@types/cytoscape": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.2.tgz", + "integrity": "sha512-eadSCH9hbRV9Ej93S8wact/Oe0DuQV4qlWfST/I6k4lBu6RgqI6mVFzvppcIGzWpzZRu7iyFjFhS2qW0w7KFRA==", + "dev": true + }, + "node_modules/@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@typescript-eslint/types": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", + "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typhonjs-build-test/esm-d-ts": { + "version": "0.3.0-next.7", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", + "integrity": "sha512-xZS7Zz0LJZhdCV6z5NpwrKIMdghQdzypxSZ5iYB0FY+UQers5YkGW7BRs19XW8os0+LnP2ktZzWR2W5SkyHNuQ==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "^0.43.0", + "@rollup/plugin-alias": "^5.1.0", + "@types/cytoscape": "^3.21.2", + "@typhonjs-build-test/rollup-plugin-pkg-imports": "^0.5.0", + "@typhonjs-plugin/manager": "^0.1.2", + "@typhonjs-utils/file-util": "^0.1.0", + "@typhonjs-utils/logger-color": "^0.1.0", + "@typhonjs-utils/object": "^0.1.0", + "@typhonjs-utils/package-json": "^0.7.0", + "comment-parser": "^1.4.0", + "cytoscape": "^3.29.0", + "es-module-lexer": "^1.5.0", + "fs-extra": "^11.2.0", + "glob-to-regexp": "^0.4.0", + "import-meta-resolve": "^4.1.0", + "prettier": "^3.2.0", + "resolve.exports": "^2.0.2", + "rollup-plugin-dts": "^6.1.0", + "sade": "^1.8.1", + "ts-morph": "^22.0.0", + "type-fest": "^4.18.0", + "upath": "^2.0.1" + }, + "bin": { + "esm-d-ts": "src/cli/index.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "rollup": "3.3 - 4", + "typescript": ">=5.1" + } + }, + "node_modules/@typhonjs-build-test/rollup-plugin-pkg-imports": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/rollup-plugin-pkg-imports/-/rollup-plugin-pkg-imports-0.5.0.tgz", + "integrity": "sha512-YAcRIETyEw4zMuQsJNQrOFHo/lqml88lligtClSSAQXnGT6ez0jiluDhxjzkJAQ2NGdALh09CGNL/xZgtUecCQ==", + "dev": true, + "dependencies": { + "@typhonjs-utils/package-json": "^0.7.0", + "glob-to-regexp": "^0.4.1", + "import-meta-resolve": "^4.0.0", + "resolve.exports": "^2.0.2" + }, + "engines": { + "node": ">=18.0" + }, + "peerDependencies": { + "rollup": "3.3 - 4" + } + }, + "node_modules/@typhonjs-plugin/manager": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@typhonjs-plugin/manager/-/manager-0.1.2.tgz", + "integrity": "sha512-bMtnjVlqeiPjmW/U+rBm5Mb+ZoZs7uKyZYN3Rtq0DXzndyMrIDBOiQyssSwGxpFVDC7V9yArvt0EoGWDxAIYLQ==", + "dev": true, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@typhonjs-typedoc/ts-lib-docs": { + "version": "2023.7.12", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2023.7.12.tgz", + "integrity": "sha512-vaiDbYGjnx7+gMM7KWSgNpGFxqr2Gw5MYpi9hvLWt8/nZ98EaTo1M4WjT6XtgbCw0w0x7greMlYWLgk7Mak/TA==", + "dev": true, + "peerDependencies": { + "typedoc": ">=0.24.8" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-pkg": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.0.5.tgz", + "integrity": "sha512-+0sLiuJJqEpptYizN/od1tzEmJIkheWIeJ+xV8ONzbNeXtWkUAHA5PzBEmXr2xxJQRpUhV5cYI0fQOAwOFcx5Q==", + "dev": true, + "dependencies": { + "@typhonjs-typedoc/ts-lib-docs": "2023.7.12", + "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0-next.14", + "@typhonjs-utils/file-util": "^0.1.0", + "@typhonjs-utils/logger-color": "^0.1.0", + "@typhonjs-utils/object": "^0.1.0", + "@typhonjs-utils/package-json": "^0.7.0", + "glob": "^10.3.10", + "is-glob": "^4.0.3", + "resolve.exports": "^2.0.2", + "sade": "^1.8.1", + "upath": "^2" + }, + "bin": { + "typedoc-pkg": "src/cli/index.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "typedoc": ">=0.25.10 <0.26.0", + "typescript": ">=5.1.0 <6" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { + "version": "0.2.0-next.14", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0-next.14.tgz", + "integrity": "sha512-ucMzhwtF/MKGqHxkCIpfrWMgZxdhfWLcAvwiEkgWpbmCmQUKhh6V+yGyHUG9TqRkZJCGXvgqNoziVyEYQKt/xw==", + "dev": true, + "dependencies": { + "cheerio": "^1.0.0-rc.12" + }, + "peerDependencies": { + "typedoc": ">=0.25.10" + } + }, + "node_modules/@typhonjs-utils/file-util": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", + "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", + "dev": true, + "dependencies": { + "upath": "^2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@typhonjs-utils/logger-color": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/logger-color/-/logger-color-0.1.0.tgz", + "integrity": "sha512-BWXSwxs5ZDVs4vi/YxJLLN3287+i4Z/KXqQuKUN5o5qWc4ioYU+ws9svZSL1XzqkLpF+j2oALhE8l0pmPydWxg==", + "dev": true, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@typhonjs-utils/object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/object/-/object-0.1.0.tgz", + "integrity": "sha512-XCG2Qae6FZzzm81q0ya3D/xBRKlXF8lELi5T2E+nNYjqzi9T+2LTCUKR84dpo856wXAFn3CdTvDQKn5OVVnLlQ==", + "dev": true, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@typhonjs-utils/package-json": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/package-json/-/package-json-0.7.0.tgz", + "integrity": "sha512-aFoXJuGJqUuPJ+00/voU/iIc1bPDx0nJBGHt0ntyc1XmQOZDuwq7mLpHGsdIXZlF1lMSX/B9AFtlLATSyVWrVQ==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@vitest/coverage-v8": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", + "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.4", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "1.6.0" + } + }, + "node_modules/@vitest/expect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.6.0", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", + "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.6.0", + "fast-glob": "^3.3.2", + "fflate": "^0.8.1", + "flatted": "^3.2.9", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "sirv": "^2.0.4" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "1.6.0" + } + }, + "node_modules/@vitest/utils": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-sequence-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", + "dev": true + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", + "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.2", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", + "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.1", + "core-js-compat": "^3.36.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz", + "integrity": "sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.16" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001634", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001634.tgz", + "integrity": "sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dev": true, + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", + "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==", + "dev": true + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/core-js-compat": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "dev": true, + "dependencies": { + "browserslist": "^4.23.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cytoscape": { + "version": "3.29.2", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.29.2.tgz", + "integrity": "sha512-2G1ycU28Nh7OHT9rkXRLpCDP30MKH1dXJORZuBhtEhEW7pKwgPi77ImqlCWinouyE1PNepIOGZBOrE84DG7LyQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/electron-to-chromium": { + "version": "1.4.803", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.803.tgz", + "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", + "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", + "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.4", + "@esbuild/android-arm": "0.21.4", + "@esbuild/android-arm64": "0.21.4", + "@esbuild/android-x64": "0.21.4", + "@esbuild/darwin-arm64": "0.21.4", + "@esbuild/darwin-x64": "0.21.4", + "@esbuild/freebsd-arm64": "0.21.4", + "@esbuild/freebsd-x64": "0.21.4", + "@esbuild/linux-arm": "0.21.4", + "@esbuild/linux-arm64": "0.21.4", + "@esbuild/linux-ia32": "0.21.4", + "@esbuild/linux-loong64": "0.21.4", + "@esbuild/linux-mips64el": "0.21.4", + "@esbuild/linux-ppc64": "0.21.4", + "@esbuild/linux-riscv64": "0.21.4", + "@esbuild/linux-s390x": "0.21.4", + "@esbuild/linux-x64": "0.21.4", + "@esbuild/netbsd-x64": "0.21.4", + "@esbuild/openbsd-x64": "0.21.4", + "@esbuild/sunos-x64": "0.21.4", + "@esbuild/win32-arm64": "0.21.4", + "@esbuild/win32-ia32": "0.21.4", + "@esbuild/win32-x64": "0.21.4" + } + }, + "node_modules/esbuild/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", + "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/android-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", + "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/android-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", + "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", + "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", + "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", + "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", + "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-arm": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", + "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", + "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-ia32": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", + "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", + "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", + "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", + "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-s390x": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", + "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", + "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", + "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", + "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/sunos-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", + "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-arm64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", + "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-ia32": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", + "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-x64": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", + "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", + "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "node_modules/magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/magicast": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", + "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@babel/types": "^7.24.0", + "source-map-js": "^1.2.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mlly": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", + "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.0", + "ufo": "^1.5.3" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", + "dev": true, + "dependencies": { + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" + } + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", + "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "node_modules/regenerator-transform": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regexpu-core": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "dev": true, + "dependencies": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-dts": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz", + "integrity": "sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.10" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.24.2" + }, + "peerDependencies": { + "rollup": "^3.29.4 || ^4", + "typescript": "^4.5 || ^5.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shiki": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", + "dev": true, + "dependencies": { + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, "engines": { - "node": ">=4" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "node_modules/sirv": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "dev": true, + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, - "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", + "dev": true, + "dependencies": { + "js-tokens": "^9.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "node_modules/tinybench": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "dev": true, "engines": { - "node": ">=16.17.0" + "node": ">=14.0.0" } }, - "node_modules/import-meta-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", - "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "engines": { + "node": ">=14.0.0" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "engines": { + "node": ">=4" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/ts-morph": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", + "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", "dev": true, "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" + "@ts-morph/common": "~0.23.0", + "code-block-writer": "^13.0.1" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "engines": { - "node": ">=0.12.0" + "node": ">=4" } }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "node_modules/type-fest": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", + "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "node_modules/typedoc": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", + "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "marked": "^4.3.0", + "minimatch": "^9.0.3", + "shiki": "^0.14.7" + }, + "bin": { + "typedoc": "bin/typedoc" + }, "engines": { - "node": ">=8" + "node": ">= 16" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, "engines": { - "node": ">=10" + "node": ">=14.17" } }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/ufo": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", - "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.23", - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0" - }, "engines": { - "node": ">=10" + "node": ">=4" } }, - "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/jackspeak": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", - "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" + "node": ">= 10.0.0" } }, - "node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, - "node_modules/jsdoc-type-pratt-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", - "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "node_modules/upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", "dev": true, "engines": { - "node": ">=12.0.0" + "node": ">=4", + "yarn": "*" } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "node_modules/update-browserslist-db": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "universalify": "^2.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "node_modules/vite": { + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", + "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", "dev": true, "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" }, "engines": { - "node": ">=14" + "node": "^18.0.0 || >=20.0.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } } }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "node_modules/vite-node": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dev": true, "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", - "dev": true, + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, "engines": { - "node": "14 || >=16.14" + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, - "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/magicast": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", - "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], "dev": true, - "dependencies": { - "@babel/parser": "^7.24.4", - "@babel/types": "^7.24.0", - "source-map-js": "^1.2.0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "node_modules/vite/node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, - "dependencies": { - "semver": "^7.5.3" + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" }, "engines": { - "node": ">=10" + "node": ">=12" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, - "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "node_modules/vitest": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", "dev": true, + "dependencies": { + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.3", + "vite": "^5.0.0", + "vite-node": "1.6.0", + "why-is-node-running": "^2.2.2" + }, "bin": { - "marked": "bin/marked.js" + "vitest": "vitest.mjs" }, "engines": { - "node": ">= 12" + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", "dev": true }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, "engines": { "node": ">= 8" } }, - "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", "dev": true, "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" }, "engines": { - "node": ">=8.6" + "node": ">=8" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=8" } }, - "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "bin": { - "mkdirp": "dist/cjs/src/bin.js" + "dependencies": { + "color-convert": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/mlly": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", - "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.1.0", - "ufo": "^1.5.3" - } - }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, + "color-name": "~1.1.4" + }, "engines": { - "node": ">=4" + "node": ">=7.0.0" } }, - "node_modules/mrmime": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", - "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", - "dev": true, - "engines": { - "node": ">=10" - } + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=8" } }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "path-key": "^4.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, "engines": { - "node": ">=12" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, - "dependencies": { - "boolbase": "^1.0.0" + "requires": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + } + }, + "@babel/compat-data": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", + "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", + "dev": true + }, + "@babel/core": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", + "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helpers": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "@babel/generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", + "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "dev": true, + "requires": { + "@babel/types": "^7.24.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", + "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", + "dev": true, + "requires": { + "@babel/types": "^7.24.7" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", + "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", + "dev": true, + "requires": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", + "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", "dev": true, + "requires": { + "@babel/compat-data": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, "dependencies": { - "wrappy": "1" + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } } }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "@babel/helper-create-class-features-plugin": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", + "integrity": "sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==", "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.7", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "semver": "^6.3.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } } }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "@babel/helper-create-regexp-features-plugin": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz", + "integrity": "sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==", "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } } }, - "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "@babel/helper-define-polyfill-provider": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", + "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", "dev": true, - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "requires": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" } }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", "dev": true, - "dependencies": { - "domhandler": "^5.0.2", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "requires": { + "@babel/types": "^7.24.7" } }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true + "@babel/helper-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", + "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", + "dev": true, + "requires": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" + } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "@babel/helper-hoist-variables": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", + "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.24.7" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "@babel/helper-member-expression-to-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.7.tgz", + "integrity": "sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "@babel/helper-module-imports": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dev": true, - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "requires": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true + "@babel/helper-module-transforms": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", + "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7" + } }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "@babel/helper-optimise-call-expression": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", + "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", "dev": true, - "engines": { - "node": "*" + "requires": { + "@babel/types": "^7.24.7" } }, - "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "@babel/helper-plugin-utils": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.7.tgz", + "integrity": "sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==", "dev": true }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "@babel/helper-remap-async-to-generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.7.tgz", + "integrity": "sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==", "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-wrap-function": "^7.24.7" } }, - "node_modules/pkg-types": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", - "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", + "@babel/helper-replace-supers": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.7.tgz", + "integrity": "sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==", "dev": true, - "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.7.0", - "pathe": "^1.1.2" + "requires": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.7", + "@babel/helper-optimise-call-expression": "^7.24.7" } }, - "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "@babel/helper-simple-access": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14" + "requires": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", + "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "requires": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "@babel/helper-split-export-declaration": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", + "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "requires": { + "@babel/types": "^7.24.7" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "dev": true }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true }, - "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "@babel/helper-validator-option": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", + "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.24.7.tgz", + "integrity": "sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==", "dev": true, - "engines": { - "node": ">=10" + "requires": { + "@babel/helper-function-name": "^7.24.7", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "@babel/helpers": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", + "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" + "requires": { + "@babel/template": "^7.24.7", + "@babel/types": "^7.24.7" } }, - "node_modules/rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, - "dependencies": { - "@types/estree": "1.0.5" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", - "fsevents": "~2.3.2" + "requires": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } } }, - "node_modules/rollup-plugin-dts": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz", - "integrity": "sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==", + "@babel/parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "dev": true + }, + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.7.tgz", + "integrity": "sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==", "dev": true, - "dependencies": { - "magic-string": "^0.30.10" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/Swatinem" - }, - "optionalDependencies": { - "@babel/code-frame": "^7.24.2" - }, - "peerDependencies": { - "rollup": "^3.29.4 || ^4", - "typescript": "^4.5 || ^5.0" + "requires": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.7.tgz", + "integrity": "sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", + "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", "dev": true, - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">=6" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7" } }, - "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.7.tgz", + "integrity": "sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg==", "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "requires": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" + "requires": {} + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" } }, - "node_modules/shiki": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", - "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", + "@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, - "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" } }, - "node_modules/sirv": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", - "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "@babel/plugin-syntax-import-assertions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", + "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", "dev": true, - "dependencies": { - "@polka/url": "^1.0.0-next.24", - "mrmime": "^2.0.0", - "totalist": "^3.0.0" - }, - "engines": { - "node": ">= 10" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "@babel/plugin-syntax-import-attributes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", + "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" } }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" } }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" } }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", + "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "@babel/plugin-transform-async-generator-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.7.tgz", + "integrity": "sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-remap-async-to-generator": "^7.24.7", + "@babel/plugin-syntax-async-generators": "^7.8.4" } }, - "node_modules/strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", + "@babel/plugin-transform-async-to-generator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz", + "integrity": "sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==", "dev": true, - "dependencies": { - "js-tokens": "^9.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" + "requires": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-remap-async-to-generator": "^7.24.7" } }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", + "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", "dev": true, - "optional": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "@babel/plugin-transform-block-scoping": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.7.tgz", + "integrity": "sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==", "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "@babel/plugin-transform-class-properties": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.7.tgz", + "integrity": "sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/test-exclude/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "@babel/plugin-transform-class-static-block": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz", + "integrity": "sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-class-static-block": "^7.14.5" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "@babel/plugin-transform-classes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.7.tgz", + "integrity": "sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "globals": "^11.1.0" } }, - "node_modules/tinybench": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", - "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "@babel/plugin-transform-computed-properties": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", + "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", "dev": true, - "engines": { - "node": ">=14.0.0" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/template": "^7.24.7" } }, - "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "@babel/plugin-transform-destructuring": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.7.tgz", + "integrity": "sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==", "dev": true, - "engines": { - "node": ">=14.0.0" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "@babel/plugin-transform-dotall-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", + "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "@babel/plugin-transform-duplicate-keys": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", + "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/totalist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "@babel/plugin-transform-dynamic-import": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", + "integrity": "sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==", "dev": true, - "engines": { - "node": ">=6" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" } }, - "node_modules/ts-morph": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", - "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", + "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", "dev": true, - "dependencies": { - "@ts-morph/common": "~0.23.0", - "code-block-writer": "^13.0.1" + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "@babel/plugin-transform-export-namespace-from": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz", + "integrity": "sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" } }, - "node_modules/type-fest": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", - "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", + "@babel/plugin-transform-for-of": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", + "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" } }, - "node_modules/typedoc": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", - "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", + "@babel/plugin-transform-function-name": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.7.tgz", + "integrity": "sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==", "dev": true, - "dependencies": { - "lunr": "^2.3.9", - "marked": "^4.3.0", - "minimatch": "^9.0.3", - "shiki": "^0.14.7" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 16" - }, - "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" + "requires": { + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "@babel/plugin-transform-json-strings": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz", + "integrity": "sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==", "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-json-strings": "^7.8.3" } }, - "node_modules/ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", - "dev": true + "@babel/plugin-transform-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz", + "integrity": "sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" + } }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "@babel/plugin-transform-logical-assignment-operators": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz", + "integrity": "sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==", "dev": true, - "engines": { - "node": ">= 10.0.0" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" } }, - "node_modules/upath": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "@babel/plugin-transform-member-expression-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", + "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", "dev": true, - "engines": { - "node": ">=4", - "yarn": "*" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/vite": { - "version": "5.2.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", - "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", + "@babel/plugin-transform-modules-amd": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", + "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", "dev": true, - "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", - "rollup": "^4.13.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } + "requires": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.7.tgz", + "integrity": "sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7" } }, - "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "@babel/plugin-transform-modules-systemjs": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.7.tgz", + "integrity": "sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw==", "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "requires": { + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7" } }, - "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", - "cpu": [ - "arm" - ], + "@babel/plugin-transform-modules-umd": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", + "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" + "requires": { + "@babel/helper-module-transforms": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", - "cpu": [ - "loong64" - ], + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", + "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/vite/node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "@babel/plugin-transform-new-target": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", + "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz", + "integrity": "sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==", "dev": true, - "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", - "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true + "@babel/plugin-transform-numeric-separator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz", + "integrity": "sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true + "@babel/plugin-transform-object-rest-spread": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.7.tgz", + "integrity": "sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.24.7" + } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "@babel/plugin-transform-object-super": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", + "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-replace-supers": "^7.24.7" } }, - "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "@babel/plugin-transform-optional-catch-binding": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz", + "integrity": "sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==", "dev": true, - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" } }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "@babel/plugin-transform-optional-chaining": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.7.tgz", + "integrity": "sha512-tK+0N9yd4j+x/4hxF3F0e0fu/VdcxU18y5SevtyM/PCFlQvXbR0Zmlo2eBrKtVipGNFzpq56o8WsIIKcJFUCRQ==", "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "@babel/plugin-transform-parameters": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", + "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "@babel/plugin-transform-private-methods": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.7.tgz", + "integrity": "sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "@babel/plugin-transform-private-property-in-object": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz", + "integrity": "sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" } }, - "node_modules/wrap-ansi-cjs/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "@babel/plugin-transform-property-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", + "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", + "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "regenerator-transform": "^0.15.2" } }, - "node_modules/wrap-ansi-cjs/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "@babel/plugin-transform-reserved-words": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", + "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" + } }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "@babel/plugin-transform-shorthand-properties": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", + "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "@babel/plugin-transform-spread": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", + "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "@babel/plugin-transform-sticky-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", + "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "@babel/plugin-transform-template-literals": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", + "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" + } }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "@babel/plugin-transform-typeof-symbol": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.7.tgz", + "integrity": "sha512-VtR8hDy7YLB7+Pet9IarXjg/zgCMSF+1mNS/EQEiEaUPoFXCVsHG64SIxcaaI2zJgRiv+YmgaQESUfWAdbjzgg==", "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-plugin-utils": "^7.24.7" } - } - }, - "dependencies": { - "@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", + "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "@babel/helper-plugin-utils": "^7.24.7" } }, - "@babel/code-frame": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", - "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "@babel/plugin-transform-unicode-property-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz", + "integrity": "sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==", "dev": true, - "optional": true, "requires": { - "@babel/highlight": "^7.24.6", - "picocolors": "^1.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" } }, - "@babel/helper-string-parser": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", - "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", - "dev": true + "@babel/plugin-transform-unicode-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", + "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + } }, - "@babel/helper-validator-identifier": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", - "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", - "dev": true + "@babel/plugin-transform-unicode-sets-regex": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.7.tgz", + "integrity": "sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7" + } }, - "@babel/highlight": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", - "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "@babel/preset-env": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.7.tgz", + "integrity": "sha512-1YZNsc+y6cTvWlDHidMBsQZrZfEFjRIo/BZCT906PMdzOyXtSLTgqGdrpcuTDCXyd11Am5uQULtDIcCfnTc8fQ==", "dev": true, - "optional": true, "requires": { - "@babel/helper-validator-identifier": "^7.24.6", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/compat-data": "^7.24.7", + "@babel/helper-compilation-targets": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-validator-option": "^7.24.7", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.7", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.24.7", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.24.7", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoped-functions": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.24.7", + "@babel/plugin-transform-class-properties": "^7.24.7", + "@babel/plugin-transform-class-static-block": "^7.24.7", + "@babel/plugin-transform-classes": "^7.24.7", + "@babel/plugin-transform-computed-properties": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.7", + "@babel/plugin-transform-dotall-regex": "^7.24.7", + "@babel/plugin-transform-duplicate-keys": "^7.24.7", + "@babel/plugin-transform-dynamic-import": "^7.24.7", + "@babel/plugin-transform-exponentiation-operator": "^7.24.7", + "@babel/plugin-transform-export-namespace-from": "^7.24.7", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.24.7", + "@babel/plugin-transform-json-strings": "^7.24.7", + "@babel/plugin-transform-literals": "^7.24.7", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", + "@babel/plugin-transform-member-expression-literals": "^7.24.7", + "@babel/plugin-transform-modules-amd": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.7", + "@babel/plugin-transform-modules-systemjs": "^7.24.7", + "@babel/plugin-transform-modules-umd": "^7.24.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-new-target": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-numeric-separator": "^7.24.7", + "@babel/plugin-transform-object-rest-spread": "^7.24.7", + "@babel/plugin-transform-object-super": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.7", + "@babel/plugin-transform-parameters": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-property-literals": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-reserved-words": "^7.24.7", + "@babel/plugin-transform-shorthand-properties": "^7.24.7", + "@babel/plugin-transform-spread": "^7.24.7", + "@babel/plugin-transform-sticky-regex": "^7.24.7", + "@babel/plugin-transform-template-literals": "^7.24.7", + "@babel/plugin-transform-typeof-symbol": "^7.24.7", + "@babel/plugin-transform-unicode-escapes": "^7.24.7", + "@babel/plugin-transform-unicode-property-regex": "^7.24.7", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.24.7", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.4", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.31.0", + "semver": "^6.3.1" }, "dependencies": { - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "optional": true + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true } } }, - "@babel/parser": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.6.tgz", - "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", "dev": true }, + "@babel/runtime": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "@babel/template": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", + "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7" + } + }, + "@babel/traverse": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", + "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.7", + "@babel/helper-environment-visitor": "^7.24.7", + "@babel/helper-function-name": "^7.24.7", + "@babel/helper-hoist-variables": "^7.24.7", + "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/parser": "^7.24.7", + "@babel/types": "^7.24.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + } + }, "@babel/types": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.6.tgz", - "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.24.6", - "@babel/helper-validator-identifier": "^7.24.6", + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" } }, @@ -4280,6 +7553,35 @@ "slash": "^4.0.0" } }, + "@rollup/plugin-babel": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", + "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.18.6", + "@rollup/pluginutils": "^5.0.1" + } + }, + "@rollup/pluginutils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "dependencies": { + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + } + } + }, "@rollup/rollup-android-arm-eabi": { "version": "4.18.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", @@ -4680,6 +7982,44 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "babel-plugin-polyfill-corejs2": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", + "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.2", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "babel-plugin-polyfill-corejs3": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", + "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.6.1", + "core-js-compat": "^3.36.1" + } + }, + "babel-plugin-polyfill-regenerator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz", + "integrity": "sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.6.2" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -4710,12 +8050,30 @@ "fill-range": "^7.1.1" } }, + "browserslist": { + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.16" + } + }, "cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true }, + "caniuse-lite": { + "version": "1.0.30001634", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001634.tgz", + "integrity": "sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==", + "dev": true + }, "chai": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", @@ -4736,7 +8094,6 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "optional": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -4748,7 +8105,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "optional": true, "requires": { "color-convert": "^1.9.0" } @@ -4804,7 +8160,6 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "optional": true, "requires": { "color-name": "1.1.3" } @@ -4813,8 +8168,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "optional": true + "dev": true }, "comment-parser": { "version": "1.4.1", @@ -4834,6 +8188,21 @@ "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", "dev": true }, + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "core-js-compat": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "dev": true, + "requires": { + "browserslist": "^4.23.0" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -4937,6 +8306,12 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "electron-to-chromium": { + "version": "1.4.803", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.803.tgz", + "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", + "dev": true + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -5135,12 +8510,17 @@ } } }, + "escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "optional": true + "dev": true }, "esquery": { "version": "1.5.0", @@ -5166,6 +8546,12 @@ "@types/estree": "^1.0.0" } }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -5260,6 +8646,18 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, "get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -5300,6 +8698,12 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -5310,8 +8714,16 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, - "optional": true + "requires": { + "function-bind": "^1.1.2" + } }, "html-escaper": { "version": "2.0.2", @@ -5359,6 +8771,15 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -5475,6 +8896,18 @@ "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", "dev": true }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true + }, "jsonc-parser": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", @@ -5501,6 +8934,12 @@ "pkg-types": "^1.0.3" } }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true + }, "loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -5642,6 +9081,12 @@ "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true }, + "node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, "npm-run-path": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", @@ -5732,6 +9177,12 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", @@ -5817,6 +9268,78 @@ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", + "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", + "dev": true, + "requires": { + "regenerate": "^1.4.2" + } + }, + "regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "regenerator-transform": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + }, + "regexpu-core": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "dev": true, + "requires": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + } + }, + "regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true + } + } + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -6054,11 +9577,16 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, - "optional": true, "requires": { "has-flag": "^3.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -6190,6 +9718,34 @@ "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", "dev": true }, + "unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "dev": true + }, "universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -6202,6 +9758,16 @@ "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", "dev": true }, + "update-browserslist-db": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "dev": true, + "requires": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + } + }, "vite": { "version": "5.2.11", "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", @@ -6427,6 +9993,12 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", diff --git a/package.json b/package.json index d9355541..a3fb347b 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "#gl-matrix/swizzle": "./src/swizzle/index.ts", "#gl-matrix/swizzle/f64": "./src/swizzle/f64/index.ts", "#gl-matrix/types": "./src/types/index.ts", + "#gl-matrix/types/swizzle": "./src/types/swizzle/index.ts", + "#gl-matrix/types/swizzle/f64": "./src/types/swizzle/f64/index.ts", "#gl-matrix/util": "./src/util/index.ts" }, "exports": { @@ -68,6 +70,8 @@ "require": "./dist/util/index.cjs" } }, + "main": "./dist-cdn/esm/2022/gl-matrix-f32.min.js", + "types": "./dist-cdn/types/gl-matrix-f32.d.mts", "homepage": "https://glmatrix.net", "bugs": { "url": "https://github.com/toji/gl-matrix/issues" @@ -87,7 +91,8 @@ } ], "files": [ - "/dist" + "/dist", + "/dist-cdn" ], "keywords": [ "vector", @@ -97,21 +102,26 @@ "webgpu" ], "scripts": { - "build": "npm run gen64 && tsc --project tsconfig-build.json && node scripts/bundle.js", - "build-all": "npm run build && npm run types && npm run docs", + "build": "npm run gen64 && tsc --project tsconfig-build.json && node scripts/bundle/bundle.js", + "build-all": "npm run build && npm run types && npm run docs && npm run docs-cdn", "docs": "typedoc-pkg --api-link es", + "docs-cdn": "typedoc-pkg --api-link es --path dist-cdn/types/gl-matrix-f32.d.mts:dist-cdn/types/gl-matrix-f64.d.mts --output docs/cdn --typedoc typedoc-cdn.json", "gen64": "node scripts/gen-f64.js", "test": "vitest run", "test-ui": "vitest --ui --coverage", "types": "esm-d-ts gen -c" }, "devDependencies": { + "@babel/core": "^7.24.7", + "@babel/preset-env": "^7.24.7", + "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", "@typhonjs-utils/file-util": "^0.1.0", "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.6.0", "esbuild": "^0.21.0", + "rollup": "^4.18.0", "typedoc": "0.25.12", "typescript": "^5.4.0", "vitest": "^1.6.0" diff --git a/scripts/bundle.js b/scripts/bundle.js deleted file mode 100644 index 25eb2f5d..00000000 --- a/scripts/bundle.js +++ /dev/null @@ -1,157 +0,0 @@ -import * as esbuild from 'esbuild'; -import * as fs from 'fs'; -import { getFileList } from '@typhonjs-utils/file-util'; - -const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); - -// ESBuild data ------------------------------------------------------------------------------------------------------ - -const banner = { js: `// glMatrix - v${pkg.version}` }; - -// Add the `package.json` imports as external for ESBuild removing the leading `#`. -const external = Object.keys(pkg.imports ?? {}).map((key) => key.slice(1)); - -// Rewrite `imports` from `package.json` with actual main / sub-path export path. ------------------------------------ - -// Retrieve a list of all `*.js` files from `./dist` and subdirectories. -const list = await getFileList({ dir: './dist', includeFile: /\.js$/, walk: true }); - -// Replace all instances of `#gl-matrix` with `gl-matrix` and add leading banner. -for (const file of list) { - const filepath = `./dist/${file}`; - let srcFile = fs.readFileSync(filepath, 'utf8'); - srcFile = srcFile.replaceAll('#gl-matrix', 'gl-matrix'); - fs.writeFileSync(filepath, `${banner.js}\n${srcFile}`); -} - -// Common JS Bundles ------------------------------------------------------------------------------------------------- - -// `gl-matrix/classic` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/classic/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/classic/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/common` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/common/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/common/index.cjs', -}).catch(() => process.exit(1)); - -// Main `gl-matrix` export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/f64` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/f64/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/f64/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/swizzle` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/swizzle/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/swizzle/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/swizzle/f64` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/swizzle/f64/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/swizzle/f64/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/types` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/types/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/types/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/types/swizzle` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/types/swizzle/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/types/swizzle/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/types/swizzle/f64` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/types/swizzle/f64/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/types/swizzle/f64/index.cjs', -}).catch(() => process.exit(1)); - -// `gl-matrix/util` sub-path export. -esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/util/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/util/index.cjs', -}).catch(() => process.exit(1)); diff --git a/scripts/bundle/bundle.js b/scripts/bundle/bundle.js new file mode 100644 index 00000000..0935100e --- /dev/null +++ b/scripts/bundle/bundle.js @@ -0,0 +1,368 @@ +import * as esbuild from 'esbuild'; +import * as fs from 'fs'; +import { rollup } from 'rollup'; +import { babel } from '@rollup/plugin-babel'; +import { getFileList } from '@typhonjs-utils/file-util'; + +const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + +// ESBuild data ------------------------------------------------------------------------------------------------------ + +const banner = { js: `// glMatrix - v${pkg.version}` }; + +// Add the `package.json` imports as external for ESBuild removing the leading `#`. +const external = Object.keys(pkg.imports ?? {}).map((key) => key.slice(1)); + +// Rewrite `imports` from `package.json` with actual main / sub-path export path. ------------------------------------ + +// Retrieve a list of all `*.js` files from `./dist` and subdirectories. +const list = await getFileList({ dir: './dist', includeFile: /\.js$/, walk: true }); + +// Replace all instances of `#gl-matrix` with `gl-matrix` and add leading banner. +for (const file of list) { + const filepath = `./dist/${file}`; + let srcFile = fs.readFileSync(filepath, 'utf8'); + srcFile = srcFile.replaceAll('#gl-matrix', 'gl-matrix'); + fs.writeFileSync(filepath, `${banner.js}\n${srcFile}`); +} + +// Common JS Bundles ------------------------------------------------------------------------------------------------- + +try { + const promises = []; + + // `gl-matrix/classic` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/classic/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/classic/index.cjs', + })); + + // `gl-matrix/common` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/common/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/common/index.cjs', + })); + + // Main `gl-matrix` export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/index.cjs', + })); + + // `gl-matrix/f64` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/f64/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/f64/index.cjs', + })); + + // `gl-matrix/swizzle` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/swizzle/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/swizzle/index.cjs', + })); + + // `gl-matrix/swizzle/f64` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/swizzle/f64/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/swizzle/f64/index.cjs', + })); + + // `gl-matrix/types` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/types/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/types/index.cjs', + })); + + // `gl-matrix/types/swizzle` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/types/swizzle/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/types/swizzle/index.cjs', + })); + + // `gl-matrix/types/swizzle/f64` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/types/swizzle/f64/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/types/swizzle/f64/index.cjs', + })); + + // `gl-matrix/util` sub-path export. + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['dist/util/index.js'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'cjs', + external, + outfile: 'dist/util/index.cjs', + })); + +// CDN ESM Bundles --------------------------------------------------------------------------------------------------- + +// ESM 2022 ------------------------------------------ + + // 2022 Standard Release (Float32) + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2022/gl-matrix-f32.js', + })); + + // 2022 Standard Release (Float32) Minified + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], + bundle: true, + minify: true, + sourcemap: true, + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2022/gl-matrix-f32.min.js', + })); + + // 2022 Standard Release (Float64) + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2022/gl-matrix-f64.js', + })); + + // 2022 Standard Release (Float64) Minified + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], + bundle: true, + minify: true, + sourcemap: true, + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2022/gl-matrix-f64.min.js', + })); + +// ESM 2016 / ES6 ------------------------------------ + + // ES6 Standard Release (Float32) + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], + bundle: true, + minify: false, + sourcemap: true, + target: 'es2016', + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2016/gl-matrix-f32.js', + })); + + // ES6 Standard Release (Float32) Minified + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], + bundle: true, + minify: true, + sourcemap: true, + target: 'es2016', + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2016/gl-matrix-f32.min.js', + })); + + // ES6 Standard Release (Float64) + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], + bundle: true, + minify: false, + sourcemap: true, + target: 'es2016', + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2016/gl-matrix-f64.js', + })); + + // ES6 Standard Release (Float64) Minified + promises.push(esbuild.build({ + logLevel: 'info', + entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], + bundle: true, + minify: true, + sourcemap: true, + target: 'es2016', + banner, + format: 'esm', + outfile: 'dist-cdn/esm/2016/gl-matrix-f64.min.js', + })); + + await Promise.allSettled(promises); + +// Generate UMD bundles with Rollup ------------------ + + const rollupConfigs = [ + // ES5 / UMD CDN Release (Float32) + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f32.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner, + file: 'dist-cdn/umd/gl-matrix-f32.cjs', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrix', + sourcemap: true + } + }, + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f32.min.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner, + file: 'dist-cdn/umd/gl-matrix-f32.min.cjs', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrix', + sourcemap: true + } + }, + + // ES5 / UMD CDN Release (Float64) + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f64.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner, + file: 'dist-cdn/umd/gl-matrix-f64.cjs', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrix', + sourcemap: true + } + }, + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f64.min.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner, + file: 'dist-cdn/umd/gl-matrix-f64.min.cjs', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrix', + sourcemap: true + } + } + ]; + + for (const config of rollupConfigs) { + console.log(`Generating UMD bundle: ${config.input.input}`); + + const bundle = await rollup(config.input); + await bundle.write(config.output); + await bundle.close(); + } +} +catch(err) { + console.error(err); + process.exit(1); +} + diff --git a/scripts/bundle/cdn-entry-f32.ts b/scripts/bundle/cdn-entry-f32.ts new file mode 100644 index 00000000..3bc02293 --- /dev/null +++ b/scripts/bundle/cdn-entry-f32.ts @@ -0,0 +1,12 @@ +/** + * Provides an all-inclusive ESM distribution of `gl-matrix` (32-bit). All library classes extends `Float32Array`. + * + * @packageDocumentation + */ + +export * from '#gl-matrix'; +export * from '#gl-matrix/classic'; +export * from '#gl-matrix/swizzle'; +export * from '#gl-matrix/types'; +export * from '#gl-matrix/types/swizzle'; +export * from '#gl-matrix/util'; diff --git a/scripts/bundle/cdn-entry-f64.ts b/scripts/bundle/cdn-entry-f64.ts new file mode 100644 index 00000000..7e312a64 --- /dev/null +++ b/scripts/bundle/cdn-entry-f64.ts @@ -0,0 +1,11 @@ +/** + * Provides an all-inclusive ESM distribution of `gl-matrix` (64-bit). All library classes extends `Float64Array`. + * + * @packageDocumentation + */ + +export * from '#gl-matrix/f64'; +export * from '#gl-matrix/swizzle/f64'; +export * from '#gl-matrix/types'; +export * from '#gl-matrix/types/swizzle/f64'; +export * from '#gl-matrix/util'; From 0a7e6b243efd40dee4f7ff37b4fec4a8c75583c5 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sat, 15 Jun 2024 22:55:06 -0700 Subject: [PATCH 05/16] Added CDN bundles. --- dist-cdn/umd/gl-matrix-f32.cjs | 2 +- dist-cdn/umd/gl-matrix-f32.min.cjs | 2 +- dist-cdn/umd/gl-matrix-f64.cjs | 2 +- dist-cdn/umd/gl-matrix-f64.min.cjs | 2 +- scripts/bundle/bundle.js | 12 +++++++----- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dist-cdn/umd/gl-matrix-f32.cjs b/dist-cdn/umd/gl-matrix-f32.cjs index 4a3585ba..8f950329 100644 --- a/dist-cdn/umd/gl-matrix-f32.cjs +++ b/dist-cdn/umd/gl-matrix-f32.cjs @@ -1,4 +1,4 @@ -[object Object] +// glMatrix - v4.0.0-beta.3 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : diff --git a/dist-cdn/umd/gl-matrix-f32.min.cjs b/dist-cdn/umd/gl-matrix-f32.min.cjs index 29b5295a..22b9355d 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.cjs +++ b/dist-cdn/umd/gl-matrix-f32.min.cjs @@ -1,4 +1,4 @@ -[object Object] +// glMatrix - v4.0.0-beta.3 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : diff --git a/dist-cdn/umd/gl-matrix-f64.cjs b/dist-cdn/umd/gl-matrix-f64.cjs index 5c2d4b4b..bea9c26d 100644 --- a/dist-cdn/umd/gl-matrix-f64.cjs +++ b/dist-cdn/umd/gl-matrix-f64.cjs @@ -1,4 +1,4 @@ -[object Object] +// glMatrix - v4.0.0-beta.3 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : diff --git a/dist-cdn/umd/gl-matrix-f64.min.cjs b/dist-cdn/umd/gl-matrix-f64.min.cjs index 3372d6f2..3486cde0 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.cjs +++ b/dist-cdn/umd/gl-matrix-f64.min.cjs @@ -1,4 +1,4 @@ -[object Object] +// glMatrix - v4.0.0-beta.3 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : diff --git a/scripts/bundle/bundle.js b/scripts/bundle/bundle.js index 0935100e..aa92d23f 100644 --- a/scripts/bundle/bundle.js +++ b/scripts/bundle/bundle.js @@ -8,7 +8,9 @@ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); // ESBuild data ------------------------------------------------------------------------------------------------------ -const banner = { js: `// glMatrix - v${pkg.version}` }; +const bannerText = `// glMatrix - v${pkg.version}`; + +const banner = { js: bannerText }; // Add the `package.json` imports as external for ESBuild removing the leading `#`. const external = Object.keys(pkg.imports ?? {}).map((key) => key.slice(1)); @@ -284,7 +286,7 @@ try { ] }, output: { - banner, + banner: bannerText, file: 'dist-cdn/umd/gl-matrix-f32.cjs', format: 'umd', generatedCode: 'es5', @@ -303,7 +305,7 @@ try { ] }, output: { - banner, + banner: bannerText, file: 'dist-cdn/umd/gl-matrix-f32.min.cjs', format: 'umd', generatedCode: 'es5', @@ -324,7 +326,7 @@ try { ] }, output: { - banner, + banner: bannerText, file: 'dist-cdn/umd/gl-matrix-f64.cjs', format: 'umd', generatedCode: 'es5', @@ -343,7 +345,7 @@ try { ] }, output: { - banner, + banner: bannerText, file: 'dist-cdn/umd/gl-matrix-f64.min.cjs', format: 'umd', generatedCode: 'es5', From aef988b7a424e0aa2338c977ec936af82bebcee0 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sat, 22 Jun 2024 16:29:16 -0700 Subject: [PATCH 06/16] CDN Bundles / Types / Build Upgrade --- .gitignore | 1 + README-CDN.md | 29 + README.md | 2 + dist-cdn/esm/2016/gl-matrix-f32.js | 5 +- dist-cdn/esm/2016/gl-matrix-f32.js.map | 2 +- dist-cdn/esm/2016/gl-matrix-f32.min.js | 5 +- dist-cdn/esm/2016/gl-matrix-f32.min.js.map | 2 +- dist-cdn/esm/2016/gl-matrix-f64.js | 5 +- dist-cdn/esm/2016/gl-matrix-f64.js.map | 2 +- dist-cdn/esm/2016/gl-matrix-f64.min.js | 5 +- dist-cdn/esm/2016/gl-matrix-f64.min.js.map | 2 +- dist-cdn/esm/2022/gl-matrix-f32.js | 5 +- dist-cdn/esm/2022/gl-matrix-f32.js.map | 2 +- dist-cdn/esm/2022/gl-matrix-f32.min.js | 5 +- dist-cdn/esm/2022/gl-matrix-f32.min.js.map | 2 +- dist-cdn/esm/2022/gl-matrix-f64.js | 5 +- dist-cdn/esm/2022/gl-matrix-f64.js.map | 2 +- dist-cdn/esm/2022/gl-matrix-f64.min.js | 5 +- dist-cdn/esm/2022/gl-matrix-f64.min.js.map | 2 +- dist-cdn/types/gl-matrix-f32.d.mts | 9651 ++++++++--------- dist-cdn/types/gl-matrix-f64.d.mts | 9651 ++++++++--------- dist-cdn/types/globals-f32.d.mts | 7 + dist-cdn/types/globals-f64.d.mts | 7 + dist-cdn/types/index.cjs | 18 + dist-cdn/types/index.js | 1 + dist-cdn/umd/gl-matrix-f32.cjs.map | 1 - .../{gl-matrix-f32.cjs => gl-matrix-f32.js} | 12 +- dist-cdn/umd/gl-matrix-f32.js.map | 1 + dist-cdn/umd/gl-matrix-f32.min.cjs.map | 1 - ...atrix-f32.min.cjs => gl-matrix-f32.min.js} | 12 +- dist-cdn/umd/gl-matrix-f32.min.js.map | 1 + dist-cdn/umd/gl-matrix-f64.cjs.map | 1 - .../{gl-matrix-f64.cjs => gl-matrix-f64.js} | 14 +- dist-cdn/umd/gl-matrix-f64.js.map | 1 + dist-cdn/umd/gl-matrix-f64.min.cjs.map | 1 - ...atrix-f64.min.cjs => gl-matrix-f64.min.js} | 14 +- dist-cdn/umd/gl-matrix-f64.min.js.map | 1 + esm-d-ts.config.js | 8 +- package-lock.json | 5015 +-------- package.json | 26 +- scripts/build.js | 214 + scripts/bundle/bundle.js | 370 - .../cdn-entry-f64.ts => src/cdn/f64/index.ts | 1 + .../cdn-entry-f32.ts => src/cdn/index.ts | 1 + tests/{ => other}/classic-api.spec.ts | 0 tsconfig-build.json | 7 - tsconfig.json | 9 +- typedoc-cdn.json | 33 + typedoc.json | 6 + 49 files changed, 10383 insertions(+), 14790 deletions(-) create mode 100644 README-CDN.md create mode 100644 dist-cdn/types/globals-f32.d.mts create mode 100644 dist-cdn/types/globals-f64.d.mts create mode 100644 dist-cdn/types/index.cjs create mode 100644 dist-cdn/types/index.js delete mode 100644 dist-cdn/umd/gl-matrix-f32.cjs.map rename dist-cdn/umd/{gl-matrix-f32.cjs => gl-matrix-f32.js} (99%) create mode 100644 dist-cdn/umd/gl-matrix-f32.js.map delete mode 100644 dist-cdn/umd/gl-matrix-f32.min.cjs.map rename dist-cdn/umd/{gl-matrix-f32.min.cjs => gl-matrix-f32.min.js} (99%) create mode 100644 dist-cdn/umd/gl-matrix-f32.min.js.map delete mode 100644 dist-cdn/umd/gl-matrix-f64.cjs.map rename dist-cdn/umd/{gl-matrix-f64.cjs => gl-matrix-f64.js} (99%) create mode 100644 dist-cdn/umd/gl-matrix-f64.js.map delete mode 100644 dist-cdn/umd/gl-matrix-f64.min.cjs.map rename dist-cdn/umd/{gl-matrix-f64.min.cjs => gl-matrix-f64.min.js} (99%) create mode 100644 dist-cdn/umd/gl-matrix-f64.min.js.map create mode 100644 scripts/build.js delete mode 100644 scripts/bundle/bundle.js rename scripts/bundle/cdn-entry-f64.ts => src/cdn/f64/index.ts (93%) rename scripts/bundle/cdn-entry-f32.ts => src/cdn/index.ts (94%) rename tests/{ => other}/classic-api.spec.ts (100%) delete mode 100644 tsconfig-build.json create mode 100644 typedoc-cdn.json diff --git a/.gitignore b/.gitignore index 517f95a3..a2ddf93a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .DS_Store npm-debug.log /.dts +/.vscode /coverage /dist /docs diff --git a/README-CDN.md b/README-CDN.md new file mode 100644 index 00000000..a7f22dd5 --- /dev/null +++ b/README-CDN.md @@ -0,0 +1,29 @@ +[![NPM Version](https://img.shields.io/npm/v/gl-matrix.svg)](https://www.npmjs.com/package/gl-matrix) +[![License](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat)](https://github.com/typhonjs-svelte/trie-search/blob/main/LICENSE) +[![Build Status](https://github.com/toji/gl-matrix/workflows/CI/CD/badge.svg)](#) +[![Coverage](https://img.shields.io/codecov/c/github/toji/gl-matrix.svg)](https://codecov.io/github/toji/gl-matrix) +[![API Docs](https://img.shields.io/badge/API%20Documentation-476ff0)](https://glmatrix.net/docs/v4/) + +`gl-matrix` is a versatile and high-performance JavaScript / TypeScript library for vector and matrix operations, +optimized for real-time 3D graphics APIs such as WebGL and WebGPU. + +This documentation resource separates the CDN / pre-built distribution resources from the main Node distribution API +documentation. Additional, information regarding using `gl-matrix` with modern ESM CDNs and capabilities such as +[import maps](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) and enabling type +declarations when developing web apps with the CDN resources is forthcoming, so stay tuned as these docs will be updated +in the next beta release. + +--- + +There are multiple distribution methods to utilize `gl-matrix` from legacy module systems like +[RequireJS](https://requirejs.org/) to modern ES Module (ESM) oriented CDNs. If you are not using Node / NPM and +bundling `gl-matrix` directly into your project / product various pre-built versions are available on most CDNs that +automatically make NPM package available for consumption online in a web application deployment. + +Pre-built ESM and ES5 / UMD bundles are available in the `/dist-cdn` directory checked into the `gl-matrix` repo. +The `gl-matrix/cdn` and `gl-matrix/cdn/f64` exports are linked to the types and pre-built all-inclusive CDN ESM +bundles. `gl-matrix/types/cdn/umd` and `gl-matrix/types/cdn/umd/64` provide type declarations for the UMD bundles when +used as an `IIFE`. + + + diff --git a/README.md b/README.md index 2ed19472..5045e12c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [![NPM Version](https://img.shields.io/npm/v/gl-matrix.svg)](https://www.npmjs.com/package/gl-matrix) [![License](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat)](https://github.com/typhonjs-svelte/trie-search/blob/main/LICENSE) +[![Build Status](https://github.com/toji/gl-matrix/workflows/CI/CD/badge.svg)](#) +[![Coverage](https://img.shields.io/codecov/c/github/toji/gl-matrix.svg)](https://codecov.io/github/toji/gl-matrix) [![API Docs](https://img.shields.io/badge/API%20Documentation-476ff0)](https://glmatrix.net/docs/v4/) `gl-matrix` is a versatile and high-performance JavaScript / TypeScript library for vector and matrix operations, diff --git a/dist-cdn/esm/2016/gl-matrix-f32.js b/dist-cdn/esm/2016/gl-matrix-f32.js index 6c393051..00973f50 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.js +++ b/dist-cdn/esm/2016/gl-matrix-f32.js @@ -1,4 +1,7 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var __typeError = (msg) => { throw TypeError(msg); }; diff --git a/dist-cdn/esm/2016/gl-matrix-f32.js.map b/dist-cdn/esm/2016/gl-matrix-f32.js.map index 63bac3da..c0de8185 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f32.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;;;;;;AASO,IAAM,cAAsB;;;ACTnC;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GA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WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC1HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": ["_TMP_VEC3", "_TMP_VEC3"] } diff --git a/dist-cdn/esm/2016/gl-matrix-f32.min.js b/dist-cdn/esm/2016/gl-matrix-f32.min.js index 7f94d32c..fdf1393c 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.min.js +++ b/dist-cdn/esm/2016/gl-matrix-f32.min.js @@ -1,3 +1,6 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(xe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(r*F-s*P-a*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(M*g-l*S-h*z)*Q,e[4]=(y*p-i*P-L*N)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(m*R-b*S-x*o)*Q,e[7]=(k*S-M*R+h*o)*Q,e[8]=(i*F-c*p+L*B)*Q,e[9]=(s*p-n*F-a*B)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*N-i*Y-y*B)*Q,e[13]=(n*Y-s*N+r*B)*Q,e[14]=(d*o-b*z-m*V)*Q,e[15]=(k*z-l*o+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m;return e[0]=c*P-y*F+L*Y,e[1]=r*F-s*P-a*Y,e[2]=d*S-m*g+x*z,e[3]=M*g-l*S-h*z,e[4]=y*p-i*P-L*N,e[5]=n*P-r*p+a*N,e[6]=m*R-b*S-x*o,e[7]=k*S-M*R+h*o,e[8]=i*F-c*p+L*B,e[9]=s*p-n*F-a*B,e[10]=b*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-i*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-b*z-m*V,e[15]=k*z-l*o+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],x=t*i-n*a,V=t*c-s*a,o=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,S=t*g-n*z+s*R,B=a*g-i*z+c*R,N=L*o-k*V+l*x,p=h*o-b*V+d*x;return y*S-r*B+m*N-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4}; //# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f32.min.js.map b/dist-cdn/esm/2016/gl-matrix-f32.min.js.map index f8a4bec9..4738df8f 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.min.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f32.min.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";sQAAA,IAAAA,GAOaC,EAAN,M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GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", "names": ["_IDENTITY_2X2", "_Mat2", "values", "v", "__privateGet", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "__privateAdd", "Mat2", "_IDENTITY_2X3", "_Mat2d", "values", "v", "__privateGet", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "__privateAdd", "Mat2d", "_IDENTITY_3X3", "_Mat3", "values", "v", "__privateGet", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "__privateAdd", "Mat3", "_IDENTITY_4X4", "_TMP_VEC3", "_Mat4", "values", "v", "__privateGet", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "__privateAdd", "Mat4", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "_DEFAULT_ANGLE_ORDER", "_TMP_QUAT1", "_TMP_QUAT2", "_TMP_MAT3", "_TMP_VEC3", "_X_UNIT_VEC3", "_Y_UNIT_VEC3", "_Quat", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "__privateGet", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "__privateAdd", "Quat", "Vec4", "_TMP_QUAT", "_TMP_VEC3", "_Quat2", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "__privateGet", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "__privateAdd", "Quat2", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/esm/2016/gl-matrix-f64.js b/dist-cdn/esm/2016/gl-matrix-f64.js index f665b3ef..82410d39 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.js +++ b/dist-cdn/esm/2016/gl-matrix-f64.js @@ -1,4 +1,7 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var __typeError = (msg) => { throw TypeError(msg); }; diff --git a/dist-cdn/esm/2016/gl-matrix-f64.js.map b/dist-cdn/esm/2016/gl-matrix-f64.js.map index f778c8b5..a5b2ab40 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f64.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;;;;;;AASO,IAAM,cAAsB;;;ACTnC;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GAAsB,GAAG,CAAC;AAAA,QAClC;AACA;AAAA,MACF;AACE,cAAM,oBAAK,cAAa;AAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,IAAI,MAAc;AAChB,WAAO,MAAK,IAAI,IAAI;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAK,GAA6B;AAChC,SAAK,IAAI,CAAC;AACV,WA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O,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC3HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": ["_TMP_VEC3", "_TMP_VEC3"] } diff --git a/dist-cdn/esm/2016/gl-matrix-f64.min.js b/dist-cdn/esm/2016/gl-matrix-f64.min.js index 61d1fdb5..a2f8bc4b 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.min.js +++ b/dist-cdn/esm/2016/gl-matrix-f64.min.js @@ -1,3 +1,6 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(xe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-i*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(b*g-l*S-h*z)*Q,e[4]=(y*p-a*P-L*N)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(m*R-M*S-x*o)*Q,e[7]=(k*S-b*R+h*o)*Q,e[8]=(a*I-c*p+L*B)*Q,e[9]=(s*p-n*I-i*B)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*N-a*Y-y*B)*Q,e[13]=(n*Y-s*N+r*B)*Q,e[14]=(d*o-M*z-m*V)*Q,e[15]=(k*z-l*o+b*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-i*Y,e[2]=d*S-m*g+x*z,e[3]=b*g-l*S-h*z,e[4]=y*p-a*P-L*N,e[5]=n*P-r*p+i*N,e[6]=m*R-M*S-x*o,e[7]=k*S-b*R+h*o,e[8]=a*I-c*p+L*B,e[9]=s*p-n*I-i*B,e[10]=M*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-a*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-M*z-m*V,e[15]=k*z-l*o+b*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],b=e[11],h=e[12],M=e[13],d=e[14],m=e[15],x=t*a-n*i,V=t*c-s*i,o=n*c-s*a,R=L*M-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,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):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case"xzy":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case"yxz":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case"yzx":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case"zxy":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case"zyx":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(", ")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian}; //# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f64.min.js.map b/dist-cdn/esm/2016/gl-matrix-f64.min.js.map index 157a0472..fb6293b8 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.min.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f64.min.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";sQAAA,IAAAA,GAOaC,EAAN,MAAMA,UAAa,YAAa,CAWrC,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMC,EAAAH,EAAKD,GAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOC,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAID,EAAAH,EAAKD,GAAa,EACpB,IACT,CAUA,SAASM,EAA6B,CACpC,OAAOL,EAAK,SAAS,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QAAWA,KAAWL,EAAe,CACnC,IAAMS,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeC,EAAK,UAAWD,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeF,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,GAA2B,EAC7B,CC3HA,IAAMY,GAAyB,KAAK,GAAK,IAKnCC,GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", "names": ["_IDENTITY_2X2", "_Mat2", "values", "v", "__privateGet", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "__privateAdd", "Mat2", "_IDENTITY_2X3", "_Mat2d", "values", "v", "__privateGet", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "__privateAdd", "Mat2d", "_IDENTITY_3X3", "_Mat3", "values", "v", "__privateGet", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "__privateAdd", "Mat3", "_IDENTITY_4X4", "_TMP_VEC3", "_Mat4", "values", "v", "__privateGet", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "__privateAdd", "Mat4", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "_DEFAULT_ANGLE_ORDER", "_TMP_QUAT1", "_TMP_QUAT2", "_TMP_MAT3", "_TMP_VEC3", "_X_UNIT_VEC3", "_Y_UNIT_VEC3", "_Quat", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "__privateGet", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "__privateAdd", "Quat", "Vec4", "_TMP_QUAT", "_TMP_VEC3", "_Quat2", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "__privateGet", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "__privateAdd", "Quat2", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/esm/2022/gl-matrix-f32.js b/dist-cdn/esm/2022/gl-matrix-f32.js index 458dc71b..6c50e457 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.js +++ b/dist-cdn/esm/2022/gl-matrix-f32.js @@ -1,4 +1,7 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) // src/common/index.ts var GLM_EPSILON = 1e-6; diff --git a/dist-cdn/esm/2022/gl-matrix-f32.js.map b/dist-cdn/esm/2022/gl-matrix-f32.js.map index e787aeb5..baa34475 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f32.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;AASO,IAAM,cAAsB;;;ACF5B,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAqE;AAClF,YAAO,OAAO,QAA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AO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC1HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": [] } diff --git a/dist-cdn/esm/2022/gl-matrix-f32.min.js b/dist-cdn/esm/2022/gl-matrix-f32.min.js index a089a337..2bb065aa 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.min.js +++ b/dist-cdn/esm/2022/gl-matrix-f32.min.js @@ -1,3 +1,6 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var Z=class b extends Float32Array{static#t=new Float32Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float32Array{static#t=new Float32Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[3]=k-o,e[6]=M+x,e[1]=k+o,e[4]=1-L-d,e[7]=h-m,e[2]=M-x,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=(r*D-s*N-a*F)*Q,e[4]=(n*N-r*f+a*B)*Q,e[5]=(s*f-n*D-a*A)*Q,e[6]=(m*T-x*V+o*w)*Q,e[7]=(x*g-d*T-o*R)*Q,e[8]=(d*V-m*g+o*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-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e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],x=e[15],o=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,B=L*R-k*z+l*o,f=h*R-d*z+m*o;return y*T-r*A+x*B-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],x=t[13],o=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*x,e[2]=R*a+g*L+w*h+V*o,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*x,e[6]=R*a+g*L+w*h+V*o,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*x,e[10]=R*a+g*L+w*h+V*o,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*x,e[14]=R*a+g*L+w*h+V*o,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],x=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=x,e[11]=o,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+x*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,B=i*r*k-a*y,f=r*a*k-i*y,F=a*a*k+L,D=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*B,e[1]=M*T+x*A+g*B,e[2]=h*T+o*A+w*B,e[3]=d*T+z*A+V*B,e[4]=l*f+m*F+R*D,e[5]=M*f+x*F+g*D,e[6]=h*f+o*F+w*D,e[7]=d*f+z*F+V*D,e[8]=l*N+m*Q+R*Y,e[9]=M*N+x*Q+g*Y,e[10]=h*N+o*Q+w*Y,e[11]=d*N+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,x=i*c,o=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-o,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+x,e[7]=0,e[8]=M+o,e[9]=d-x,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=0,e[4]=(r*D-s*N-a*F)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(s*f-n*D-a*A)*Q,e[7]=0,e[8]=(m*T-x*V+o*w)*Q,e[9]=(x*g-d*T-o*R)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],x=r*h,o=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,B=x+g+A,f=0;return B>0?(f=Math.sqrt(B+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(o-R)/f):x>g&&x>A?(f=Math.sqrt(1+x-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(o+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-x-A)*2,e[3]=(V-z)/f,e[0]=(o+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-x-g)*2,e[3]=(o-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,x=i*k,o=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+x))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+x))*w,e[6]=(m+o)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-o)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,x=i*l,o=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],B=r[1],f=r[2],F=(1-(m+o))*w,D=(h+g)*w,N=(d-R)*w,Q=(h-g)*V,Y=(1-(M+o))*V,X=(x+z)*V,C=(d+R)*T,H=(x-z)*T,$=(1-(M+m))*T;return e[0]=F,e[1]=D,e[2]=N,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+A-(F*A+Q*B+C*f),e[13]=n[1]+B-(D*A+Y*B+H*f),e[14]=n[2]+f-(N*A+X*B+$*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[1]=k+o,e[2]=M-x,e[3]=0,e[4]=k-o,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+x,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,x=1/Math.sqrt(h*h+d*d+m*m);h*=x,d*=x,m*=x;let o=y*m-L*d,z=L*h-c*m,R=c*d-y*h;x=Math.sqrt(o*o+z*z+R*R),x?(x=1/x,o*=x,z*=x,R*=x):(o=0,z=0,R=0);let g=d*R-m*z,w=m*o-h*R,V=h*z-d*o;return x=Math.sqrt(g*g+w*w+V*V),x?(x=1/x,g*=x,w*=x,V*=x):(g=0,w=0,V=0),e[0]=o,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(o*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,x=c*l-y*k;return h=d*d+m*m+x*x,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,x*=h),e[0]=d,e[1]=m,e[2]=x,e[3]=0,e[4]=l*x-M*m,e[5]=M*d-k*x,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],x=e[14],o=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],B=t[7],f=t[8],F=t[9],D=t[10],N=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-B)<=1e-6*Math.max(1,Math.abs(L),Math.abs(B))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-F)<=1e-6*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(M-D)<=1e-6*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(h-N)<=1e-6*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(x-X)<=1e-6*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(o-C)<=1e-6*Math.max(1,Math.abs(o),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var I=class b extends Float32Array{static#t="zyx";static#e=new Float32Array(4);static#r=new Float32Array(4);static#n=new Float32Array(9);static#s=new Float32Array(3);static#a=new Float32Array([1,0,0]);static#i=new Float32Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),x=Math.sin(m);M=Math.sin((1-s)*m)/x,h=Math.sin(s*m)/x}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};I.set=E.set;I.add=E.add;I.lerp=E.lerp;I.normalize=E.normalize;I.squaredLength=E.squaredLength;I.sqrLen=E.squaredLength;I.exactEquals=E.exactEquals;I.equals=E.equals;I.magnitude=E.magnitude;I.prototype.mul=I.prototype.multiply;I.mul=I.multiply;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var O=class b extends Float32Array{static#t=new Float32Array(4);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],x=t[6],o=t[7];return e[4]=d*L+o*i+m*y-x*c,e[5]=m*L+o*c+x*i-d*y,e[6]=x*L+o*y+d*c-m*i,e[7]=o*L-d*i-m*c-x*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],x=n[1],o=n[2],z=n[3];return e[0]=s*z+i*m+r*o-a*x,e[1]=r*z+i*x+a*m-s*o,e[2]=a*z+i*o+s*x-r*m,e[3]=i*z-s*m-r*x-a*o,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*o-h*x,e[5]=r*k+i*y+a*c-s*L+M*z+d*x+h*m-l*o,e[6]=a*k+i*L+s*y-r*c+h*z+d*o+l*x-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*x-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],x=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};O.dot=I.dot;O.squaredLength=I.squaredLength;O.sqrLen=I.squaredLength;O.mag=I.magnitude;O.length=I.magnitude;O.len=I.magnitude;O.mul=O.multiply;var S=class b extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};S.prototype.sub=S.prototype.subtract;S.prototype.mul=S.prototype.multiply;S.prototype.div=S.prototype.divide;S.prototype.dist=S.prototype.distance;S.prototype.sqrDist=S.prototype.squaredDistance;S.sub=S.subtract;S.mul=S.multiply;S.div=S.divide;S.dist=S.distance;S.sqrDist=S.squaredDistance;S.sqrLen=S.squaredLength;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var W=!1;function ze(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new S(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of b){let a=s(r);Object.defineProperty(S.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function pe(b){return b*J}function fe(b){return b*U}export{ze as EnableSwizzles,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,I as Quat,O as Quat2,S as Vec2,q as Vec3,E as Vec4,Z as mat2,j as mat2d,G as mat3,P as mat4,I as quat,O as quat2,pe as toDegree,fe as toRadian,S as vec2,q as vec3,E as vec4}; //# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f32.min.js.map b/dist-cdn/esm/2022/gl-matrix-f32.min.js.map index fb21244f..7e0fc984 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.min.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f32.min.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";AAOO,IAAMA,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMH,EAAKC,EAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOD,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAIJ,EAAKC,EAAa,EACpB,IACT,CAUA,SAASI,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,KAAM,IAAI,CAClC,CASA,QAAe,CACb,OAAOA,EAAK,OAAO,KAAM,IAAI,CAC/B,CAUA,MAAMG,EAA6B,CACjC,OAAOH,EAAK,MAAM,KAAM,KAAMG,CAAC,CACjC,CAUA,OAAOG,EAAmB,CACxB,OAAON,EAAK,OAAO,KAAM,KAAMM,CAAG,CACpC,CAWA,WAAW,aAAsB,CAC/B,MAAO,GAAI,aAAa,iBAC1B,CAYA,OAAO,QAAe,CACpB,OAAO,IAAIN,CACb,CASA,OAAO,MAAMI,EAA6B,CACxC,OAAO,IAAIJ,EAAKI,CAAC,CACnB,CAUA,OAAO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,CAAC,CAAC,CAAC,CAAC,CAAG,CAC7K,CACF,CAEA,QAAWA,KAAWL,EAAe,CACnC,IAAMS,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeC,EAAK,UAAWD,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeF,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CC1HA,IAAMY,EAAyB,KAAK,GAAK,IAKnCC,EAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", "names": ["Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/esm/2022/gl-matrix-f64.js b/dist-cdn/esm/2022/gl-matrix-f64.js index be140cbd..6746d817 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.js +++ b/dist-cdn/esm/2022/gl-matrix-f64.js @@ -1,4 +1,7 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) // src/common/index.ts var GLM_EPSILON = 1e-6; diff --git a/dist-cdn/esm/2022/gl-matrix-f64.js.map b/dist-cdn/esm/2022/gl-matrix-f64.js.map index 040889f4..00f9025e 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f64.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;AASO,IAAM,cAAsB;;;ACF5B,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAqE;AACl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Ae,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC3HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": [] } diff --git a/dist-cdn/esm/2022/gl-matrix-f64.min.js b/dist-cdn/esm/2022/gl-matrix-f64.min.js index 990ff86d..c6e8f94e 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.min.js +++ b/dist-cdn/esm/2022/gl-matrix-f64.min.js @@ -1,3 +1,6 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var Z=class b extends Float64Array{static#t=new Float64Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float64Array{static#t=new Float64Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[3]=k-o,e[6]=M+x,e[1]=k+o,e[4]=1-L-d,e[7]=h-m,e[2]=M-x,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=(r*D-s*N-a*I)*Q,e[4]=(n*N-r*f+a*B)*Q,e[5]=(s*f-n*D-a*A)*Q,e[6]=(m*T-x*V+o*w)*Q,e[7]=(x*g-d*T-o*R)*Q,e[8]=(d*V-m*g+o*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*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e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],x=e[15],o=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,B=L*R-k*z+l*o,f=h*R-d*z+m*o;return y*T-r*A+x*B-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],x=t[13],o=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*x,e[2]=R*a+g*L+w*h+V*o,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*x,e[6]=R*a+g*L+w*h+V*o,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*x,e[10]=R*a+g*L+w*h+V*o,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*x,e[14]=R*a+g*L+w*h+V*o,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],x=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=x,e[11]=o,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+x*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,B=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,D=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*B,e[1]=M*T+x*A+g*B,e[2]=h*T+o*A+w*B,e[3]=d*T+z*A+V*B,e[4]=l*f+m*I+R*D,e[5]=M*f+x*I+g*D,e[6]=h*f+o*I+w*D,e[7]=d*f+z*I+V*D,e[8]=l*N+m*Q+R*Y,e[9]=M*N+x*Q+g*Y,e[10]=h*N+o*Q+w*Y,e[11]=d*N+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,x=i*c,o=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-o,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+x,e[7]=0,e[8]=M+o,e[9]=d-x,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=0,e[4]=(r*D-s*N-a*I)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(s*f-n*D-a*A)*Q,e[7]=0,e[8]=(m*T-x*V+o*w)*Q,e[9]=(x*g-d*T-o*R)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],x=r*h,o=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,B=x+g+A,f=0;return B>0?(f=Math.sqrt(B+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(o-R)/f):x>g&&x>A?(f=Math.sqrt(1+x-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(o+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-x-A)*2,e[3]=(V-z)/f,e[0]=(o+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-x-g)*2,e[3]=(o-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,x=i*k,o=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+x))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+x))*w,e[6]=(m+o)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-o)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,x=i*l,o=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],B=r[1],f=r[2],I=(1-(m+o))*w,D=(h+g)*w,N=(d-R)*w,Q=(h-g)*V,Y=(1-(M+o))*V,X=(x+z)*V,C=(d+R)*T,H=(x-z)*T,$=(1-(M+m))*T;return e[0]=I,e[1]=D,e[2]=N,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+A-(I*A+Q*B+C*f),e[13]=n[1]+B-(D*A+Y*B+H*f),e[14]=n[2]+f-(N*A+X*B+$*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[1]=k+o,e[2]=M-x,e[3]=0,e[4]=k-o,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+x,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,x=1/Math.sqrt(h*h+d*d+m*m);h*=x,d*=x,m*=x;let o=y*m-L*d,z=L*h-c*m,R=c*d-y*h;x=Math.sqrt(o*o+z*z+R*R),x?(x=1/x,o*=x,z*=x,R*=x):(o=0,z=0,R=0);let g=d*R-m*z,w=m*o-h*R,V=h*z-d*o;return x=Math.sqrt(g*g+w*w+V*V),x?(x=1/x,g*=x,w*=x,V*=x):(g=0,w=0,V=0),e[0]=o,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(o*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,x=c*l-y*k;return h=d*d+m*m+x*x,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,x*=h),e[0]=d,e[1]=m,e[2]=x,e[3]=0,e[4]=l*x-M*m,e[5]=M*d-k*x,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],x=e[14],o=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],B=t[7],f=t[8],I=t[9],D=t[10],N=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-B)<=1e-6*Math.max(1,Math.abs(L),Math.abs(B))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(M-D)<=1e-6*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(h-N)<=1e-6*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(x-X)<=1e-6*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(o-C)<=1e-6*Math.max(1,Math.abs(o),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var F=class b extends Float64Array{static#t="zyx";static#e=new Float64Array(4);static#r=new Float64Array(4);static#n=new Float64Array(9);static#s=new Float64Array(3);static#a=new Float64Array([1,0,0]);static#i=new Float64Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),x=Math.sin(m);M=Math.sin((1-s)*m)/x,h=Math.sin(s*m)/x}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};F.set=E.set;F.add=E.add;F.lerp=E.lerp;F.normalize=E.normalize;F.squaredLength=E.squaredLength;F.sqrLen=E.squaredLength;F.exactEquals=E.exactEquals;F.equals=E.equals;F.magnitude=E.magnitude;F.prototype.mul=F.prototype.multiply;F.mul=F.multiply;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var O=class b extends Float64Array{static#t=new Float64Array(4);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],x=t[6],o=t[7];return e[4]=d*L+o*i+m*y-x*c,e[5]=m*L+o*c+x*i-d*y,e[6]=x*L+o*y+d*c-m*i,e[7]=o*L-d*i-m*c-x*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],x=n[1],o=n[2],z=n[3];return e[0]=s*z+i*m+r*o-a*x,e[1]=r*z+i*x+a*m-s*o,e[2]=a*z+i*o+s*x-r*m,e[3]=i*z-s*m-r*x-a*o,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*o-h*x,e[5]=r*k+i*y+a*c-s*L+M*z+d*x+h*m-l*o,e[6]=a*k+i*L+s*y-r*c+h*z+d*o+l*x-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*x-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],x=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};O.dot=F.dot;O.squaredLength=F.squaredLength;O.sqrLen=F.squaredLength;O.mag=F.magnitude;O.length=F.magnitude;O.len=F.magnitude;O.mul=O.multiply;var S=class b extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};S.prototype.sub=S.prototype.subtract;S.prototype.mul=S.prototype.multiply;S.prototype.div=S.prototype.divide;S.prototype.dist=S.prototype.distance;S.prototype.sqrDist=S.prototype.squaredDistance;S.sub=S.subtract;S.mul=S.multiply;S.div=S.divide;S.dist=S.distance;S.sqrDist=S.squaredDistance;S.sqrLen=S.squaredLength;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var W=!1;function ge(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new S(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of b){let a=s(r);Object.defineProperty(S.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function ze(b){return b*J}function we(b){return b*U}export{ge as EnableSwizzlesF64,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,F as Quat,O as Quat2,S as Vec2,q as Vec3,E as Vec4,ze as toDegree,we as toRadian}; //# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f64.min.js.map b/dist-cdn/esm/2022/gl-matrix-f64.min.js.map index 5c513f07..dd378abd 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.min.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f64.min.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";AAOO,IAAMA,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMH,EAAKC,EAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOD,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAIJ,EAAKC,EAAa,EACpB,IACT,CAUA,SAASI,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,KAAM,IAAI,CAClC,CASA,QAAe,CACb,OAAOA,EAAK,OAAO,KAAM,IAAI,CAC/B,CAUA,MAAMG,EAA6B,CACjC,OAAOH,EAAK,MAAM,KAAM,KAAMG,CAAC,CACjC,CAUA,OAAOG,EAAmB,CACxB,OAAON,EAAK,OAAO,KAAM,KAAMM,CAAG,CACpC,CAWA,WAAW,aAAsB,CAC/B,MAAO,GAAI,aAAa,iBAC1B,CAYA,OAAO,QAAe,CACpB,OAAO,IAAIN,CACb,CASA,OAAO,MAAMI,EAA6B,CACxC,OAAO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,CAAC,CAAC,EAAG,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,CAAC,CAAG,CAC7K,CACF,CAEA,QAAWA,KAAWL,EAAe,CACnC,IAAMS,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeC,EAAK,UAAWD,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeF,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CC3HA,IAAMY,EAAyB,KAAK,GAAK,IAKnCC,EAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", "names": ["Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/types/gl-matrix-f32.d.mts b/dist-cdn/types/gl-matrix-f32.d.mts index 3f6ed78e..c443625f 100644 --- a/dist-cdn/types/gl-matrix-f32.d.mts +++ b/dist-cdn/types/gl-matrix-f32.d.mts @@ -5013,4832 +5013,4831 @@ type Vec3Alias = Vec3; * @hidden */ type Vec4Alias = Vec4; -declare module '#gl-matrix' { - /** - * Vec2 swizzle extension accessors. - */ - interface Vec2 { - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggg(): Vec4Alias; - } - /** - * Vec3 swizzle extension accessors. - */ - interface Vec3 { - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get br(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbb(): Vec4Alias; - } - /** - * Vec4 swizzle extension accessors. - */ - interface Vec4 { - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get br(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xw(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yw(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zw(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get wx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get wy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get wz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ww(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xwx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xwy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xwz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xww(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ywx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ywy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ywz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yww(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zwx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zwy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zwz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zww(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wwx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wwy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wwz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get www(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ra(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ga(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ba(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ar(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ag(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ab(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get aa(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rra(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get raa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gra(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gaa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bra(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get baa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get arr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get arg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get arb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ara(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get agr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get agg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get agb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get abr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get abg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get abb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aaa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rraa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rarr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rarg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rarb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ragr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ragg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ragb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rabr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rabg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rabb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get graa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get garr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get garg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get garb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gagr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gagg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gagb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gabr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gabg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gabb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get braa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get barr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get barg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get barb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bagr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bagg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bagb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get babr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get babg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get babb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get argr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get argg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get argb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get araa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aarr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aarg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aarb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aagr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aagg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aagb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aabr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aabg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aabb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaaa(): Vec4Alias; - } + +/** + * Vec2 swizzle extension accessors. + */ +interface Vec2 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; +} +/** + * Vec3 swizzle extension accessors. + */ +interface Vec3 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; +} +/** + * Vec4 swizzle extension accessors. + */ +interface Vec4 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ww(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get www(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ra(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ga(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ba(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ar(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ag(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ab(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get aa(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get raa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get baa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ara(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rraa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get graa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get braa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get araa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaaa(): Vec4Alias; } /** diff --git a/dist-cdn/types/gl-matrix-f64.d.mts b/dist-cdn/types/gl-matrix-f64.d.mts index 27de74d7..eefdc9a8 100644 --- a/dist-cdn/types/gl-matrix-f64.d.mts +++ b/dist-cdn/types/gl-matrix-f64.d.mts @@ -5014,4832 +5014,4831 @@ type Vec3Alias = Vec3; * @hidden */ type Vec4Alias = Vec4; -declare module '#gl-matrix/f64' { - /** - * Vec2 swizzle extension accessors. - */ - interface Vec2 { - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggg(): Vec4Alias; - } - /** - * Vec3 swizzle extension accessors. - */ - interface Vec3 { - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get br(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbb(): Vec4Alias; - } - /** - * Vec4 swizzle extension accessors. - */ - interface Vec4 { - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gr(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get rb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get gb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get br(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bg(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get bb(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rrb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get grb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ggb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get brb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bgb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bbb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get xw(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get yw(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get zw(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get wx(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get wy(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get wz(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ww(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xwx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xwy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xwz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get xww(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ywx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ywy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ywz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get yww(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zwx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zwy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zwz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get zww(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wxw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wyw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wzw(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wwx(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wwy(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get wwz(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get www(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get xwww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get yzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ywww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get zwww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wxww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wywx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wywy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wywz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wyww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wzww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwxw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwyw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwzw(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwwx(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwwy(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwwz(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get wwww(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ra(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ga(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ba(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ar(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ag(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get ab(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec2 - */ - get aa(): Vec2Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rra(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get rab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get raa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gra(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get gaa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bra(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get bab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get baa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get arr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get arg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get arb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get ara(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get agr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get agg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get agb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aga(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get abr(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get abg(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get abb(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aba(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aar(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aag(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aab(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec3 - */ - get aaa(): Vec3Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rrab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rraa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rgaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rbaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rarr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rarg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rarb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ragr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ragg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ragb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rabr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rabg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get rabb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get raaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get grab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get graa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get ggaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gbaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get garr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get garg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get garb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gagr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gagg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gagb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gabr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gabg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gabb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get gaaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get brab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get braa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bgaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bbaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get barr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get barg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get barb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bagr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bagg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get bagb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get babr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get babg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get babb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get baaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get argr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get argg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get argb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get arab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get araa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aggr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aggg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aggb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get agaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abrr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abrg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abrb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abra(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abgr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abgg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abgb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abbr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abbg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abbb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get abaa(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aarr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aarg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aarb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aara(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aagr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aagg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aagb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaga(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aabr(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aabg(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aabb(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaba(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaar(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaag(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaab(): Vec4Alias; - /** - * @category Swizzle Accessors (Optional) - * @returns New instance of swizzled Vec4 - */ - get aaaa(): Vec4Alias; - } + +/** + * Vec2 swizzle extension accessors. + */ +interface Vec2 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; +} +/** + * Vec3 swizzle extension accessors. + */ +interface Vec3 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; +} +/** + * Vec4 swizzle extension accessors. + */ +interface Vec4 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ww(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get www(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ra(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ga(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ba(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ar(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ag(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ab(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get aa(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get raa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get baa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ara(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rraa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get graa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get braa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get araa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaaa(): Vec4Alias; } /** diff --git a/dist-cdn/types/globals-f32.d.mts b/dist-cdn/types/globals-f32.d.mts new file mode 100644 index 00000000..b2600fd6 --- /dev/null +++ b/dist-cdn/types/globals-f32.d.mts @@ -0,0 +1,7 @@ +import type * as libF32 from './gl-matrix-f32.d.mts'; + +declare global { + const glMatrix: typeof libF32; +} + +export {}; diff --git a/dist-cdn/types/globals-f64.d.mts b/dist-cdn/types/globals-f64.d.mts new file mode 100644 index 00000000..9d950c58 --- /dev/null +++ b/dist-cdn/types/globals-f64.d.mts @@ -0,0 +1,7 @@ +import type * as libF64 from './gl-matrix-f64.d.mts'; + +declare global { + const glMatrixF64: typeof libF64; +} + +export {}; diff --git a/dist-cdn/types/index.cjs b/dist-cdn/types/index.cjs new file mode 100644 index 00000000..43a1d7b2 --- /dev/null +++ b/dist-cdn/types/index.cjs @@ -0,0 +1,18 @@ +// glMatrix - v4.0.0-beta.3 +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// dist-cdn/types/index.js +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/dist-cdn/types/index.js b/dist-cdn/types/index.js new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/dist-cdn/types/index.js @@ -0,0 +1 @@ +export {}; diff --git a/dist-cdn/umd/gl-matrix-f32.cjs.map b/dist-cdn/umd/gl-matrix-f32.cjs.map deleted file mode 100644 index ffd87c33..00000000 --- a/dist-cdn/umd/gl-matrix-f32.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gl-matrix-f32.cjs","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.cjs b/dist-cdn/umd/gl-matrix-f32.js similarity index 99% rename from dist-cdn/umd/gl-matrix-f32.cjs rename to dist-cdn/umd/gl-matrix-f32.js index 8f950329..129e9332 100644 --- a/dist-cdn/umd/gl-matrix-f32.cjs +++ b/dist-cdn/umd/gl-matrix-f32.js @@ -1,4 +1,7 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -125,7 +128,10 @@ }, _wrapNativeSuper(t); } - // glMatrix - v4.0.0-beta.3 + // gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. + // @author Brandon Jones + // @author Colin MacKenzie IV + // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var __typeError = function __typeError(msg) { throw TypeError(msg); }; @@ -10676,4 +10682,4 @@ exports.vec4 = Vec4; })); -//# sourceMappingURL=gl-matrix-f32.cjs.map +//# sourceMappingURL=gl-matrix-f32.js.map diff --git a/dist-cdn/umd/gl-matrix-f32.js.map b/dist-cdn/umd/gl-matrix-f32.js.map new file mode 100644 index 00000000..73d59220 --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f32.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.min.cjs.map b/dist-cdn/umd/gl-matrix-f32.min.cjs.map deleted file mode 100644 index f051873c..00000000 --- a/dist-cdn/umd/gl-matrix-f32.min.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gl-matrix-f32.min.cjs","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],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-M*R+h*o,e[8]=i*F-c*p+L*B,e[9]=s*p-n*F-a*B,e[10]=b*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-i*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-b*z-m*V,e[15]=k*z-l*o+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],x=t*i-n*a,V=t*c-s*a,o=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,S=t*g-n*z+s*R,B=a*g-i*z+c*R,N=L*o-k*V+l*x,p=h*o-b*V+d*x;return y*S-r*B+m*N-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.min.cjs b/dist-cdn/umd/gl-matrix-f32.min.js similarity index 99% rename from dist-cdn/umd/gl-matrix-f32.min.cjs rename to dist-cdn/umd/gl-matrix-f32.min.js index 22b9355d..7e0f568c 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.cjs +++ b/dist-cdn/umd/gl-matrix-f32.min.js @@ -1,4 +1,7 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -125,7 +128,10 @@ }, _wrapNativeSuper(t); } - // glMatrix - v4.0.0-beta.3 + // gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. + // @author Brandon Jones + // @author Colin MacKenzie IV + // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var de = function de(A) { throw TypeError(A); }; @@ -4442,4 +4448,4 @@ exports.vec4 = q; })); -//# sourceMappingURL=gl-matrix-f32.min.cjs.map +//# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/umd/gl-matrix-f32.min.js.map b/dist-cdn/umd/gl-matrix-f32.min.js.map new file mode 100644 index 00000000..6824a38e --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f32.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static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*B,e[10]=b*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-i*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-b*z-m*V,e[15]=k*z-l*o+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],x=t*i-n*a,V=t*c-s*a,o=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,S=t*g-n*z+s*R,B=a*g-i*z+c*R,N=L*o-k*V+l*x,p=h*o-b*V+d*x;return y*S-r*B+m*N-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.cjs.map b/dist-cdn/umd/gl-matrix-f64.cjs.map deleted file mode 100644 index c48eb123..00000000 --- a/dist-cdn/umd/gl-matrix-f64.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gl-matrix-f64.cjs","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.cjs b/dist-cdn/umd/gl-matrix-f64.js similarity index 99% rename from dist-cdn/umd/gl-matrix-f64.cjs rename to dist-cdn/umd/gl-matrix-f64.js index bea9c26d..91be7c40 100644 --- a/dist-cdn/umd/gl-matrix-f64.cjs +++ b/dist-cdn/umd/gl-matrix-f64.js @@ -1,8 +1,11 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrix = {})); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrixF64 = {})); })(this, (function (exports) { 'use strict'; function _assertThisInitialized(e) { @@ -125,7 +128,10 @@ }, _wrapNativeSuper(t); } - // glMatrix - v4.0.0-beta.3 + // gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. + // @author Brandon Jones + // @author Colin MacKenzie IV + // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var __typeError = function __typeError(msg) { throw TypeError(msg); }; @@ -10667,4 +10673,4 @@ exports.toRadian = toRadian; })); -//# sourceMappingURL=gl-matrix-f64.cjs.map +//# sourceMappingURL=gl-matrix-f64.js.map diff --git a/dist-cdn/umd/gl-matrix-f64.js.map b/dist-cdn/umd/gl-matrix-f64.js.map new file mode 100644 index 00000000..57dbdabe --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f64.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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a/dist-cdn/umd/gl-matrix-f64.min.cjs.map b/dist-cdn/umd/gl-matrix-f64.min.cjs.map deleted file mode 100644 index 9f966fd4..00000000 --- a/dist-cdn/umd/gl-matrix-f64.min.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gl-matrix-f64.min.cjs","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// glMatrix - v4.0.0-beta.3\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N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-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,k=s*c,l=s*y,b=s*L,h=r*y,M=r*L,d=i*L,m=a*c,x=a*y,V=a*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=b-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=M+m,e[7]=0,e[8]=b+x,e[9]=M-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+i*i;return k>0?(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2/k,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2/k):(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=0,e[4]=(r*I-s*P-i*Y)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(s*p-n*I-i*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-M*S-x*o)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"xzy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case\"yxz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case\"yzx\":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case\"zxy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"zyx\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(\", \")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","i","a","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAoF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAArEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.min.cjs b/dist-cdn/umd/gl-matrix-f64.min.js similarity index 99% rename from dist-cdn/umd/gl-matrix-f64.min.cjs rename to dist-cdn/umd/gl-matrix-f64.min.js index 3486cde0..9d9d83ed 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.cjs +++ b/dist-cdn/umd/gl-matrix-f64.min.js @@ -1,8 +1,11 @@ -// glMatrix - v4.0.0-beta.3 +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrix = {})); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.glMatrixF64 = {})); })(this, (function (exports) { 'use strict'; function _assertThisInitialized(e) { @@ -125,7 +128,10 @@ }, _wrapNativeSuper(t); } - // glMatrix - v4.0.0-beta.3 + // gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. + // @author Brandon Jones + // @author Colin MacKenzie IV + // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) var de = function de(A) { throw TypeError(A); }; @@ -4433,4 +4439,4 @@ exports.toRadian = et; })); -//# sourceMappingURL=gl-matrix-f64.min.cjs.map +//# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/umd/gl-matrix-f64.min.js.map b/dist-cdn/umd/gl-matrix-f64.min.js.map new file mode 100644 index 00000000..adf169fe --- /dev/null +++ b/dist-cdn/umd/gl-matrix-f64.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q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c-s*i,o=n*c-s*a,R=L*M-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,k=s*c,l=s*y,b=s*L,h=r*y,M=r*L,d=i*L,m=a*c,x=a*y,V=a*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=b-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=M+m,e[7]=0,e[8]=b+x,e[9]=M-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+i*i;return k>0?(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2/k,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2/k):(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=0,e[4]=(r*I-s*P-i*Y)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(s*p-n*I-i*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-M*S-x*o)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"xzy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case\"yxz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case\"yzx\":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case\"zxy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"zyx\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(\", \")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","i","a","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAoF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAArEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/esm-d-ts.config.js b/esm-d-ts.config.js index b90ba3ef..16160d04 100644 --- a/esm-d-ts.config.js +++ b/esm-d-ts.config.js @@ -10,6 +10,10 @@ const importsLocal = true; // final bundle. const dtsReplace = { '#gl-matrix': 'gl-matrix' }; +// The ambient module declarations are repurposed for the all-inclusive CDN bundles and the `declare module` wrapper +// needs to be removed. +const dtsReplaceCDN = { "declare module '[^']*' \\{([\\s\\S]*?)^\\}": '$1' }; + /** @type {import('@typhonjs-build-test/esm-d-ts').GenerateConfig[]} */ const configs = [ // Bundles main and all sub-path export types configured in `package.json` exports. @@ -25,8 +29,8 @@ const configs = [ { input: './src/util/index.ts', output: './dist/util/index.d.mts', importsLocal }, // Bundles CDN types. - { input: './scripts/bundle/cdn-entry-f32.ts', output: './dist-cdn/types/gl-matrix-f32.d.mts' }, - { input: './scripts/bundle/cdn-entry-f64.ts', output: './dist-cdn/types/gl-matrix-f64.d.mts' } + { input: './src/cdn/index.ts', output: './dist-cdn/types/gl-matrix-f32.d.mts', dtsReplace: dtsReplaceCDN }, + { input: './src/cdn/f64/index.ts', output: './dist-cdn/types/gl-matrix-f64.d.mts', dtsReplace: dtsReplaceCDN } ]; export default configs; diff --git a/package-lock.json b/package-lock.json index 21676a09..0d1608dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "gl-matrix", "version": "4.0.0-beta.3", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -14,7 +14,6 @@ "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", - "@typhonjs-utils/file-util": "^0.1.0", "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.6.0", "esbuild": "^0.21.0", @@ -89,15 +88,6 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/generator": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", @@ -154,24 +144,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/helper-create-class-features-plugin": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", @@ -195,15 +167,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/helper-create-regexp-features-plugin": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz", @@ -221,15 +184,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/helper-define-polyfill-provider": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", @@ -491,12 +445,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "node_modules/@babel/parser": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", @@ -1686,15 +1634,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/preset-modules": { "version": "0.1.6-no-external-plugins", "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", @@ -1783,9 +1722,9 @@ "dev": true }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", - "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz", + "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==", "dev": true, "dependencies": { "@types/eslint": "^8.56.5", @@ -1800,9 +1739,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], @@ -1816,9 +1755,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", - "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -1832,9 +1771,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -1848,9 +1787,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -1864,9 +1803,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -1880,9 +1819,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -1896,9 +1835,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -1912,9 +1851,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -1928,9 +1867,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -1944,9 +1883,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -1960,9 +1899,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -1976,9 +1915,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", - "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -1992,9 +1931,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -2008,9 +1947,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -2024,9 +1963,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -2040,9 +1979,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -2056,9 +1995,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -2072,9 +2011,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -2088,9 +2027,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -2104,9 +2043,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -2120,9 +2059,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -2136,9 +2075,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -2152,9 +2091,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -2372,12 +2311,6 @@ } } }, - "node_modules/@rollup/pluginutils/node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.18.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", @@ -2605,9 +2538,9 @@ } }, "node_modules/@types/cytoscape": { - "version": "3.21.2", - "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.2.tgz", - "integrity": "sha512-eadSCH9hbRV9Ej93S8wact/Oe0DuQV4qlWfST/I6k4lBu6RgqI6mVFzvppcIGzWpzZRu7iyFjFhS2qW0w7KFRA==", + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.4.tgz", + "integrity": "sha512-g4M57Zho+AMNYuEptTWH+aZ5VpyF8VcaI2t0+1/PWRZp5XQM6hku1Vo5/Ui721i+L+WCGkI1EjGAeHcYUQ2PRg==", "dev": true }, "node_modules/@types/eslint": { @@ -2633,9 +2566,9 @@ "dev": true }, "node_modules/@typescript-eslint/types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", - "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.1.tgz", + "integrity": "sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -2918,10 +2851,19 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@vitest/utils/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", + "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2931,10 +2873,13 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } @@ -2958,15 +2903,15 @@ "dev": true }, "node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "color-convert": "^1.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "engines": { + "node": ">=4" } }, "node_modules/assertion-error": { @@ -2992,15 +2937,6 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/babel-plugin-polyfill-corejs3": { "version": "0.10.4", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", @@ -3101,9 +3037,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001634", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001634.tgz", - "integrity": "sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==", + "version": "1.0.30001636", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz", + "integrity": "sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==", "dev": true, "funding": [ { @@ -3152,18 +3088,6 @@ "node": ">=4" } }, - "node_modules/chalk/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", @@ -3327,9 +3251,9 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -3344,9 +3268,9 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, "dependencies": { "type-detect": "^4.0.0" @@ -3426,9 +3350,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.803", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.803.tgz", - "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", + "version": "1.4.808", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.808.tgz", + "integrity": "sha512-0ItWyhPYnww2VOuCGF4s1LTfbrdAV2ajy/TN+ZTuhR23AHI6rWHCrBXJ/uxoXOvRRqw8qjYVrG81HFI7x/2wdQ==", "dev": true }, "node_modules/emoji-regex": { @@ -3456,9 +3380,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", - "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, "bin": { @@ -3468,470 +3392,131 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.4", - "@esbuild/android-arm": "0.21.4", - "@esbuild/android-arm64": "0.21.4", - "@esbuild/android-x64": "0.21.4", - "@esbuild/darwin-arm64": "0.21.4", - "@esbuild/darwin-x64": "0.21.4", - "@esbuild/freebsd-arm64": "0.21.4", - "@esbuild/freebsd-x64": "0.21.4", - "@esbuild/linux-arm": "0.21.4", - "@esbuild/linux-arm64": "0.21.4", - "@esbuild/linux-ia32": "0.21.4", - "@esbuild/linux-loong64": "0.21.4", - "@esbuild/linux-mips64el": "0.21.4", - "@esbuild/linux-ppc64": "0.21.4", - "@esbuild/linux-riscv64": "0.21.4", - "@esbuild/linux-s390x": "0.21.4", - "@esbuild/linux-x64": "0.21.4", - "@esbuild/netbsd-x64": "0.21.4", - "@esbuild/openbsd-x64": "0.21.4", - "@esbuild/sunos-x64": "0.21.4", - "@esbuild/win32-arm64": "0.21.4", - "@esbuild/win32-ia32": "0.21.4", - "@esbuild/win32-x64": "0.21.4" - } - }, - "node_modules/esbuild/node_modules/@esbuild/aix-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", - "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, - "node_modules/esbuild/node_modules/@esbuild/android-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", - "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", - "cpu": [ - "arm64" - ], + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, - "optional": true, - "os": [ - "android" - ], "engines": { - "node": ">=12" + "node": ">=6" } }, - "node_modules/esbuild/node_modules/@esbuild/android-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", - "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", - "cpu": [ - "x64" - ], + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "optional": true, - "os": [ - "android" - ], "engines": { - "node": ">=12" + "node": ">=0.8.0" } }, - "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", - "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", - "cpu": [ - "arm64" - ], + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "estraverse": "^5.1.0" + }, "engines": { - "node": ">=12" + "node": ">=0.10" } }, - "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", - "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", - "cpu": [ - "x64" - ], + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": ">=12" + "node": ">=4.0" } }, - "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", - "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", - "cpu": [ - "arm64" - ], + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], "engines": { - "node": ">=12" + "node": ">=0.10.0" } }, - "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", - "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", - "cpu": [ - "x64" - ], + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, "engines": { - "node": ">=12" + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", - "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", - "cpu": [ - "arm" - ], + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, "engines": { - "node": ">=12" + "node": ">=8.6.0" } }, - "node_modules/esbuild/node_modules/@esbuild/linux-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", - "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", - "cpu": [ - "arm64" - ], + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", - "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", - "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", - "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", - "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-s390x": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", - "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/linux-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", - "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", - "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", - "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/sunos-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", - "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/win32-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", - "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/win32-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", - "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild/node_modules/@esbuild/win32-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", - "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" + "dependencies": { + "reusify": "^1.0.4" } }, "node_modules/fflate": { @@ -3959,9 +3544,9 @@ "dev": true }, "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", "dev": true, "dependencies": { "cross-spawn": "^7.0.0", @@ -4048,15 +3633,16 @@ } }, "node_modules/glob": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", + "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { @@ -4185,12 +3771,15 @@ "dev": true }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", "dev": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4325,9 +3914,9 @@ } }, "node_modules/jackspeak": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", - "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -4343,9 +3932,9 @@ } }, "node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "node_modules/jsdoc-type-pratt-parser": { @@ -4431,12 +4020,12 @@ } }, "node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, - "engines": { - "node": "14 || >=16.14" + "dependencies": { + "yallist": "^3.0.2" } }, "node_modules/lunr": { @@ -4480,6 +4069,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/marked": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", @@ -4572,14 +4173,14 @@ } }, "node_modules/mlly": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", - "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", + "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==", "dev": true, "dependencies": { "acorn": "^8.11.3", "pathe": "^1.1.2", - "pkg-types": "^1.1.0", + "pkg-types": "^1.1.1", "ufo": "^1.5.3" } }, @@ -4709,6 +4310,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -4780,6 +4387,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -4853,9 +4469,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -4881,6 +4497,18 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -5107,15 +4735,12 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" } }, "node_modules/shebang-command": { @@ -5336,6 +4961,12 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -5388,6 +5019,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -5490,9 +5122,9 @@ } }, "node_modules/type-fest": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", - "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", + "version": "4.20.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.20.1.tgz", + "integrity": "sha512-R6wDsVsoS9xYOpy8vgeBlqpdOyzJ12HNfQhC/aAKWM3YoCV9TtunJzh/QpkMgeDhkoynDcw5f1y+qF9yc/HHyg==", "dev": true, "engines": { "node": ">=16" @@ -5631,12 +5263,12 @@ } }, "node_modules/vite": { - "version": "5.2.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", - "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.1.tgz", + "integrity": "sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==", "dev": true, "dependencies": { - "esbuild": "^0.20.1", + "esbuild": "^0.21.3", "postcss": "^8.4.38", "rollup": "^4.13.0" }, @@ -5707,76 +5339,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" - } - }, "node_modules/vitest": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", @@ -6030,3980 +5592,5 @@ "url": "https://github.com/sponsors/sindresorhus" } } - }, - "dependencies": { - "@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.24.7", - "picocolors": "^1.0.0" - } - }, - "@babel/compat-data": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", - "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", - "dev": true - }, - "@babel/core": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", - "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", - "dev": true, - "requires": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helpers": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", - "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", - "dev": true, - "requires": { - "@babel/types": "^7.24.7", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", - "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", - "dev": true, - "requires": { - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", - "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", - "dev": true, - "requires": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", - "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "browserslist": "^4.22.2", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", - "integrity": "sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.7", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "semver": "^6.3.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz", - "integrity": "sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "regexpu-core": "^5.3.1", - "semver": "^6.3.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/helper-define-polyfill-provider": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", - "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", - "dev": true, - "requires": { - "@babel/helper-compilation-targets": "^7.22.6", - "@babel/helper-plugin-utils": "^7.22.5", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2" - } - }, - "@babel/helper-environment-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", - "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", - "dev": true, - "requires": { - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", - "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", - "dev": true, - "requires": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", - "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", - "dev": true, - "requires": { - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.7.tgz", - "integrity": "sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==", - "dev": true, - "requires": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-module-imports": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", - "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", - "dev": true, - "requires": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-module-transforms": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", - "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", - "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", - "dev": true, - "requires": { - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.7.tgz", - "integrity": "sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==", - "dev": true - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.7.tgz", - "integrity": "sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-wrap-function": "^7.24.7" - } - }, - "@babel/helper-replace-supers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.7.tgz", - "integrity": "sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.7", - "@babel/helper-optimise-call-expression": "^7.24.7" - } - }, - "@babel/helper-simple-access": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", - "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", - "dev": true, - "requires": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", - "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", - "dev": true, - "requires": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", - "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", - "dev": true, - "requires": { - "@babel/types": "^7.24.7" - } - }, - "@babel/helper-string-parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", - "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", - "dev": true - }, - "@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", - "dev": true - }, - "@babel/helper-validator-option": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", - "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.24.7.tgz", - "integrity": "sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.24.7", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/helpers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", - "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", - "dev": true, - "requires": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "dependencies": { - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - } - } - }, - "@babel/parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", - "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", - "dev": true - }, - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.7.tgz", - "integrity": "sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.7.tgz", - "integrity": "sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", - "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7" - } - }, - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.7.tgz", - "integrity": "sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0-placeholder-for-preset-env.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", - "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", - "dev": true, - "requires": {} - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - } - }, - "@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-import-assertions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", - "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-syntax-import-attributes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", - "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-unicode-sets-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", - "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", - "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-async-generator-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.7.tgz", - "integrity": "sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7", - "@babel/plugin-syntax-async-generators": "^7.8.4" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz", - "integrity": "sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", - "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.7.tgz", - "integrity": "sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-class-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.7.tgz", - "integrity": "sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-class-static-block": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz", - "integrity": "sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.7.tgz", - "integrity": "sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "globals": "^11.1.0" - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", - "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/template": "^7.24.7" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.7.tgz", - "integrity": "sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", - "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", - "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-dynamic-import": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", - "integrity": "sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", - "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-export-namespace-from": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz", - "integrity": "sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", - "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.7.tgz", - "integrity": "sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==", - "dev": true, - "requires": { - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-json-strings": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz", - "integrity": "sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-json-strings": "^7.8.3" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz", - "integrity": "sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-logical-assignment-operators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz", - "integrity": "sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", - "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", - "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.7.tgz", - "integrity": "sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.7.tgz", - "integrity": "sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", - "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", - "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", - "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz", - "integrity": "sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - } - }, - "@babel/plugin-transform-numeric-separator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz", - "integrity": "sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - } - }, - "@babel/plugin-transform-object-rest-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.7.tgz", - "integrity": "sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q==", - "dev": true, - "requires": { - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.24.7" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", - "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7" - } - }, - "@babel/plugin-transform-optional-catch-binding": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz", - "integrity": "sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - } - }, - "@babel/plugin-transform-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.7.tgz", - "integrity": "sha512-tK+0N9yd4j+x/4hxF3F0e0fu/VdcxU18y5SevtyM/PCFlQvXbR0Zmlo2eBrKtVipGNFzpq56o8WsIIKcJFUCRQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", - "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-private-methods": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.7.tgz", - "integrity": "sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-private-property-in-object": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz", - "integrity": "sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", - "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", - "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "regenerator-transform": "^0.15.2" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", - "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", - "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", - "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", - "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", - "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.7.tgz", - "integrity": "sha512-VtR8hDy7YLB7+Pet9IarXjg/zgCMSF+1mNS/EQEiEaUPoFXCVsHG64SIxcaaI2zJgRiv+YmgaQESUfWAdbjzgg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-unicode-escapes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", - "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-unicode-property-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz", - "integrity": "sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", - "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/plugin-transform-unicode-sets-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.7.tgz", - "integrity": "sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" - } - }, - "@babel/preset-env": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.7.tgz", - "integrity": "sha512-1YZNsc+y6cTvWlDHidMBsQZrZfEFjRIo/BZCT906PMdzOyXtSLTgqGdrpcuTDCXyd11Am5uQULtDIcCfnTc8fQ==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.7", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.7", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.7", - "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.24.7", - "@babel/plugin-syntax-import-attributes": "^7.24.7", - "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.24.7", - "@babel/plugin-transform-async-generator-functions": "^7.24.7", - "@babel/plugin-transform-async-to-generator": "^7.24.7", - "@babel/plugin-transform-block-scoped-functions": "^7.24.7", - "@babel/plugin-transform-block-scoping": "^7.24.7", - "@babel/plugin-transform-class-properties": "^7.24.7", - "@babel/plugin-transform-class-static-block": "^7.24.7", - "@babel/plugin-transform-classes": "^7.24.7", - "@babel/plugin-transform-computed-properties": "^7.24.7", - "@babel/plugin-transform-destructuring": "^7.24.7", - "@babel/plugin-transform-dotall-regex": "^7.24.7", - "@babel/plugin-transform-duplicate-keys": "^7.24.7", - "@babel/plugin-transform-dynamic-import": "^7.24.7", - "@babel/plugin-transform-exponentiation-operator": "^7.24.7", - "@babel/plugin-transform-export-namespace-from": "^7.24.7", - "@babel/plugin-transform-for-of": "^7.24.7", - "@babel/plugin-transform-function-name": "^7.24.7", - "@babel/plugin-transform-json-strings": "^7.24.7", - "@babel/plugin-transform-literals": "^7.24.7", - "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", - "@babel/plugin-transform-member-expression-literals": "^7.24.7", - "@babel/plugin-transform-modules-amd": "^7.24.7", - "@babel/plugin-transform-modules-commonjs": "^7.24.7", - "@babel/plugin-transform-modules-systemjs": "^7.24.7", - "@babel/plugin-transform-modules-umd": "^7.24.7", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", - "@babel/plugin-transform-new-target": "^7.24.7", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", - "@babel/plugin-transform-numeric-separator": "^7.24.7", - "@babel/plugin-transform-object-rest-spread": "^7.24.7", - "@babel/plugin-transform-object-super": "^7.24.7", - "@babel/plugin-transform-optional-catch-binding": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7", - "@babel/plugin-transform-parameters": "^7.24.7", - "@babel/plugin-transform-private-methods": "^7.24.7", - "@babel/plugin-transform-private-property-in-object": "^7.24.7", - "@babel/plugin-transform-property-literals": "^7.24.7", - "@babel/plugin-transform-regenerator": "^7.24.7", - "@babel/plugin-transform-reserved-words": "^7.24.7", - "@babel/plugin-transform-shorthand-properties": "^7.24.7", - "@babel/plugin-transform-spread": "^7.24.7", - "@babel/plugin-transform-sticky-regex": "^7.24.7", - "@babel/plugin-transform-template-literals": "^7.24.7", - "@babel/plugin-transform-typeof-symbol": "^7.24.7", - "@babel/plugin-transform-unicode-escapes": "^7.24.7", - "@babel/plugin-transform-unicode-property-regex": "^7.24.7", - "@babel/plugin-transform-unicode-regex": "^7.24.7", - "@babel/plugin-transform-unicode-sets-regex": "^7.24.7", - "@babel/preset-modules": "0.1.6-no-external-plugins", - "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.10.4", - "babel-plugin-polyfill-regenerator": "^0.6.1", - "core-js-compat": "^3.31.0", - "semver": "^6.3.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/preset-modules": { - "version": "0.1.6-no-external-plugins", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", - "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - } - }, - "@babel/regjsgen": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", - "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", - "dev": true - }, - "@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.14.0" - } - }, - "@babel/template": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", - "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7" - } - }, - "@babel/traverse": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", - "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7", - "debug": "^4.3.1", - "globals": "^11.1.0" - } - }, - "@babel/types": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", - "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", - "dev": true, - "requires": { - "@babel/helper-string-parser": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - } - }, - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "@es-joy/jsdoccomment": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", - "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", - "dev": true, - "requires": { - "@types/eslint": "^8.56.5", - "@types/estree": "^1.0.5", - "@typescript-eslint/types": "^7.2.0", - "comment-parser": "1.4.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" - } - }, - "@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", - "dev": true, - "optional": true - }, - "@esbuild/android-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", - "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", - "dev": true, - "optional": true - }, - "@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", - "dev": true, - "optional": true - }, - "@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", - "dev": true, - "optional": true - }, - "@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", - "dev": true, - "optional": true - }, - "@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", - "dev": true, - "optional": true - }, - "@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", - "dev": true, - "optional": true - }, - "@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", - "dev": true, - "optional": true - }, - "@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", - "dev": true, - "optional": true - }, - "@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", - "dev": true, - "optional": true - }, - "@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", - "dev": true, - "optional": true - }, - "@esbuild/linux-loong64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", - "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", - "dev": true, - "optional": true - }, - "@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", - "dev": true, - "optional": true - }, - "@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", - "dev": true, - "optional": true - }, - "@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", - "dev": true, - "optional": true - }, - "@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", - "dev": true, - "optional": true - }, - "@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", - "dev": true, - "optional": true - }, - "@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", - "dev": true, - "optional": true - }, - "@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", - "dev": true, - "optional": true - }, - "@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", - "dev": true, - "optional": true - }, - "@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", - "dev": true, - "optional": true - }, - "@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", - "dev": true, - "optional": true - }, - "@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", - "dev": true, - "optional": true - }, - "@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "requires": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - } - }, - "@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true - }, - "@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "requires": { - "@sinclair/typebox": "^0.27.8" - } - }, - "@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "optional": true - }, - "@polka/url": { - "version": "1.0.0-next.25", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", - "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", - "dev": true - }, - "@rollup/plugin-alias": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz", - "integrity": "sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==", - "dev": true, - "requires": { - "slash": "^4.0.0" - } - }, - "@rollup/plugin-babel": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", - "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.18.6", - "@rollup/pluginutils": "^5.0.1" - } - }, - "@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", - "dev": true, - "requires": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" - }, - "dependencies": { - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - } - } - }, - "@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", - "dev": true, - "optional": true - }, - "@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", - "dev": true, - "optional": true - }, - "@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", - "dev": true, - "optional": true - }, - "@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", - "dev": true, - "optional": true - }, - "@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", - "dev": true, - "optional": true - }, - "@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", - "dev": true, - "optional": true - }, - "@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", - "dev": true, - "optional": true - }, - "@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", - "dev": true, - "optional": true - }, - "@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "@ts-morph/common": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", - "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", - "dev": true, - "requires": { - "fast-glob": "^3.3.2", - "minimatch": "^9.0.3", - "mkdirp": "^3.0.1", - "path-browserify": "^1.0.1" - } - }, - "@types/cytoscape": { - "version": "3.21.2", - "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.2.tgz", - "integrity": "sha512-eadSCH9hbRV9Ej93S8wact/Oe0DuQV4qlWfST/I6k4lBu6RgqI6mVFzvppcIGzWpzZRu7iyFjFhS2qW0w7KFRA==", - "dev": true - }, - "@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "@typescript-eslint/types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", - "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", - "dev": true - }, - "@typhonjs-build-test/esm-d-ts": { - "version": "0.3.0-next.7", - "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", - "integrity": "sha512-xZS7Zz0LJZhdCV6z5NpwrKIMdghQdzypxSZ5iYB0FY+UQers5YkGW7BRs19XW8os0+LnP2ktZzWR2W5SkyHNuQ==", - "dev": true, - "requires": { - "@es-joy/jsdoccomment": "^0.43.0", - "@rollup/plugin-alias": "^5.1.0", - "@types/cytoscape": "^3.21.2", - "@typhonjs-build-test/rollup-plugin-pkg-imports": "^0.5.0", - "@typhonjs-plugin/manager": "^0.1.2", - "@typhonjs-utils/file-util": "^0.1.0", - "@typhonjs-utils/logger-color": "^0.1.0", - "@typhonjs-utils/object": "^0.1.0", - "@typhonjs-utils/package-json": "^0.7.0", - "comment-parser": "^1.4.0", - "cytoscape": "^3.29.0", - "es-module-lexer": "^1.5.0", - "fs-extra": "^11.2.0", - "glob-to-regexp": "^0.4.0", - "import-meta-resolve": "^4.1.0", - "prettier": "^3.2.0", - "resolve.exports": "^2.0.2", - "rollup-plugin-dts": "^6.1.0", - "sade": "^1.8.1", - "ts-morph": "^22.0.0", - "type-fest": "^4.18.0", - "upath": "^2.0.1" - } - }, - "@typhonjs-build-test/rollup-plugin-pkg-imports": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@typhonjs-build-test/rollup-plugin-pkg-imports/-/rollup-plugin-pkg-imports-0.5.0.tgz", - "integrity": "sha512-YAcRIETyEw4zMuQsJNQrOFHo/lqml88lligtClSSAQXnGT6ez0jiluDhxjzkJAQ2NGdALh09CGNL/xZgtUecCQ==", - "dev": true, - "requires": { - "@typhonjs-utils/package-json": "^0.7.0", - "glob-to-regexp": "^0.4.1", - "import-meta-resolve": "^4.0.0", - "resolve.exports": "^2.0.2" - } - }, - "@typhonjs-plugin/manager": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@typhonjs-plugin/manager/-/manager-0.1.2.tgz", - "integrity": "sha512-bMtnjVlqeiPjmW/U+rBm5Mb+ZoZs7uKyZYN3Rtq0DXzndyMrIDBOiQyssSwGxpFVDC7V9yArvt0EoGWDxAIYLQ==", - "dev": true - }, - "@typhonjs-typedoc/ts-lib-docs": { - "version": "2023.7.12", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2023.7.12.tgz", - "integrity": "sha512-vaiDbYGjnx7+gMM7KWSgNpGFxqr2Gw5MYpi9hvLWt8/nZ98EaTo1M4WjT6XtgbCw0w0x7greMlYWLgk7Mak/TA==", - "dev": true, - "requires": {} - }, - "@typhonjs-typedoc/typedoc-pkg": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.0.5.tgz", - "integrity": "sha512-+0sLiuJJqEpptYizN/od1tzEmJIkheWIeJ+xV8ONzbNeXtWkUAHA5PzBEmXr2xxJQRpUhV5cYI0fQOAwOFcx5Q==", - "dev": true, - "requires": { - "@typhonjs-typedoc/ts-lib-docs": "2023.7.12", - "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0-next.14", - "@typhonjs-utils/file-util": "^0.1.0", - "@typhonjs-utils/logger-color": "^0.1.0", - "@typhonjs-utils/object": "^0.1.0", - "@typhonjs-utils/package-json": "^0.7.0", - "glob": "^10.3.10", - "is-glob": "^4.0.3", - "resolve.exports": "^2.0.2", - "sade": "^1.8.1", - "upath": "^2" - } - }, - "@typhonjs-typedoc/typedoc-theme-dmt": { - "version": "0.2.0-next.14", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0-next.14.tgz", - "integrity": "sha512-ucMzhwtF/MKGqHxkCIpfrWMgZxdhfWLcAvwiEkgWpbmCmQUKhh6V+yGyHUG9TqRkZJCGXvgqNoziVyEYQKt/xw==", - "dev": true, - "requires": { - "cheerio": "^1.0.0-rc.12" - } - }, - "@typhonjs-utils/file-util": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", - "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", - "dev": true, - "requires": { - "upath": "^2" - } - }, - "@typhonjs-utils/logger-color": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/logger-color/-/logger-color-0.1.0.tgz", - "integrity": "sha512-BWXSwxs5ZDVs4vi/YxJLLN3287+i4Z/KXqQuKUN5o5qWc4ioYU+ws9svZSL1XzqkLpF+j2oALhE8l0pmPydWxg==", - "dev": true - }, - "@typhonjs-utils/object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/object/-/object-0.1.0.tgz", - "integrity": "sha512-XCG2Qae6FZzzm81q0ya3D/xBRKlXF8lELi5T2E+nNYjqzi9T+2LTCUKR84dpo856wXAFn3CdTvDQKn5OVVnLlQ==", - "dev": true - }, - "@typhonjs-utils/package-json": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/package-json/-/package-json-0.7.0.tgz", - "integrity": "sha512-aFoXJuGJqUuPJ+00/voU/iIc1bPDx0nJBGHt0ntyc1XmQOZDuwq7mLpHGsdIXZlF1lMSX/B9AFtlLATSyVWrVQ==", - "dev": true - }, - "@vitest/coverage-v8": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", - "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", - "dev": true, - "requires": { - "@ampproject/remapping": "^2.2.1", - "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.4", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.4", - "istanbul-reports": "^3.1.6", - "magic-string": "^0.30.5", - "magicast": "^0.3.3", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0" - } - }, - "@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", - "dev": true, - "requires": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" - } - }, - "@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", - "dev": true, - "requires": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" - } - }, - "@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", - "dev": true, - "requires": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" - } - }, - "@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", - "dev": true, - "requires": { - "tinyspy": "^2.2.0" - } - }, - "@vitest/ui": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", - "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", - "dev": true, - "requires": { - "@vitest/utils": "1.6.0", - "fast-glob": "^3.3.2", - "fflate": "^0.8.1", - "flatted": "^3.2.9", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "sirv": "^2.0.4" - } - }, - "@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", - "dev": true, - "requires": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" - } - }, - "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true - }, - "acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true - }, - "ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - }, - "ansi-sequence-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", - "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", - "dev": true - }, - "ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, - "babel-plugin-polyfill-corejs2": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", - "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.6.2", - "semver": "^6.3.1" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "babel-plugin-polyfill-corejs3": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", - "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", - "dev": true, - "requires": { - "@babel/helper-define-polyfill-provider": "^0.6.1", - "core-js-compat": "^3.36.1" - } - }, - "babel-plugin-polyfill-regenerator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz", - "integrity": "sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==", - "dev": true, - "requires": { - "@babel/helper-define-polyfill-provider": "^0.6.2" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "requires": { - "fill-range": "^7.1.1" - } - }, - "browserslist": { - "version": "4.23.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", - "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001629", - "electron-to-chromium": "^1.4.796", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.16" - } - }, - "cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true - }, - "caniuse-lite": { - "version": "1.0.30001634", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001634.tgz", - "integrity": "sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==", - "dev": true - }, - "chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - } - } - }, - "check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "requires": { - "get-func-name": "^2.0.2" - } - }, - "cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "dev": true, - "requires": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" - } - }, - "cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - } - }, - "code-block-writer": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", - "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==", - "dev": true - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "comment-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", - "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", - "dev": true - }, - "convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "core-js-compat": { - "version": "3.37.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", - "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", - "dev": true, - "requires": { - "browserslist": "^4.23.0" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - } - }, - "css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true - }, - "cytoscape": { - "version": "3.29.2", - "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.29.2.tgz", - "integrity": "sha512-2G1ycU28Nh7OHT9rkXRLpCDP30MKH1dXJORZuBhtEhEW7pKwgPi77ImqlCWinouyE1PNepIOGZBOrE84DG7LyQ==", - "dev": true - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true - }, - "dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "requires": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - } - }, - "domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true - }, - "domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "requires": { - "domelementtype": "^2.3.0" - } - }, - "domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "requires": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - } - }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.4.803", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.803.tgz", - "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", - "dev": true - }, - "emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true - }, - "es-module-lexer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", - "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", - "dev": true - }, - "esbuild": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", - "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", - "dev": true, - "requires": { - "@esbuild/aix-ppc64": "0.21.4", - "@esbuild/android-arm": "0.21.4", - "@esbuild/android-arm64": "0.21.4", - "@esbuild/android-x64": "0.21.4", - "@esbuild/darwin-arm64": "0.21.4", - "@esbuild/darwin-x64": "0.21.4", - "@esbuild/freebsd-arm64": "0.21.4", - "@esbuild/freebsd-x64": "0.21.4", - "@esbuild/linux-arm": "0.21.4", - "@esbuild/linux-arm64": "0.21.4", - "@esbuild/linux-ia32": "0.21.4", - "@esbuild/linux-loong64": "0.21.4", - "@esbuild/linux-mips64el": "0.21.4", - "@esbuild/linux-ppc64": "0.21.4", - "@esbuild/linux-riscv64": "0.21.4", - "@esbuild/linux-s390x": "0.21.4", - "@esbuild/linux-x64": "0.21.4", - "@esbuild/netbsd-x64": "0.21.4", - "@esbuild/openbsd-x64": "0.21.4", - "@esbuild/sunos-x64": "0.21.4", - "@esbuild/win32-arm64": "0.21.4", - "@esbuild/win32-ia32": "0.21.4", - "@esbuild/win32-x64": "0.21.4" - }, - "dependencies": { - "@esbuild/aix-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", - "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", - "dev": true, - "optional": true - }, - "@esbuild/android-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", - "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", - "dev": true, - "optional": true - }, - "@esbuild/android-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", - "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", - "dev": true, - "optional": true - }, - "@esbuild/darwin-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", - "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", - "dev": true, - "optional": true - }, - "@esbuild/darwin-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", - "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", - "dev": true, - "optional": true - }, - "@esbuild/freebsd-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", - "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", - "dev": true, - "optional": true - }, - "@esbuild/freebsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", - "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", - "dev": true, - "optional": true - }, - "@esbuild/linux-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", - "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", - "dev": true, - "optional": true - }, - "@esbuild/linux-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", - "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", - "dev": true, - "optional": true - }, - "@esbuild/linux-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", - "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", - "dev": true, - "optional": true - }, - "@esbuild/linux-mips64el": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", - "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", - "dev": true, - "optional": true - }, - "@esbuild/linux-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", - "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", - "dev": true, - "optional": true - }, - "@esbuild/linux-riscv64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", - "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", - "dev": true, - "optional": true - }, - "@esbuild/linux-s390x": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", - "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", - "dev": true, - "optional": true - }, - "@esbuild/linux-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", - "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", - "dev": true, - "optional": true - }, - "@esbuild/netbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", - "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", - "dev": true, - "optional": true - }, - "@esbuild/openbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", - "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", - "dev": true, - "optional": true - }, - "@esbuild/sunos-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", - "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", - "dev": true, - "optional": true - }, - "@esbuild/win32-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", - "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", - "dev": true, - "optional": true - }, - "@esbuild/win32-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", - "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", - "dev": true, - "optional": true - }, - "@esbuild/win32-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", - "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", - "dev": true, - "optional": true - } - } - }, - "escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "requires": { - "@types/estree": "^1.0.0" - } - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - } - }, - "fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fflate": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", - "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", - "dev": true - }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true - }, - "foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - } - }, - "fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true - }, - "get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true - }, - "get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true - }, - "glob": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", - "dev": true, - "requires": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "path-scurry": "^1.11.1" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "requires": { - "function-bind": "^1.1.2" - } - }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", - "dev": true, - "requires": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" - } - }, - "human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true - }, - "import-meta-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", - "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, - "requires": { - "hasown": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", - "dev": true - }, - "istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", - "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.23", - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0" - } - }, - "istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "jackspeak": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", - "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", - "dev": true, - "requires": { - "@isaacs/cliui": "^8.0.2", - "@pkgjs/parseargs": "^0.11.0" - } - }, - "js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, - "jsdoc-type-pratt-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", - "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true - }, - "jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "requires": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - } - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true - }, - "loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "requires": { - "get-func-name": "^2.0.1" - } - }, - "lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", - "dev": true - }, - "lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, - "magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", - "dev": true, - "requires": { - "@jridgewell/sourcemap-codec": "^1.4.15" - } - }, - "magicast": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", - "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", - "dev": true, - "requires": { - "@babel/parser": "^7.24.4", - "@babel/types": "^7.24.0", - "source-map-js": "^1.2.0" - } - }, - "make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "requires": { - "semver": "^7.5.3" - } - }, - "marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", - "dev": true - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", - "dev": true, - "requires": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - } - }, - "mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true - }, - "minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true - }, - "mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "dev": true - }, - "mlly": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", - "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", - "dev": true, - "requires": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.1.0", - "ufo": "^1.5.3" - } - }, - "mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true - }, - "mrmime": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", - "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true - }, - "node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "dev": true - }, - "npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "requires": { - "path-key": "^4.0.0" - }, - "dependencies": { - "path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true - } - } - }, - "nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "requires": { - "boolbase": "^1.0.0" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "requires": { - "mimic-fn": "^4.0.0" - } - }, - "p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dev": true, - "requires": { - "yocto-queue": "^1.0.0" - } - }, - "parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dev": true, - "requires": { - "entities": "^4.4.0" - } - }, - "parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", - "dev": true, - "requires": { - "domhandler": "^5.0.2", - "parse5": "^7.0.0" - } - }, - "path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "requires": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - } - }, - "pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true - }, - "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true - }, - "picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pkg-types": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", - "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", - "dev": true, - "requires": { - "confbox": "^0.1.7", - "mlly": "^1.7.0", - "pathe": "^1.1.2" - } - }, - "postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", - "dev": true, - "requires": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" - } - }, - "prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", - "dev": true - }, - "pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "requires": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - } - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, - "regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", - "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", - "dev": true, - "requires": { - "regenerate": "^1.4.2" - } - }, - "regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true - }, - "regenerator-transform": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", - "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4" - } - }, - "regexpu-core": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", - "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", - "dev": true, - "requires": { - "@babel/regjsgen": "^0.8.0", - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsparser": "^0.9.1", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.1.0" - } - }, - "regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true - } - } - }, - "resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "requires": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", - "dev": true, - "requires": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", - "@types/estree": "1.0.5", - "fsevents": "~2.3.2" - } - }, - "rollup-plugin-dts": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz", - "integrity": "sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.24.2", - "magic-string": "^0.30.10" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dev": true, - "requires": { - "mri": "^1.1.0" - } - }, - "semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "shiki": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", - "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", - "dev": true, - "requires": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, - "siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true - }, - "signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true - }, - "sirv": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", - "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", - "dev": true, - "requires": { - "@polka/url": "^1.0.0-next.24", - "mrmime": "^2.0.0", - "totalist": "^3.0.0" - } - }, - "slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true - }, - "source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", - "dev": true - }, - "stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, - "std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true - }, - "string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "requires": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - } - }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } - }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - } - } - }, - "strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true - }, - "strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", - "dev": true, - "requires": { - "js-tokens": "^9.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "tinybench": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", - "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", - "dev": true - }, - "tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", - "dev": true - }, - "tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "totalist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", - "dev": true - }, - "ts-morph": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", - "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", - "dev": true, - "requires": { - "@ts-morph/common": "~0.23.0", - "code-block-writer": "^13.0.1" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-fest": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", - "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", - "dev": true - }, - "typedoc": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", - "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", - "dev": true, - "requires": { - "lunr": "^2.3.9", - "marked": "^4.3.0", - "minimatch": "^9.0.3", - "shiki": "^0.14.7" - } - }, - "typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "dev": true - }, - "ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", - "dev": true - }, - "unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", - "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", - "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", - "dev": true - }, - "universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true - }, - "upath": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", - "dev": true - }, - "update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", - "dev": true, - "requires": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" - } - }, - "vite": { - "version": "5.2.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", - "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", - "dev": true, - "requires": { - "esbuild": "^0.20.1", - "fsevents": "~2.3.3", - "postcss": "^8.4.38", - "rollup": "^4.13.0" - }, - "dependencies": { - "@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", - "dev": true, - "optional": true - }, - "@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", - "dev": true, - "optional": true - }, - "esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", - "dev": true, - "requires": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" - } - } - } - }, - "vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", - "dev": true, - "requires": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - } - }, - "vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", - "dev": true, - "requires": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", - "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" - } - }, - "vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true - }, - "vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", - "dev": true, - "requires": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - } - }, - "wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true - } - } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true - } } } diff --git a/package.json b/package.json index a3fb347b..28cc1e4f 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,14 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, + "./cdn": { + "types": "./dist-cdn/types/gl-matrix-f32.d.mts", + "import": "./dist-cdn/esm/2022/gl-matrix-f32.js" + }, + "./cdn/f64": { + "types": "./dist-cdn/types/gl-matrix-f64.d.mts", + "import": "./dist-cdn/esm/2022/gl-matrix-f64.js" + }, "./classic": { "types": "./dist/classic/index.d.mts", "import": "./dist/classic/index.js", @@ -54,6 +62,16 @@ "import": "./dist/types/index.js", "require": "./dist/types/index.cjs" }, + "./types/cdn/umd": { + "types": "./dist-cdn/types/globals-f32.d.mts", + "import": "./dist-cdn/types/index.js", + "require": "./dist-cdn/types/index.cjs" + }, + "./types/cdn/umd/f64": { + "types": "./dist-cdn/types/globals-f64.d.mts", + "import": "./dist-cdn/types/index.js", + "require": "./dist-cdn/types/index.cjs" + }, "./types/swizzle": { "types": "./dist/types/swizzle/index.d.mts", "import": "./dist/types/swizzle/index.js", @@ -102,14 +120,15 @@ "webgpu" ], "scripts": { - "build": "npm run gen64 && tsc --project tsconfig-build.json && node scripts/bundle/bundle.js", + "build": "node scripts/build.js", "build-all": "npm run build && npm run types && npm run docs && npm run docs-cdn", "docs": "typedoc-pkg --api-link es", - "docs-cdn": "typedoc-pkg --api-link es --path dist-cdn/types/gl-matrix-f32.d.mts:dist-cdn/types/gl-matrix-f64.d.mts --output docs/cdn --typedoc typedoc-cdn.json", + "docs-cdn": "typedoc-pkg --api-link es --output docs/cdn --typedoc typedoc-cdn.json", "gen64": "node scripts/gen-f64.js", "test": "vitest run", "test-ui": "vitest --ui --coverage", - "types": "esm-d-ts gen -c" + "types": "esm-d-ts gen -c", + "build-test": "node scripts/test-build.js" }, "devDependencies": { "@babel/core": "^7.24.7", @@ -117,7 +136,6 @@ "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", - "@typhonjs-utils/file-util": "^0.1.0", "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.6.0", "esbuild": "^0.21.0", diff --git a/scripts/build.js b/scripts/build.js new file mode 100644 index 00000000..53b53a66 --- /dev/null +++ b/scripts/build.js @@ -0,0 +1,214 @@ +import * as esbuild from 'esbuild'; +import * as fs from 'fs'; +import { rollup } from 'rollup'; +import { babel } from '@rollup/plugin-babel'; + +import { executeGenF64 } from './gen-f64.js'; + +// Generate 64-bit source -------------------------------------------------------------------------------------------- + +executeGenF64(); + +// ESBuild data ------------------------------------------------------------------------------------------------------ + +const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + +const bannerText = `// gl-matrix - v${pkg.version} - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)`; + +const banner = { js: bannerText }; + +// Add the `package.json` imports as alias mapping for ESBuild removing the leading `#`. +const alias = Object.assign({}, ...Object.keys(pkg.imports).map((key) => ({ [key]: key.slice(1) }))); + +// Add the `package.json` imports as external for ESBuild removing the leading `#`. +const external = Object.keys(pkg.imports).map((key) => key.slice(1)); + +// Bundling ---------------------------------------------------------------------------------------------------------- + +try { + const promises = []; + + // Main package / sub-path exports --------------------------------------------------------------------------------- + + const mainEsbuildOptions = { + logLevel: 'info', + entryPoints: [ + { in: 'src/index.ts', out: 'index' }, // gl-matrix + { in: 'src/classic/index.ts', out: 'classic/index' }, // gl-matrix/classic + { in: 'src/common/index.ts', out: 'common/index' }, // gl-matrix/common + { in: 'src/f64/index.ts', out: 'f64/index' }, // gl-matrix/f64 + { in: 'src/swizzle/index.ts', out: 'swizzle/index' }, // gl-matrix/swizzle + { in: 'src/swizzle/f64/index.ts', out: 'swizzle/f64/index' }, // gl-matrix/swizzle/f64 + { in: 'src/types/index.ts', out: 'types/index' }, // gl-matrix/types + { in: 'src/types/swizzle/index.ts', out: 'types/swizzle/index' }, // gl-matrix/types + { in: 'src/types/swizzle/f64/index.ts', out: 'types/swizzle/f64/index' }, // gl-matrix/types + { in: 'src/util/index.ts', out: 'util/index' }, // gl-matrix/util + ], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'esm', + outdir: 'dist', + external, // Do not bundle across package paths. + alias + }; + + promises.push(esbuild.build(mainEsbuildOptions)); + + // Minified main ESM bundles ------ + + mainEsbuildOptions.minify = true; + mainEsbuildOptions.outExtension = { '.js': '.min.js' }; + + promises.push(esbuild.build(mainEsbuildOptions)); + + // CJS bundles -------------------- + + mainEsbuildOptions.minify = false; + mainEsbuildOptions.format = 'cjs'; + mainEsbuildOptions.outExtension = { '.js': '.cjs' }; + + promises.push(esbuild.build(mainEsbuildOptions)); + +// CDN ESM Bundles --------------------------------------------------------------------------------------------------- + + const cdnEsbuildOptions = { + logLevel: 'info', + entryPoints: [ + { in: 'src/cdn/index.ts', out: 'gl-matrix-f32' }, // 32-bit + { in: 'src/cdn/f64/index.ts', out: 'gl-matrix-f64' }, // 64-bit + ], + bundle: true, + minify: false, + sourcemap: true, + banner, + format: 'esm', + outdir: 'dist-cdn/esm/2022', + }; + + promises.push(esbuild.build(cdnEsbuildOptions)); + + // Minified 2022 CDN bundles ------ + + cdnEsbuildOptions.minify = true; + cdnEsbuildOptions.outExtension = { '.js': '.min.js' }; + + promises.push(esbuild.build(cdnEsbuildOptions)); + + // Minified 2016 CDN bundles ------ + + cdnEsbuildOptions.outdir = 'dist-cdn/esm/2016'; + cdnEsbuildOptions.target = 'es2016'; + + promises.push(esbuild.build(cdnEsbuildOptions)); + + // 2016 CDN bundles --------------- + + cdnEsbuildOptions.minify = false; + cdnEsbuildOptions.outExtension = void 0; + + promises.push(esbuild.build(cdnEsbuildOptions)); + + // Await all ESBuild promises before continuing. + await Promise.allSettled(promises); + +// Generate UMD bundles with Rollup ---------------------------------------------------------------------------------- + + const rollupConfigs = [ + // ES5 / UMD CDN Release (32-bit) + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f32.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner: bannerText, + file: 'dist-cdn/umd/gl-matrix-f32.js', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrix', + sourcemap: true + } + }, + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f32.min.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner: bannerText, + file: 'dist-cdn/umd/gl-matrix-f32.min.js', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrix', + sourcemap: true + } + }, + + // ES5 / UMD CDN Release (64-bit) + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f64.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner: bannerText, + file: 'dist-cdn/umd/gl-matrix-f64.js', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrixF64', + sourcemap: true + } + }, + { + input: { + input: 'dist-cdn/esm/2016/gl-matrix-f64.min.js', + plugins: [ + babel({ + babelHelpers: 'bundled', + presets: ['@babel/preset-env'] + }) + ] + }, + output: { + banner: bannerText, + file: 'dist-cdn/umd/gl-matrix-f64.min.js', + format: 'umd', + generatedCode: 'es5', + name: 'glMatrixF64', + sourcemap: true + } + } + ]; + + for (const config of rollupConfigs) { + console.log(`Generating UMD bundle: ${config.input.input}`); + + const bundle = await rollup(config.input); + await bundle.write(config.output); + await bundle.close(); + } +} +catch(err) { + console.error(err); + process.exit(1); +} diff --git a/scripts/bundle/bundle.js b/scripts/bundle/bundle.js deleted file mode 100644 index aa92d23f..00000000 --- a/scripts/bundle/bundle.js +++ /dev/null @@ -1,370 +0,0 @@ -import * as esbuild from 'esbuild'; -import * as fs from 'fs'; -import { rollup } from 'rollup'; -import { babel } from '@rollup/plugin-babel'; -import { getFileList } from '@typhonjs-utils/file-util'; - -const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); - -// ESBuild data ------------------------------------------------------------------------------------------------------ - -const bannerText = `// glMatrix - v${pkg.version}`; - -const banner = { js: bannerText }; - -// Add the `package.json` imports as external for ESBuild removing the leading `#`. -const external = Object.keys(pkg.imports ?? {}).map((key) => key.slice(1)); - -// Rewrite `imports` from `package.json` with actual main / sub-path export path. ------------------------------------ - -// Retrieve a list of all `*.js` files from `./dist` and subdirectories. -const list = await getFileList({ dir: './dist', includeFile: /\.js$/, walk: true }); - -// Replace all instances of `#gl-matrix` with `gl-matrix` and add leading banner. -for (const file of list) { - const filepath = `./dist/${file}`; - let srcFile = fs.readFileSync(filepath, 'utf8'); - srcFile = srcFile.replaceAll('#gl-matrix', 'gl-matrix'); - fs.writeFileSync(filepath, `${banner.js}\n${srcFile}`); -} - -// Common JS Bundles ------------------------------------------------------------------------------------------------- - -try { - const promises = []; - - // `gl-matrix/classic` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/classic/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/classic/index.cjs', - })); - - // `gl-matrix/common` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/common/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/common/index.cjs', - })); - - // Main `gl-matrix` export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/index.cjs', - })); - - // `gl-matrix/f64` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/f64/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/f64/index.cjs', - })); - - // `gl-matrix/swizzle` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/swizzle/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/swizzle/index.cjs', - })); - - // `gl-matrix/swizzle/f64` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/swizzle/f64/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/swizzle/f64/index.cjs', - })); - - // `gl-matrix/types` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/types/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/types/index.cjs', - })); - - // `gl-matrix/types/swizzle` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/types/swizzle/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/types/swizzle/index.cjs', - })); - - // `gl-matrix/types/swizzle/f64` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/types/swizzle/f64/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/types/swizzle/f64/index.cjs', - })); - - // `gl-matrix/util` sub-path export. - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['dist/util/index.js'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'cjs', - external, - outfile: 'dist/util/index.cjs', - })); - -// CDN ESM Bundles --------------------------------------------------------------------------------------------------- - -// ESM 2022 ------------------------------------------ - - // 2022 Standard Release (Float32) - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2022/gl-matrix-f32.js', - })); - - // 2022 Standard Release (Float32) Minified - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], - bundle: true, - minify: true, - sourcemap: true, - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2022/gl-matrix-f32.min.js', - })); - - // 2022 Standard Release (Float64) - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], - bundle: true, - minify: false, - sourcemap: true, - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2022/gl-matrix-f64.js', - })); - - // 2022 Standard Release (Float64) Minified - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], - bundle: true, - minify: true, - sourcemap: true, - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2022/gl-matrix-f64.min.js', - })); - -// ESM 2016 / ES6 ------------------------------------ - - // ES6 Standard Release (Float32) - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], - bundle: true, - minify: false, - sourcemap: true, - target: 'es2016', - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2016/gl-matrix-f32.js', - })); - - // ES6 Standard Release (Float32) Minified - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f32.ts'], - bundle: true, - minify: true, - sourcemap: true, - target: 'es2016', - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2016/gl-matrix-f32.min.js', - })); - - // ES6 Standard Release (Float64) - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], - bundle: true, - minify: false, - sourcemap: true, - target: 'es2016', - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2016/gl-matrix-f64.js', - })); - - // ES6 Standard Release (Float64) Minified - promises.push(esbuild.build({ - logLevel: 'info', - entryPoints: ['scripts/bundle/cdn-entry-f64.ts'], - bundle: true, - minify: true, - sourcemap: true, - target: 'es2016', - banner, - format: 'esm', - outfile: 'dist-cdn/esm/2016/gl-matrix-f64.min.js', - })); - - await Promise.allSettled(promises); - -// Generate UMD bundles with Rollup ------------------ - - const rollupConfigs = [ - // ES5 / UMD CDN Release (Float32) - { - input: { - input: 'dist-cdn/esm/2016/gl-matrix-f32.js', - plugins: [ - babel({ - babelHelpers: 'bundled', - presets: ['@babel/preset-env'] - }) - ] - }, - output: { - banner: bannerText, - file: 'dist-cdn/umd/gl-matrix-f32.cjs', - format: 'umd', - generatedCode: 'es5', - name: 'glMatrix', - sourcemap: true - } - }, - { - input: { - input: 'dist-cdn/esm/2016/gl-matrix-f32.min.js', - plugins: [ - babel({ - babelHelpers: 'bundled', - presets: ['@babel/preset-env'] - }) - ] - }, - output: { - banner: bannerText, - file: 'dist-cdn/umd/gl-matrix-f32.min.cjs', - format: 'umd', - generatedCode: 'es5', - name: 'glMatrix', - sourcemap: true - } - }, - - // ES5 / UMD CDN Release (Float64) - { - input: { - input: 'dist-cdn/esm/2016/gl-matrix-f64.js', - plugins: [ - babel({ - babelHelpers: 'bundled', - presets: ['@babel/preset-env'] - }) - ] - }, - output: { - banner: bannerText, - file: 'dist-cdn/umd/gl-matrix-f64.cjs', - format: 'umd', - generatedCode: 'es5', - name: 'glMatrix', - sourcemap: true - } - }, - { - input: { - input: 'dist-cdn/esm/2016/gl-matrix-f64.min.js', - plugins: [ - babel({ - babelHelpers: 'bundled', - presets: ['@babel/preset-env'] - }) - ] - }, - output: { - banner: bannerText, - file: 'dist-cdn/umd/gl-matrix-f64.min.cjs', - format: 'umd', - generatedCode: 'es5', - name: 'glMatrix', - sourcemap: true - } - } - ]; - - for (const config of rollupConfigs) { - console.log(`Generating UMD bundle: ${config.input.input}`); - - const bundle = await rollup(config.input); - await bundle.write(config.output); - await bundle.close(); - } -} -catch(err) { - console.error(err); - process.exit(1); -} - diff --git a/scripts/bundle/cdn-entry-f64.ts b/src/cdn/f64/index.ts similarity index 93% rename from scripts/bundle/cdn-entry-f64.ts rename to src/cdn/f64/index.ts index 7e312a64..7e48871d 100644 --- a/scripts/bundle/cdn-entry-f64.ts +++ b/src/cdn/f64/index.ts @@ -4,6 +4,7 @@ * @packageDocumentation */ +/* v8 ignore next 5 */ export * from '#gl-matrix/f64'; export * from '#gl-matrix/swizzle/f64'; export * from '#gl-matrix/types'; diff --git a/scripts/bundle/cdn-entry-f32.ts b/src/cdn/index.ts similarity index 94% rename from scripts/bundle/cdn-entry-f32.ts rename to src/cdn/index.ts index 3bc02293..7b222da3 100644 --- a/scripts/bundle/cdn-entry-f32.ts +++ b/src/cdn/index.ts @@ -4,6 +4,7 @@ * @packageDocumentation */ +/* v8 ignore next 6 */ export * from '#gl-matrix'; export * from '#gl-matrix/classic'; export * from '#gl-matrix/swizzle'; diff --git a/tests/classic-api.spec.ts b/tests/other/classic-api.spec.ts similarity index 100% rename from tests/classic-api.spec.ts rename to tests/other/classic-api.spec.ts diff --git a/tsconfig-build.json b/tsconfig-build.json deleted file mode 100644 index 024795c3..00000000 --- a/tsconfig-build.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "skipLibCheck": true - }, - "include": ["src/**/*"] -} diff --git a/tsconfig.json b/tsconfig.json index dc348943..23641bfb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,8 @@ { "compilerOptions": { - "target": "ESNext", - "module": "NodeNext", "lib": ["ESNext", "DOM"], - "outDir": "dist", - "rootDir": "./src", - "sourceMap": true, - "moduleResolution": "NodeNext", - "declaration": false + "module": "NodeNext", + "moduleResolution": "NodeNext" }, "include": [ "src/**/*", diff --git a/typedoc-cdn.json b/typedoc-cdn.json new file mode 100644 index 00000000..a7b9a755 --- /dev/null +++ b/typedoc-cdn.json @@ -0,0 +1,33 @@ +{ + "name": "gl-matrix (CDN Distribution)", + "basePath": ".", + "exclude": ["./dist/**/*"], + "out": "docs/cdn", + "readme": "./README-CDN.md", + "categoryOrder": [ + "Constructor", + "Static", + "Accessors", + "Methods", + "Color Components", + "Vector Components", + "Quaternion Components", + "Swizzle Accessors (Optional)", + "*" + ], + "defaultCategory": "Inherited", + "dmtLinksIcon": [ + { + "icon": "./assets/icon/gl-matrix-icon-mono-64.webp", + "title": "Homepage", + "url": "https://glmatrix.net/" + } + ], + "dmtLinksService": { + "GitHub": "https://github.com/toji/gl-matrix", + "NPM": "https://www.npmjs.com/package/gl-matrix" + }, + "sidebarLinks": { + "Go to: Node / NPM Distribution": "https://typhonjs-svelte-scratch.github.io/gl-matrix-beta3-dist/" + } +} diff --git a/typedoc.json b/typedoc.json index ee8044df..cd7a0938 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,4 +1,7 @@ { + "name": "gl-matrix (Node / NPM Distribution)", + "basePath": ".", + "exclude": ["dist-cdn/types/*"], "categoryOrder": [ "Constructor", "Static", @@ -21,5 +24,8 @@ "dmtLinksService": { "GitHub": "https://github.com/toji/gl-matrix", "NPM": "https://www.npmjs.com/package/gl-matrix" + }, + "sidebarLinks": { + "Go to: CDN Distribution": "https://typhonjs-svelte-scratch.github.io/gl-matrix-beta3-dist/cdn" } } From 7fd98ac32936673e75d541c7bd0532d7174be227 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sun, 23 Jun 2024 01:03:17 -0700 Subject: [PATCH 07/16] Added ESLint. --- .editorconfig | 11 + .gitattributes | 2 + README-CDN.md | 8 +- dist-cdn/esm/2016/gl-matrix-f32.js | 587 +++-- dist-cdn/esm/2016/gl-matrix-f32.js.map | 4 +- dist-cdn/esm/2016/gl-matrix-f32.min.js | 2 +- dist-cdn/esm/2016/gl-matrix-f32.min.js.map | 4 +- dist-cdn/esm/2016/gl-matrix-f64.js | 587 +++-- dist-cdn/esm/2016/gl-matrix-f64.js.map | 4 +- dist-cdn/esm/2016/gl-matrix-f64.min.js | 2 +- dist-cdn/esm/2016/gl-matrix-f64.min.js.map | 4 +- dist-cdn/esm/2022/gl-matrix-f32.js | 587 +++-- dist-cdn/esm/2022/gl-matrix-f32.js.map | 4 +- dist-cdn/esm/2022/gl-matrix-f32.min.js | 2 +- dist-cdn/esm/2022/gl-matrix-f32.min.js.map | 4 +- dist-cdn/esm/2022/gl-matrix-f64.js | 587 +++-- dist-cdn/esm/2022/gl-matrix-f64.js.map | 4 +- dist-cdn/esm/2022/gl-matrix-f64.min.js | 2 +- dist-cdn/esm/2022/gl-matrix-f64.min.js.map | 4 +- dist-cdn/types/gl-matrix-f32.d.mts | 217 +- dist-cdn/types/gl-matrix-f64.d.mts | 217 +- dist-cdn/umd/gl-matrix-f32.js | 470 ++-- dist-cdn/umd/gl-matrix-f32.js.map | 2 +- dist-cdn/umd/gl-matrix-f32.min.js | 383 +-- dist-cdn/umd/gl-matrix-f32.min.js.map | 2 +- dist-cdn/umd/gl-matrix-f64.js | 470 ++-- dist-cdn/umd/gl-matrix-f64.js.map | 2 +- dist-cdn/umd/gl-matrix-f64.min.js | 1353 +++++----- dist-cdn/umd/gl-matrix-f64.min.js.map | 2 +- eslint.config.js | 81 + package-lock.json | 1162 ++++++++- package.json | 6 +- scripts/gen-swizzle.js | 4 +- src/_lib/f32/Mat2.ts | 34 +- src/_lib/f32/Mat2d.ts | 54 +- src/_lib/f32/Mat3.ts | 48 +- src/_lib/f32/Mat4.ts | 266 +- src/_lib/f32/Quat.ts | 94 +- src/_lib/f32/Quat2.ts | 68 +- src/_lib/f32/Vec2.ts | 83 +- src/_lib/f32/Vec3.ts | 113 +- src/_lib/f32/Vec4.ts | 62 +- src/_lib/f64/Mat2.ts | 34 +- src/_lib/f64/Mat2d.ts | 54 +- src/_lib/f64/Mat3.ts | 48 +- src/_lib/f64/Mat4.ts | 266 +- src/_lib/f64/Quat.ts | 94 +- src/_lib/f64/Quat2.ts | 68 +- src/_lib/f64/Vec2.ts | 83 +- src/_lib/f64/Vec3.ts | 113 +- src/_lib/f64/Vec4.ts | 62 +- src/common/index.ts | 2 +- src/swizzle/f64/index.ts | 28 +- src/swizzle/index.ts | 28 +- src/types/swizzle/f64/index.ts | 1924 +++++++------- src/types/swizzle/index.ts | 1924 +++++++------- tests/f32/Mat2.spec.ts | 50 +- tests/f32/Mat2d.spec.ts | 37 +- tests/f32/Mat3.spec.ts | 95 +- tests/f32/Mat4.spec.ts | 176 +- tests/f32/Quat.spec.ts | 67 +- tests/f32/Quat2.spec.ts | 156 +- tests/f32/Vec2-swizzle.spec.ts | 224 +- tests/f32/Vec2.spec.ts | 36 +- tests/f32/Vec3-swizzle.spec.ts | 936 +++---- tests/f32/Vec3.spec.ts | 39 +- tests/f32/Vec4-swizzle.spec.ts | 2688 ++++++++++---------- tests/f32/Vec4.spec.ts | 32 +- tests/f32/util.spec.ts | 8 +- tests/f64/Mat2.spec.ts | 50 +- tests/f64/Mat2d.spec.ts | 37 +- tests/f64/Mat3.spec.ts | 95 +- tests/f64/Mat4.spec.ts | 176 +- tests/f64/Quat.spec.ts | 67 +- tests/f64/Quat2.spec.ts | 156 +- tests/f64/Vec2-swizzle.spec.ts | 224 +- tests/f64/Vec2.spec.ts | 36 +- tests/f64/Vec3-swizzle.spec.ts | 936 +++---- tests/f64/Vec3.spec.ts | 39 +- tests/f64/Vec4-swizzle.spec.ts | 2688 ++++++++++---------- tests/f64/Vec4.spec.ts | 32 +- tests/f64/util.spec.ts | 8 +- tests/other/classic-api.spec.ts | 21 +- tests/setupExtend.ts | 30 +- tests/vitest.d.ts | 19 +- tsconfig.json | 3 +- 86 files changed, 11860 insertions(+), 9631 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 eslint.config.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..95b32fe8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 2 +trim_trailing_whitespace = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..4923a91d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Set line endings. +* text eol=lf diff --git a/README-CDN.md b/README-CDN.md index a7f22dd5..8d12062c 100644 --- a/README-CDN.md +++ b/README-CDN.md @@ -15,10 +15,10 @@ in the next beta release. --- -There are multiple distribution methods to utilize `gl-matrix` from legacy module systems like -[RequireJS](https://requirejs.org/) to modern ES Module (ESM) oriented CDNs. If you are not using Node / NPM and -bundling `gl-matrix` directly into your project / product various pre-built versions are available on most CDNs that -automatically make NPM package available for consumption online in a web application deployment. +There are multiple distribution methods to utilize `gl-matrix` from legacy module systems like +[RequireJS](https://requirejs.org/) to modern ES Module (ESM) oriented CDNs. If you are not using Node / NPM and +bundling `gl-matrix` directly into your project / product various pre-built versions are available on most CDNs that +automatically make NPM package available for consumption online in a web application deployment. Pre-built ESM and ES5 / UMD bundles are available in the `/dist-cdn` directory checked into the `gl-matrix` repo. The `gl-matrix/cdn` and `gl-matrix/cdn/f64` exports are linked to the types and pre-built all-inclusive CDN ESM diff --git a/dist-cdn/esm/2016/gl-matrix-f32.js b/dist-cdn/esm/2016/gl-matrix-f32.js index 00973f50..03fd6c01 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.js +++ b/dist-cdn/esm/2016/gl-matrix-f32.js @@ -46,9 +46,9 @@ var _Mat2 = class _Mat2 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` @@ -58,9 +58,9 @@ var _Mat2 = class _Mat2 extends Float32Array { get str() { return _Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. * @@ -101,6 +101,7 @@ var _Mat2 = class _Mat2 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` @@ -143,9 +144,9 @@ var _Mat2 = class _Mat2 extends Float32Array { rotate(rad) { return _Mat2.rotate(this, this, rad); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -154,9 +155,9 @@ var _Mat2 = class _Mat2 extends Float32Array { static get BYTE_LENGTH() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} * @category Static @@ -240,7 +241,7 @@ var _Mat2 = class _Mat2 extends Float32Array { */ static transpose(out, a) { if (out === a) { - let a1 = a[1]; + const a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { @@ -257,7 +258,7 @@ var _Mat2 = class _Mat2 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a0 = a[0]; @@ -337,6 +338,7 @@ var _Mat2 = class _Mat2 extends Float32Array { * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -368,6 +370,7 @@ var _Mat2 = class _Mat2 extends Float32Array { * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -605,9 +608,9 @@ var _Mat2d = class _Mat2d extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` @@ -617,9 +620,9 @@ var _Mat2d = class _Mat2d extends Float32Array { get str() { return _Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. * @category Methods @@ -662,6 +665,7 @@ var _Mat2d = class _Mat2d extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` @@ -695,9 +699,9 @@ var _Mat2d = class _Mat2d extends Float32Array { scale(v) { return _Mat2d.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -706,9 +710,9 @@ var _Mat2d = class _Mat2d extends Float32Array { static get BYTE_LENGTH() { return 6 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} * @category Static @@ -794,7 +798,7 @@ var _Mat2d = class _Mat2d extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const aa = a[0]; @@ -866,6 +870,7 @@ var _Mat2d = class _Mat2d extends Float32Array { * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -903,6 +908,7 @@ var _Mat2d = class _Mat2d extends Float32Array { * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -988,9 +994,10 @@ var _Mat2d = class _Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1009,9 +1016,10 @@ var _Mat2d = class _Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1032,9 +1040,10 @@ var _Mat2d = class _Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1098,7 +1107,7 @@ var _Mat2d = class _Mat2d extends Float32Array { return out; } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1109,7 +1118,7 @@ var _Mat2d = class _Mat2d extends Float32Array { 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]; } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1194,9 +1203,9 @@ var _Mat3 = class _Mat3 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` @@ -1206,9 +1215,9 @@ var _Mat3 = class _Mat3 extends Float32Array { get str() { return _Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. * @category Methods @@ -1251,6 +1260,7 @@ var _Mat3 = class _Mat3 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` @@ -1304,9 +1314,9 @@ var _Mat3 = class _Mat3 extends Float32Array { scale(v) { return _Mat3.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -1315,9 +1325,9 @@ var _Mat3 = class _Mat3 extends Float32Array { static get BYTE_LENGTH() { return 9 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} * @category Static @@ -1442,7 +1452,7 @@ var _Mat3 = class _Mat3 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2]; @@ -1561,6 +1571,7 @@ var _Mat3 = class _Mat3 extends Float32Array { * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -1607,6 +1618,7 @@ var _Mat3 = class _Mat3 extends Float32Array { * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -1700,9 +1712,10 @@ var _Mat3 = class _Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1750,9 +1763,10 @@ var _Mat3 = class _Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1855,7 +1869,7 @@ var _Mat3 = class _Mat3 extends Float32Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -2011,7 +2025,7 @@ var _Mat3 = class _Mat3 extends Float32Array { return out; } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2022,7 +2036,7 @@ var _Mat3 = class _Mat3 extends Float32Array { 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]; } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2124,9 +2138,9 @@ var _Mat4 = class _Mat4 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` @@ -2136,9 +2150,9 @@ var _Mat4 = class _Mat4 extends Float32Array { get str() { return _Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. * @category Methods @@ -2179,6 +2193,7 @@ var _Mat4 = class _Mat4 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` @@ -2336,9 +2351,9 @@ var _Mat4 = class _Mat4 extends Float32Array { orthoZO(left, right, bottom, top, near, far) { return _Mat4.orthoZO(this, left, right, bottom, top, near, far); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -2347,9 +2362,9 @@ var _Mat4 = class _Mat4 extends Float32Array { static get BYTE_LENGTH() { return 16 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} * @category Static @@ -2510,7 +2525,7 @@ var _Mat4 = class _Mat4 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; @@ -2683,6 +2698,7 @@ var _Mat4 = class _Mat4 extends Float32Array { * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -2843,16 +2859,16 @@ var _Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static rotateX(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[0] = a[0]; out[1] = a[1]; @@ -2883,16 +2899,16 @@ var _Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static rotateY(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[4] = a[4]; out[5] = a[5]; @@ -2923,16 +2939,16 @@ var _Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static rotateZ(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; if (a !== out) { out[8] = a[8]; out[9] = a[9]; @@ -2956,9 +2972,10 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -2987,9 +3004,10 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3018,9 +3036,10 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3064,9 +3083,10 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3074,8 +3094,8 @@ var _Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static fromXRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = 1; out[1] = 0; out[2] = 0; @@ -3097,9 +3117,10 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3107,8 +3128,8 @@ var _Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static fromYRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = c; out[1] = 0; out[2] = -s; @@ -3130,9 +3151,10 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3163,12 +3185,13 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3228,7 +3251,7 @@ var _Mat4 = class _Mat4 extends Float32Array { const ay = a[5]; const az = a[6]; const aw = a[7]; - let magnitude = bx * bx + by * by + bz * bz + bw * bw; + const magnitude = bx * bx + by * by + bz * bz + bw * bw; if (magnitude > 0) { __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; @@ -3247,7 +3270,7 @@ var _Mat4 = class _Mat4 extends Float32Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -3509,13 +3532,14 @@ var _Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3563,17 +3587,18 @@ var _Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3727,6 +3752,7 @@ var _Mat4 = class _Mat4 extends Float32Array { static frustum(out, left, right, bottom, top, near, far = Infinity) { return out; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], @@ -3815,6 +3841,7 @@ var _Mat4 = class _Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static perspective(out, fovy, aspect, near, far = Infinity) { return out; } @@ -3859,9 +3886,8 @@ var _Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3897,9 +3923,8 @@ var _Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3938,13 +3963,13 @@ var _Mat4 = class _Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static ortho(out, left, right, bottom, top, near, far) { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3979,8 +4004,8 @@ var _Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4182,6 +4207,7 @@ var _Mat4 = class _Mat4 extends Float32Array { * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -4243,7 +4269,7 @@ var _Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -4254,7 +4280,7 @@ var _Mat4 = class _Mat4 extends Float32Array { 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]; } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -4369,9 +4395,9 @@ var Vec3 = class _Vec3 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -4488,9 +4514,9 @@ var Vec3 = class _Vec3 extends Float32Array { get str() { return _Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. * @category Methods @@ -4537,6 +4563,7 @@ var Vec3 = class _Vec3 extends Float32Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` @@ -4558,6 +4585,7 @@ var Vec3 = class _Vec3 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` @@ -4579,6 +4607,7 @@ var Vec3 = class _Vec3 extends Float32Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` @@ -4626,6 +4655,7 @@ var Vec3 = class _Vec3 extends Float32Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` @@ -4644,6 +4674,7 @@ var Vec3 = class _Vec3 extends Float32Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` @@ -4704,9 +4735,9 @@ var Vec3 = class _Vec3 extends Float32Array { normalize() { return _Vec3.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -4715,9 +4746,9 @@ var Vec3 = class _Vec3 extends Float32Array { static get BYTE_LENGTH() { return 3 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 * @category Static @@ -4745,9 +4776,9 @@ var Vec3 = class _Vec3 extends Float32Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; - let z = a[2]; + const x = a[0]; + const y = a[1]; + const z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /** @@ -4757,6 +4788,7 @@ var Vec3 = class _Vec3 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4765,10 +4797,11 @@ var Vec3 = class _Vec3 extends Float32Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4777,6 +4810,7 @@ var Vec3 = class _Vec3 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values * @category Static @@ -4853,6 +4887,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0, 0]; } @@ -4875,6 +4910,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0, 0]; } @@ -4897,6 +4933,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0, 0]; } @@ -4966,7 +5003,8 @@ var Vec3 = class _Vec3 extends Float32Array { * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -5021,6 +5059,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -5042,6 +5081,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -5062,6 +5102,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -5251,7 +5292,8 @@ var Vec3 = class _Vec3 extends Float32Array { * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -5291,7 +5333,7 @@ var Vec3 = class _Vec3 extends Float32Array { * @returns `out` */ static transformMat3(out, a, m) { - let x = a[0], y = a[1], z = a[2]; + const x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; out[1] = x * m[1] + y * m[4] + z * m[7]; out[2] = x * m[2] + y * m[5] + z * m[8]; @@ -5429,7 +5471,7 @@ var Vec3 = class _Vec3 extends Float32Array { return `Vec3(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -5440,7 +5482,7 @@ var Vec3 = class _Vec3 extends Float32Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -5501,9 +5543,9 @@ var Vec4 = class _Vec4 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -5621,9 +5663,9 @@ var Vec4 = class _Vec4 extends Float32Array { get str() { return _Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. * @category Methods @@ -5672,6 +5714,7 @@ var Vec4 = class _Vec4 extends Float32Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` @@ -5694,6 +5737,7 @@ var Vec4 = class _Vec4 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` @@ -5716,6 +5760,7 @@ var Vec4 = class _Vec4 extends Float32Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` @@ -5765,6 +5810,7 @@ var Vec4 = class _Vec4 extends Float32Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` @@ -5783,6 +5829,7 @@ var Vec4 = class _Vec4 extends Float32Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` @@ -5846,9 +5893,9 @@ var Vec4 = class _Vec4 extends Float32Array { normalize() { return _Vec4.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -5857,9 +5904,9 @@ var Vec4 = class _Vec4 extends Float32Array { static get BYTE_LENGTH() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} * @category Static @@ -5961,6 +6008,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -5984,6 +6032,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -6007,6 +6056,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return out; } @@ -6139,6 +6189,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -6161,6 +6212,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -6185,15 +6237,17 @@ var Vec4 = class _Vec4 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static @@ -6202,6 +6256,7 @@ var Vec4 = class _Vec4 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} * @category Static @@ -6223,6 +6278,7 @@ var Vec4 = class _Vec4 extends Float32Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} * @category Static @@ -6358,7 +6414,8 @@ var Vec4 = class _Vec4 extends Float32Array { * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -6456,7 +6513,7 @@ var Vec4 = class _Vec4 extends Float32Array { return `Vec4(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -6467,7 +6524,7 @@ var Vec4 = class _Vec4 extends Float32Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -6532,9 +6589,9 @@ var _Quat = class _Quat extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -6610,9 +6667,9 @@ var _Quat = class _Quat extends Float32Array { get str() { return _Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. * @category Methods @@ -6656,6 +6713,7 @@ var _Quat = class _Quat extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` @@ -6725,9 +6783,9 @@ var _Quat = class _Quat extends Float32Array { dot(b) { return _Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -6736,9 +6794,9 @@ var _Quat = class _Quat extends Float32Array { static get BYTE_LENGTH() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat * @category Static @@ -6773,7 +6831,7 @@ var _Quat = class _Quat extends Float32Array { * @returns `out` **/ static setAxisAngle(out, axis, rad) { - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -6785,7 +6843,7 @@ var _Quat = class _Quat extends Float32Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -6823,7 +6881,7 @@ var _Quat = class _Quat extends Float32Array { return Math.acos(2 * dotproduct * dotproduct - 1); } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -7030,7 +7088,7 @@ var _Quat = class _Quat extends Float32Array { * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -7066,7 +7124,7 @@ var _Quat = class _Quat extends Float32Array { } /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -7084,7 +7142,7 @@ var _Quat = class _Quat extends Float32Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -7103,10 +7161,14 @@ var _Quat = class _Quat extends Float32Array { out[2] = (m[1] - m[3]) * fRoot; } else { let i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - let j = (i + 1) % 3; - let k = (i + 2) % 3; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); out[i] = 0.5 * fRoot; fRoot = 0.5 / fRoot; @@ -7128,16 +7190,16 @@ var _Quat = class _Quat extends Float32Array { * @returns `out` */ static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) { - let halfToRad = 0.5 * Math.PI / 180; + const halfToRad = 0.5 * Math.PI / 180; x *= halfToRad; y *= halfToRad; z *= halfToRad; - let sx = Math.sin(x); - let cx = Math.cos(x); - let sy = Math.sin(y); - let cy = Math.cos(y); - let sz = Math.sin(z); - let cz = Math.cos(z); + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); switch (order) { case "xyz": out[0] = sx * cy * cz + cx * sy * sz; @@ -7176,7 +7238,7 @@ var _Quat = class _Quat extends Float32Array { out[3] = cx * cy * cz + sx * sy * sz; break; default: - throw new Error("Unknown angle order " + order); + throw new Error(`Unknown angle order ${order}`); } return out; } @@ -7239,6 +7301,7 @@ var _Quat = class _Quat extends Float32Array { * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static set(out, x, y, z, w) { return out; } @@ -7251,6 +7314,7 @@ var _Quat = class _Quat extends Float32Array { * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static add(out, a, b) { return out; } @@ -7258,6 +7322,7 @@ var _Quat = class _Quat extends Float32Array { * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -7298,6 +7363,7 @@ var _Quat = class _Quat extends Float32Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static lerp(out, a, b, t) { return out; } @@ -7308,6 +7374,7 @@ var _Quat = class _Quat extends Float32Array { * @param a - quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -7315,6 +7382,7 @@ var _Quat = class _Quat extends Float32Array { * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mag(a) { return 0; } @@ -7323,10 +7391,11 @@ var _Quat = class _Quat extends Float32Array { * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static @@ -7335,6 +7404,7 @@ var _Quat = class _Quat extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} * @category Static @@ -7342,6 +7412,7 @@ var _Quat = class _Quat extends Float32Array { * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -7352,6 +7423,7 @@ var _Quat = class _Quat extends Float32Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} * @category Static @@ -7360,28 +7432,31 @@ var _Quat = class _Quat extends Float32Array { * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static normalize(out, a) { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static exactEquals(a, b) { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static equals(a, b) { return false; } @@ -7398,10 +7473,12 @@ var _Quat = class _Quat extends Float32Array { * @returns `out` */ static rotationTo(out, a, b) { - let dot = Vec3.dot(a, b); + const dot = Vec3.dot(a, b); if (dot < -0.999999) { Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); - if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + } Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); return out; @@ -7526,9 +7603,9 @@ var _Quat2 = class _Quat2 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` @@ -7538,9 +7615,9 @@ var _Quat2 = class _Quat2 extends Float32Array { get str() { return _Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. * @category Methods @@ -7552,9 +7629,9 @@ var _Quat2 = class _Quat2 extends Float32Array { super.set(a); return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -7563,9 +7640,9 @@ var _Quat2 = class _Quat2 extends Float32Array { static get BYTE_LENGTH() { return 8 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} * @category Static @@ -8062,7 +8139,7 @@ var _Quat2 = class _Quat2 extends Float32Array { return _Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); const bx = s * axis[0] / axisLength; const by = s * axis[1] / axisLength; @@ -8146,6 +8223,7 @@ var _Quat2 = class _Quat2 extends Float32Array { * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -8177,6 +8255,7 @@ var _Quat2 = class _Quat2 extends Float32Array { * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dot(a, b) { return 0; } @@ -8193,7 +8272,9 @@ var _Quat2 = class _Quat2 extends Float32Array { */ static lerp(out, a, b, t) { const mt = 1 - t; - if (_Quat2.dot(a, b) < 0) t = -t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; out[2] = a[2] * mt + b[2] * t; @@ -8225,8 +8306,8 @@ var _Quat2 = class _Quat2 extends Float32Array { return out; } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -8251,6 +8332,7 @@ var _Quat2 = class _Quat2 extends Float32Array { * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -8261,15 +8343,17 @@ var _Quat2 = class _Quat2 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static @@ -8278,6 +8362,7 @@ var _Quat2 = class _Quat2 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} * @category Static @@ -8285,6 +8370,7 @@ var _Quat2 = class _Quat2 extends Float32Array { * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -8295,6 +8381,7 @@ var _Quat2 = class _Quat2 extends Float32Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} * @category Static @@ -8338,7 +8425,7 @@ var _Quat2 = class _Quat2 extends Float32Array { return `Quat2(${a.join(", ")})`; } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -8349,7 +8436,7 @@ var _Quat2 = class _Quat2 extends Float32Array { 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]; } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -8423,9 +8510,9 @@ var Vec2 = class _Vec2 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -8518,9 +8605,9 @@ var Vec2 = class _Vec2 extends Float32Array { get str() { return _Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. * @category Methods @@ -8566,6 +8653,7 @@ var Vec2 = class _Vec2 extends Float32Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` @@ -8586,6 +8674,7 @@ var Vec2 = class _Vec2 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` @@ -8606,6 +8695,7 @@ var Vec2 = class _Vec2 extends Float32Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` @@ -8651,6 +8741,7 @@ var Vec2 = class _Vec2 extends Float32Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` @@ -8669,6 +8760,7 @@ var Vec2 = class _Vec2 extends Float32Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` @@ -8726,9 +8818,9 @@ var Vec2 = class _Vec2 extends Float32Array { normalize() { return _Vec2.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -8737,9 +8829,9 @@ var Vec2 = class _Vec2 extends Float32Array { static get BYTE_LENGTH() { return 2 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} * @category Static @@ -8829,6 +8921,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0]; } @@ -8850,6 +8943,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0]; } @@ -8871,6 +8965,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0]; } @@ -8985,6 +9080,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -9005,6 +9101,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -9016,8 +9113,8 @@ var Vec2 = class _Vec2 extends Float32Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; + const x = a[0]; + const y = a[1]; return Math.sqrt(x * x + y * y); } /** @@ -9027,6 +9124,7 @@ var Vec2 = class _Vec2 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9035,10 +9133,11 @@ var Vec2 = class _Vec2 extends Float32Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9047,6 +9146,7 @@ var Vec2 = class _Vec2 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} * @category Static @@ -9063,6 +9163,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -9285,7 +9386,7 @@ var Vec2 = class _Vec2 extends Float32Array { return out; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -9296,7 +9397,7 @@ var Vec2 = class _Vec2 extends Float32Array { return a[0] === b[0] && a[1] === b[1]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -9363,13 +9464,23 @@ function EnableSwizzles() { }; case 3: return function() { - return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + return new Vec3( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]] + ); }; case 4: return function() { - return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + return new Vec4( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], + this[SWIZZLE_INDEX[swizzle[3]]] + ); }; } + throw new Error("Illegal swizzle length"); } for (const swizzle of VEC2_SWIZZLES) { const impl = getSwizzleImpl(swizzle); diff --git a/dist-cdn/esm/2016/gl-matrix-f32.js.map b/dist-cdn/esm/2016/gl-matrix-f32.js.map index c0de8185..7bd77004 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f32.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;;;;;;;;;AASO,IAAM,cAAsB;;;ACTnC;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GAAsB,GAAG,CAAC;AAAA,QAClC;AACA;AAAA,MACF;AACE,cAAM,oBAAK,cAAa;AAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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Content": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float32Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float32Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float32Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;;;;;;;AASO,IAAM,cAAc;;;ACT3B;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAoE;AACjF,YAAQ,OAAO,QAAQ;AAAA,MACrB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OA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dn/esm/2016/gl-matrix-f32.min.js +++ b/dist-cdn/esm/2016/gl-matrix-f32.min.js @@ -2,5 +2,5 @@ // @author Brandon Jones // @author Colin MacKenzie IV // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) -var de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(xe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(r*F-s*P-a*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(M*g-l*S-h*z)*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,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4}; +var de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(oe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z(H,se,new Float32Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1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,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float32Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function _e(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error("Illegal swizzle length")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*xe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,N as vec2,T as vec3,q as vec4}; //# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f32.min.js.map b/dist-cdn/esm/2016/gl-matrix-f32.min.js.map index 4738df8f..8b46b0fe 100644 --- a/dist-cdn/esm/2016/gl-matrix-f32.min.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f32.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;sQAAA,IAAAA,GAOaC,EAAN,MAAMA,UAAa,YAAa,CAWrC,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMC,EAAAH,EAAKD,GAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOC,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAID,EAAAH,EAAKD,GAAa,EACpB,IACT,CAUA,SAASM,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,KAAM,IAAI,CAClC,CASA,QAAe,CACb,OAAOA,EAAK,OAAO,KAAM,IAAI,CAC/B,CAUA,MAAME,EAA6B,CACjC,OAAOF,EAAK,MA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AAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,GAA2B,EAC7B,CC1HA,IAAMY,GAAyB,KAAK,GAAK,IAKnCC,GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float32Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float32Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float32Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;sQAAA,IAAAA,GAOaC,EAAN,MAAMA,UAAa,YAAa,CAWrC,eAAeC,EAAoE,CACjF,OAAQA,EAAO,OAAQ,CACrB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMC,EAAAH,EAAKD,GAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOC,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAID,EAAAH,EAAKD,GAAa,EACpB,IACT,CAUA,SAASM,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,KAAM,IAAI,CAClC,CASA,QAAe,CACb,OAAOA,EAAK,OAAO,KAAM,IAAI,CAC/B,CAUA,MAAME,EAA6B,CACjC,OAAOF,EAAK,MAAM,KAAM,KAAME,CAAC,CACjC,CAUA,OAAOI,EAAmB,CACxB,OAAON,EAAK,OAAO,KAAM,KAAMM,CAAG,CACpC,CAWA,WAAW,aAAsB,CAC/B,MAAO,GAAI,aAAa,iBAC1B,CAYA,OAAO,QAAe,CACpB,OAAO,IAAIN,CACb,CASA,OAAO,MAAMI,EAA6B,CACxC,OAAO,IAAIJ,EAAKI,CAAC,CACnB,CAUA,OAAO,KAAKG,EAAeH,EAAiC,CAC1D,O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AEAX,GAA2B,EAC7B,CCxIA,IAAMY,GAAyB,KAAK,GAAK,IAKnCC,GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", "names": ["_IDENTITY_2X2", "_Mat2", "values", "v", "__privateGet", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "__privateAdd", "Mat2", "_IDENTITY_2X3", "_Mat2d", "values", "v", "__privateGet", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "__privateAdd", "Mat2d", "_IDENTITY_3X3", "_Mat3", "values", "v", "__privateGet", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "__privateAdd", "Mat3", "_IDENTITY_4X4", "_TMP_VEC3", "_Mat4", "values", "v", "__privateGet", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "__privateAdd", "Mat4", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "_DEFAULT_ANGLE_ORDER", "_TMP_QUAT1", "_TMP_QUAT2", "_TMP_MAT3", "_TMP_VEC3", "_X_UNIT_VEC3", "_Y_UNIT_VEC3", "_Quat", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "__privateGet", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "__privateAdd", "Quat", "Vec4", "_TMP_QUAT", "_TMP_VEC3", "_Quat2", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "__privateGet", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "__privateAdd", "Quat2", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/esm/2016/gl-matrix-f64.js b/dist-cdn/esm/2016/gl-matrix-f64.js index 82410d39..d52a3eb8 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.js +++ b/dist-cdn/esm/2016/gl-matrix-f64.js @@ -46,9 +46,9 @@ var _Mat2 = class _Mat2 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` @@ -58,9 +58,9 @@ var _Mat2 = class _Mat2 extends Float64Array { get str() { return _Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. * @@ -101,6 +101,7 @@ var _Mat2 = class _Mat2 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` @@ -143,9 +144,9 @@ var _Mat2 = class _Mat2 extends Float64Array { rotate(rad) { return _Mat2.rotate(this, this, rad); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -154,9 +155,9 @@ var _Mat2 = class _Mat2 extends Float64Array { static get BYTE_LENGTH() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} * @category Static @@ -240,7 +241,7 @@ var _Mat2 = class _Mat2 extends Float64Array { */ static transpose(out, a) { if (out === a) { - let a1 = a[1]; + const a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { @@ -257,7 +258,7 @@ var _Mat2 = class _Mat2 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a0 = a[0]; @@ -337,6 +338,7 @@ var _Mat2 = class _Mat2 extends Float64Array { * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -368,6 +370,7 @@ var _Mat2 = class _Mat2 extends Float64Array { * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -605,9 +608,9 @@ var _Mat2d = class _Mat2d extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` @@ -617,9 +620,9 @@ var _Mat2d = class _Mat2d extends Float64Array { get str() { return _Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. * @category Methods @@ -662,6 +665,7 @@ var _Mat2d = class _Mat2d extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` @@ -695,9 +699,9 @@ var _Mat2d = class _Mat2d extends Float64Array { scale(v) { return _Mat2d.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -706,9 +710,9 @@ var _Mat2d = class _Mat2d extends Float64Array { static get BYTE_LENGTH() { return 6 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} * @category Static @@ -794,7 +798,7 @@ var _Mat2d = class _Mat2d extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const aa = a[0]; @@ -866,6 +870,7 @@ var _Mat2d = class _Mat2d extends Float64Array { * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -903,6 +908,7 @@ var _Mat2d = class _Mat2d extends Float64Array { * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -988,9 +994,10 @@ var _Mat2d = class _Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1009,9 +1016,10 @@ var _Mat2d = class _Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1032,9 +1040,10 @@ var _Mat2d = class _Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1098,7 +1107,7 @@ var _Mat2d = class _Mat2d extends Float64Array { return out; } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1109,7 +1118,7 @@ var _Mat2d = class _Mat2d extends Float64Array { 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]; } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1194,9 +1203,9 @@ var _Mat3 = class _Mat3 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` @@ -1206,9 +1215,9 @@ var _Mat3 = class _Mat3 extends Float64Array { get str() { return _Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. * @category Methods @@ -1251,6 +1260,7 @@ var _Mat3 = class _Mat3 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` @@ -1304,9 +1314,9 @@ var _Mat3 = class _Mat3 extends Float64Array { scale(v) { return _Mat3.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -1315,9 +1325,9 @@ var _Mat3 = class _Mat3 extends Float64Array { static get BYTE_LENGTH() { return 9 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} * @category Static @@ -1442,7 +1452,7 @@ var _Mat3 = class _Mat3 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2]; @@ -1561,6 +1571,7 @@ var _Mat3 = class _Mat3 extends Float64Array { * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -1607,6 +1618,7 @@ var _Mat3 = class _Mat3 extends Float64Array { * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -1700,9 +1712,10 @@ var _Mat3 = class _Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1750,9 +1763,10 @@ var _Mat3 = class _Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1855,7 +1869,7 @@ var _Mat3 = class _Mat3 extends Float64Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -2011,7 +2025,7 @@ var _Mat3 = class _Mat3 extends Float64Array { return out; } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2022,7 +2036,7 @@ var _Mat3 = class _Mat3 extends Float64Array { 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]; } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2124,9 +2138,9 @@ var _Mat4 = class _Mat4 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` @@ -2136,9 +2150,9 @@ var _Mat4 = class _Mat4 extends Float64Array { get str() { return _Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. * @category Methods @@ -2179,6 +2193,7 @@ var _Mat4 = class _Mat4 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` @@ -2336,9 +2351,9 @@ var _Mat4 = class _Mat4 extends Float64Array { orthoZO(left, right, bottom, top, near, far) { return _Mat4.orthoZO(this, left, right, bottom, top, near, far); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -2347,9 +2362,9 @@ var _Mat4 = class _Mat4 extends Float64Array { static get BYTE_LENGTH() { return 16 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} * @category Static @@ -2510,7 +2525,7 @@ var _Mat4 = class _Mat4 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; @@ -2683,6 +2698,7 @@ var _Mat4 = class _Mat4 extends Float64Array { * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -2843,16 +2859,16 @@ var _Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static rotateX(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[0] = a[0]; out[1] = a[1]; @@ -2883,16 +2899,16 @@ var _Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static rotateY(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[4] = a[4]; out[5] = a[5]; @@ -2923,16 +2939,16 @@ var _Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static rotateZ(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; if (a !== out) { out[8] = a[8]; out[9] = a[9]; @@ -2956,9 +2972,10 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -2987,9 +3004,10 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3018,9 +3036,10 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3064,9 +3083,10 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3074,8 +3094,8 @@ var _Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static fromXRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = 1; out[1] = 0; out[2] = 0; @@ -3097,9 +3117,10 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3107,8 +3128,8 @@ var _Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static fromYRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = c; out[1] = 0; out[2] = -s; @@ -3130,9 +3151,10 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3163,12 +3185,13 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3228,7 +3251,7 @@ var _Mat4 = class _Mat4 extends Float64Array { const ay = a[5]; const az = a[6]; const aw = a[7]; - let magnitude = bx * bx + by * by + bz * bz + bw * bw; + const magnitude = bx * bx + by * by + bz * bz + bw * bw; if (magnitude > 0) { __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; @@ -3247,7 +3270,7 @@ var _Mat4 = class _Mat4 extends Float64Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -3509,13 +3532,14 @@ var _Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3563,17 +3587,18 @@ var _Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3727,6 +3752,7 @@ var _Mat4 = class _Mat4 extends Float64Array { static frustum(out, left, right, bottom, top, near, far = Infinity) { return out; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], @@ -3815,6 +3841,7 @@ var _Mat4 = class _Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static perspective(out, fovy, aspect, near, far = Infinity) { return out; } @@ -3859,9 +3886,8 @@ var _Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3897,9 +3923,8 @@ var _Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3938,13 +3963,13 @@ var _Mat4 = class _Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static ortho(out, left, right, bottom, top, near, far) { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3979,8 +4004,8 @@ var _Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4182,6 +4207,7 @@ var _Mat4 = class _Mat4 extends Float64Array { * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -4243,7 +4269,7 @@ var _Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -4254,7 +4280,7 @@ var _Mat4 = class _Mat4 extends Float64Array { 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]; } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -4369,9 +4395,9 @@ var Vec3 = class _Vec3 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -4488,9 +4514,9 @@ var Vec3 = class _Vec3 extends Float64Array { get str() { return _Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. * @category Methods @@ -4537,6 +4563,7 @@ var Vec3 = class _Vec3 extends Float64Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` @@ -4558,6 +4585,7 @@ var Vec3 = class _Vec3 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` @@ -4579,6 +4607,7 @@ var Vec3 = class _Vec3 extends Float64Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` @@ -4626,6 +4655,7 @@ var Vec3 = class _Vec3 extends Float64Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` @@ -4644,6 +4674,7 @@ var Vec3 = class _Vec3 extends Float64Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` @@ -4704,9 +4735,9 @@ var Vec3 = class _Vec3 extends Float64Array { normalize() { return _Vec3.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -4715,9 +4746,9 @@ var Vec3 = class _Vec3 extends Float64Array { static get BYTE_LENGTH() { return 3 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 * @category Static @@ -4745,9 +4776,9 @@ var Vec3 = class _Vec3 extends Float64Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; - let z = a[2]; + const x = a[0]; + const y = a[1]; + const z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /** @@ -4757,6 +4788,7 @@ var Vec3 = class _Vec3 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4765,10 +4797,11 @@ var Vec3 = class _Vec3 extends Float64Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4777,6 +4810,7 @@ var Vec3 = class _Vec3 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values * @category Static @@ -4853,6 +4887,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0, 0]; } @@ -4875,6 +4910,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0, 0]; } @@ -4897,6 +4933,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0, 0]; } @@ -4966,7 +5003,8 @@ var Vec3 = class _Vec3 extends Float64Array { * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -5021,6 +5059,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -5042,6 +5081,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -5062,6 +5102,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -5251,7 +5292,8 @@ var Vec3 = class _Vec3 extends Float64Array { * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -5291,7 +5333,7 @@ var Vec3 = class _Vec3 extends Float64Array { * @returns `out` */ static transformMat3(out, a, m) { - let x = a[0], y = a[1], z = a[2]; + const x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; out[1] = x * m[1] + y * m[4] + z * m[7]; out[2] = x * m[2] + y * m[5] + z * m[8]; @@ -5429,7 +5471,7 @@ var Vec3 = class _Vec3 extends Float64Array { return `Vec3(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -5440,7 +5482,7 @@ var Vec3 = class _Vec3 extends Float64Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -5501,9 +5543,9 @@ var Vec4 = class _Vec4 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -5621,9 +5663,9 @@ var Vec4 = class _Vec4 extends Float64Array { get str() { return _Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. * @category Methods @@ -5672,6 +5714,7 @@ var Vec4 = class _Vec4 extends Float64Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` @@ -5694,6 +5737,7 @@ var Vec4 = class _Vec4 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` @@ -5716,6 +5760,7 @@ var Vec4 = class _Vec4 extends Float64Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` @@ -5765,6 +5810,7 @@ var Vec4 = class _Vec4 extends Float64Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` @@ -5783,6 +5829,7 @@ var Vec4 = class _Vec4 extends Float64Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` @@ -5846,9 +5893,9 @@ var Vec4 = class _Vec4 extends Float64Array { normalize() { return _Vec4.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -5857,9 +5904,9 @@ var Vec4 = class _Vec4 extends Float64Array { static get BYTE_LENGTH() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} * @category Static @@ -5961,6 +6008,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -5984,6 +6032,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -6007,6 +6056,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return out; } @@ -6139,6 +6189,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -6161,6 +6212,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -6185,15 +6237,17 @@ var Vec4 = class _Vec4 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static @@ -6202,6 +6256,7 @@ var Vec4 = class _Vec4 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} * @category Static @@ -6223,6 +6278,7 @@ var Vec4 = class _Vec4 extends Float64Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} * @category Static @@ -6358,7 +6414,8 @@ var Vec4 = class _Vec4 extends Float64Array { * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -6456,7 +6513,7 @@ var Vec4 = class _Vec4 extends Float64Array { return `Vec4(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -6467,7 +6524,7 @@ var Vec4 = class _Vec4 extends Float64Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -6532,9 +6589,9 @@ var _Quat = class _Quat extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -6610,9 +6667,9 @@ var _Quat = class _Quat extends Float64Array { get str() { return _Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. * @category Methods @@ -6656,6 +6713,7 @@ var _Quat = class _Quat extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` @@ -6725,9 +6783,9 @@ var _Quat = class _Quat extends Float64Array { dot(b) { return _Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -6736,9 +6794,9 @@ var _Quat = class _Quat extends Float64Array { static get BYTE_LENGTH() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat * @category Static @@ -6773,7 +6831,7 @@ var _Quat = class _Quat extends Float64Array { * @returns `out` **/ static setAxisAngle(out, axis, rad) { - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -6785,7 +6843,7 @@ var _Quat = class _Quat extends Float64Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -6823,7 +6881,7 @@ var _Quat = class _Quat extends Float64Array { return Math.acos(2 * dotproduct * dotproduct - 1); } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -7030,7 +7088,7 @@ var _Quat = class _Quat extends Float64Array { * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -7066,7 +7124,7 @@ var _Quat = class _Quat extends Float64Array { } /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -7084,7 +7142,7 @@ var _Quat = class _Quat extends Float64Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -7103,10 +7161,14 @@ var _Quat = class _Quat extends Float64Array { out[2] = (m[1] - m[3]) * fRoot; } else { let i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - let j = (i + 1) % 3; - let k = (i + 2) % 3; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); out[i] = 0.5 * fRoot; fRoot = 0.5 / fRoot; @@ -7128,16 +7190,16 @@ var _Quat = class _Quat extends Float64Array { * @returns `out` */ static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) { - let halfToRad = 0.5 * Math.PI / 180; + const halfToRad = 0.5 * Math.PI / 180; x *= halfToRad; y *= halfToRad; z *= halfToRad; - let sx = Math.sin(x); - let cx = Math.cos(x); - let sy = Math.sin(y); - let cy = Math.cos(y); - let sz = Math.sin(z); - let cz = Math.cos(z); + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); switch (order) { case "xyz": out[0] = sx * cy * cz + cx * sy * sz; @@ -7176,7 +7238,7 @@ var _Quat = class _Quat extends Float64Array { out[3] = cx * cy * cz + sx * sy * sz; break; default: - throw new Error("Unknown angle order " + order); + throw new Error(`Unknown angle order ${order}`); } return out; } @@ -7239,6 +7301,7 @@ var _Quat = class _Quat extends Float64Array { * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static set(out, x, y, z, w) { return out; } @@ -7251,6 +7314,7 @@ var _Quat = class _Quat extends Float64Array { * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static add(out, a, b) { return out; } @@ -7258,6 +7322,7 @@ var _Quat = class _Quat extends Float64Array { * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -7298,6 +7363,7 @@ var _Quat = class _Quat extends Float64Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static lerp(out, a, b, t) { return out; } @@ -7308,6 +7374,7 @@ var _Quat = class _Quat extends Float64Array { * @param a - quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -7315,6 +7382,7 @@ var _Quat = class _Quat extends Float64Array { * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mag(a) { return 0; } @@ -7323,10 +7391,11 @@ var _Quat = class _Quat extends Float64Array { * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static @@ -7335,6 +7404,7 @@ var _Quat = class _Quat extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} * @category Static @@ -7342,6 +7412,7 @@ var _Quat = class _Quat extends Float64Array { * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -7352,6 +7423,7 @@ var _Quat = class _Quat extends Float64Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} * @category Static @@ -7360,28 +7432,31 @@ var _Quat = class _Quat extends Float64Array { * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static normalize(out, a) { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static exactEquals(a, b) { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static equals(a, b) { return false; } @@ -7398,10 +7473,12 @@ var _Quat = class _Quat extends Float64Array { * @returns `out` */ static rotationTo(out, a, b) { - let dot = Vec3.dot(a, b); + const dot = Vec3.dot(a, b); if (dot < -0.999999) { Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); - if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + } Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); return out; @@ -7526,9 +7603,9 @@ var _Quat2 = class _Quat2 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` @@ -7538,9 +7615,9 @@ var _Quat2 = class _Quat2 extends Float64Array { get str() { return _Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. * @category Methods @@ -7552,9 +7629,9 @@ var _Quat2 = class _Quat2 extends Float64Array { super.set(a); return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -7563,9 +7640,9 @@ var _Quat2 = class _Quat2 extends Float64Array { static get BYTE_LENGTH() { return 8 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} * @category Static @@ -8062,7 +8139,7 @@ var _Quat2 = class _Quat2 extends Float64Array { return _Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); const bx = s * axis[0] / axisLength; const by = s * axis[1] / axisLength; @@ -8146,6 +8223,7 @@ var _Quat2 = class _Quat2 extends Float64Array { * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -8177,6 +8255,7 @@ var _Quat2 = class _Quat2 extends Float64Array { * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dot(a, b) { return 0; } @@ -8193,7 +8272,9 @@ var _Quat2 = class _Quat2 extends Float64Array { */ static lerp(out, a, b, t) { const mt = 1 - t; - if (_Quat2.dot(a, b) < 0) t = -t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; out[2] = a[2] * mt + b[2] * t; @@ -8225,8 +8306,8 @@ var _Quat2 = class _Quat2 extends Float64Array { return out; } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -8251,6 +8332,7 @@ var _Quat2 = class _Quat2 extends Float64Array { * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -8261,15 +8343,17 @@ var _Quat2 = class _Quat2 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static @@ -8278,6 +8362,7 @@ var _Quat2 = class _Quat2 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} * @category Static @@ -8285,6 +8370,7 @@ var _Quat2 = class _Quat2 extends Float64Array { * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -8295,6 +8381,7 @@ var _Quat2 = class _Quat2 extends Float64Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} * @category Static @@ -8338,7 +8425,7 @@ var _Quat2 = class _Quat2 extends Float64Array { return `Quat2(${a.join(", ")})`; } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -8349,7 +8436,7 @@ var _Quat2 = class _Quat2 extends Float64Array { 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]; } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -8423,9 +8510,9 @@ var Vec2 = class _Vec2 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -8518,9 +8605,9 @@ var Vec2 = class _Vec2 extends Float64Array { get str() { return _Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. * @category Methods @@ -8566,6 +8653,7 @@ var Vec2 = class _Vec2 extends Float64Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` @@ -8586,6 +8674,7 @@ var Vec2 = class _Vec2 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` @@ -8606,6 +8695,7 @@ var Vec2 = class _Vec2 extends Float64Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` @@ -8651,6 +8741,7 @@ var Vec2 = class _Vec2 extends Float64Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` @@ -8669,6 +8760,7 @@ var Vec2 = class _Vec2 extends Float64Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` @@ -8726,9 +8818,9 @@ var Vec2 = class _Vec2 extends Float64Array { normalize() { return _Vec2.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -8737,9 +8829,9 @@ var Vec2 = class _Vec2 extends Float64Array { static get BYTE_LENGTH() { return 2 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} * @category Static @@ -8829,6 +8921,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0]; } @@ -8850,6 +8943,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0]; } @@ -8871,6 +8965,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0]; } @@ -8985,6 +9080,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -9005,6 +9101,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -9016,8 +9113,8 @@ var Vec2 = class _Vec2 extends Float64Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; + const x = a[0]; + const y = a[1]; return Math.sqrt(x * x + y * y); } /** @@ -9027,6 +9124,7 @@ var Vec2 = class _Vec2 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9035,10 +9133,11 @@ var Vec2 = class _Vec2 extends Float64Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9047,6 +9146,7 @@ var Vec2 = class _Vec2 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} * @category Static @@ -9063,6 +9163,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -9285,7 +9386,7 @@ var Vec2 = class _Vec2 extends Float64Array { return out; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -9296,7 +9397,7 @@ var Vec2 = class _Vec2 extends Float64Array { return a[0] === b[0] && a[1] === b[1]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -9363,13 +9464,23 @@ function EnableSwizzlesF64() { }; case 3: return function() { - return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + return new Vec3( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]] + ); }; case 4: return function() { - return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + return new Vec4( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], + this[SWIZZLE_INDEX[swizzle[3]]] + ); }; } + throw new Error("Illegal swizzle length"); } for (const swizzle of VEC2_SWIZZLES) { const impl = getSwizzleImpl(swizzle); diff --git a/dist-cdn/esm/2016/gl-matrix-f64.js.map b/dist-cdn/esm/2016/gl-matrix-f64.js.map index a5b2ab40..b194b299 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f64.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;;;;;;;;;AASO,IAAM,cAAsB;;;ACTnC;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GAAsB,GAAG,CAAC;AAAA,QAClC;AACA;AAAA,MACF;AACE,cAAM,oBAAK,cAAa;AAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,IAAI,MAAc;AAChB,WAAO,MAAK,IAAI,IAAI;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAK,GAA6B;AAChC,SAAK,IAAI,CAAC;AACV,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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c,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,cAAc,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,cAAc,QAAQ,CAAC,CAAC,CAAC,CAAC;AAAA,QAAG;AAAA,IAC7K;AAAA,EACF;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC3HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", + "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float64Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float64Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float64Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;;;;;;;AASO,IAAM,cAAc;;;ACT3B;AAOO,IAAM,QAAN,MAAM,cAAa,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrC,eAAe,QAAoE;AACjF,YAAQ,OAAO,QAAQ;AAAA,MACrB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,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QAAQ,CAAC,CAAC,CAAC;AAAA,UAAC;AAAA,QACpE;AAAA,IACJ;AAEA,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;ACzIA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": ["_TMP_VEC3", "_TMP_VEC3"] } diff --git a/dist-cdn/esm/2016/gl-matrix-f64.min.js b/dist-cdn/esm/2016/gl-matrix-f64.min.js index a2f8bc4b..d1abd494 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.min.js +++ b/dist-cdn/esm/2016/gl-matrix-f64.min.js @@ -2,5 +2,5 @@ // @author Brandon Jones // @author Colin MacKenzie IV // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) -var de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(xe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-i*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(b*g-l*S-h*z)*Q,e[4]=(y*p-a*P-L*N)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(m*R-M*S-x*o)*Q,e[7]=(k*S-b*R+h*o)*Q,e[8]=(a*I-c*p+L*B)*Q,e[9]=(s*p-n*I-i*B)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*N-a*Y-y*B)*Q,e[13]=(n*Y-s*N+r*B)*Q,e[14]=(d*o-M*z-m*V)*Q,e[15]=(k*z-l*o+b*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-i*Y,e[2]=d*S-m*g+x*z,e[3]=b*g-l*S-h*z,e[4]=y*p-a*P-L*N,e[5]=n*P-r*p+i*N,e[6]=m*R-M*S-x*o,e[7]=k*S-b*R+h*o,e[8]=a*I-c*p+L*B,e[9]=s*p-n*I-i*B,e[10]=M*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-a*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-M*z-m*V,e[15]=k*z-l*o+b*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],b=e[11],h=e[12],M=e[13],d=e[14],m=e[15],x=t*a-n*i,V=t*c-s*i,o=n*c-s*a,R=L*M-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,k=s*c,l=s*y,b=s*L,h=r*y,M=r*L,d=i*L,m=a*c,x=a*y,V=a*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=b-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=M+m,e[7]=0,e[8]=b+x,e[9]=M-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+i*i;return k>0?(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2/k,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2/k):(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=0,e[4]=(r*I-s*P-i*Y)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(s*p-n*I-i*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-M*S-x*o)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case"xzy":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case"yxz":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case"yzx":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case"zxy":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case"zyx":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(", ")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian}; +var de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de("Cannot "+t);var E=(A,e,t)=>(oe(A,e,"read from private field"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};se=new WeakMap,Z(H,se,new Float64Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(", ")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-a*Y)*Q,e[2]=(d*B-m*g+o*z)*Q,e[3]=(M*g-l*B-h*z)*Q,e[4]=(y*p-i*P-L*F)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(m*R-b*B-o*x)*Q,e[7]=(k*B-M*R+h*x)*Q,e[8]=(i*I-c*p+L*D)*Q,e[9]=(s*p-n*I-a*D)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*F-i*Y-y*D)*Q,e[13]=(n*Y-s*F+r*D)*Q,e[14]=(d*x-b*z-m*V)*Q,e[15]=(k*z-l*x+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-a*Y,e[2]=d*B-m*g+o*z,e[3]=M*g-l*B-h*z,e[4]=y*p-i*P-L*F,e[5]=n*P-r*p+a*F,e[6]=m*R-b*B-o*x,e[7]=k*B-M*R+h*x,e[8]=i*I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(", ")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float64Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,"zyx"),Z(f,ie,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function ve(){if(me)return;let A=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error("Illegal swizzle length")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*xe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian}; //# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/esm/2016/gl-matrix-f64.min.js.map b/dist-cdn/esm/2016/gl-matrix-f64.min.js.map index fb6293b8..0aa36464 100644 --- a/dist-cdn/esm/2016/gl-matrix-f64.min.js.map +++ b/dist-cdn/esm/2016/gl-matrix-f64.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;sQAAA,IA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F,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float64Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float64Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float64Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;sQAAA,IAAAA,GAOaC,EAAN,MAAMA,UAAa,YAAa,CAWrC,eAAeC,EAAoE,CACjF,OAAQA,EAAO,OAAQ,CACrB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,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", "__privateAdd", "Mat2", "_IDENTITY_2X3", "_Mat2d", "values", "v", "__privateGet", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "__privateAdd", "Mat2d", "_IDENTITY_3X3", "_Mat3", "values", "v", "__privateGet", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "__privateAdd", "Mat3", "_IDENTITY_4X4", "_TMP_VEC3", "_Mat4", "values", "v", "__privateGet", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "__privateAdd", "Mat4", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "_DEFAULT_ANGLE_ORDER", "_TMP_QUAT1", "_TMP_QUAT2", "_TMP_MAT3", "_TMP_VEC3", "_X_UNIT_VEC3", "_Y_UNIT_VEC3", "_Quat", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "__privateGet", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "__privateAdd", "Quat", "Vec4", "_TMP_QUAT", "_TMP_VEC3", "_Quat2", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "__privateGet", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "__privateAdd", "Quat2", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/esm/2022/gl-matrix-f32.js b/dist-cdn/esm/2022/gl-matrix-f32.js index 6c50e457..ae5dbe15 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.js +++ b/dist-cdn/esm/2022/gl-matrix-f32.js @@ -45,9 +45,9 @@ var Mat2 = class _Mat2 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` @@ -57,9 +57,9 @@ var Mat2 = class _Mat2 extends Float32Array { get str() { return _Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. * @@ -100,6 +100,7 @@ var Mat2 = class _Mat2 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` @@ -142,9 +143,9 @@ var Mat2 = class _Mat2 extends Float32Array { rotate(rad) { return _Mat2.rotate(this, this, rad); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -153,9 +154,9 @@ var Mat2 = class _Mat2 extends Float32Array { static get BYTE_LENGTH() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} * @category Static @@ -239,7 +240,7 @@ var Mat2 = class _Mat2 extends Float32Array { */ static transpose(out, a) { if (out === a) { - let a1 = a[1]; + const a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { @@ -256,7 +257,7 @@ var Mat2 = class _Mat2 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a0 = a[0]; @@ -336,6 +337,7 @@ var Mat2 = class _Mat2 extends Float32Array { * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -367,6 +369,7 @@ var Mat2 = class _Mat2 extends Float32Array { * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -603,9 +606,9 @@ var Mat2d = class _Mat2d extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` @@ -615,9 +618,9 @@ var Mat2d = class _Mat2d extends Float32Array { get str() { return _Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. * @category Methods @@ -660,6 +663,7 @@ var Mat2d = class _Mat2d extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` @@ -693,9 +697,9 @@ var Mat2d = class _Mat2d extends Float32Array { scale(v) { return _Mat2d.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -704,9 +708,9 @@ var Mat2d = class _Mat2d extends Float32Array { static get BYTE_LENGTH() { return 6 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} * @category Static @@ -792,7 +796,7 @@ var Mat2d = class _Mat2d extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const aa = a[0]; @@ -864,6 +868,7 @@ var Mat2d = class _Mat2d extends Float32Array { * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -901,6 +906,7 @@ var Mat2d = class _Mat2d extends Float32Array { * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -986,9 +992,10 @@ var Mat2d = class _Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1007,9 +1014,10 @@ var Mat2d = class _Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1030,9 +1038,10 @@ var Mat2d = class _Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1096,7 +1105,7 @@ var Mat2d = class _Mat2d extends Float32Array { return out; } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1107,7 +1116,7 @@ var Mat2d = class _Mat2d extends Float32Array { 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]; } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1192,9 +1201,9 @@ var Mat3 = class _Mat3 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` @@ -1204,9 +1213,9 @@ var Mat3 = class _Mat3 extends Float32Array { get str() { return _Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. * @category Methods @@ -1249,6 +1258,7 @@ var Mat3 = class _Mat3 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` @@ -1302,9 +1312,9 @@ var Mat3 = class _Mat3 extends Float32Array { scale(v) { return _Mat3.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -1313,9 +1323,9 @@ var Mat3 = class _Mat3 extends Float32Array { static get BYTE_LENGTH() { return 9 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} * @category Static @@ -1440,7 +1450,7 @@ var Mat3 = class _Mat3 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2]; @@ -1559,6 +1569,7 @@ var Mat3 = class _Mat3 extends Float32Array { * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -1605,6 +1616,7 @@ var Mat3 = class _Mat3 extends Float32Array { * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -1698,9 +1710,10 @@ var Mat3 = class _Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1748,9 +1761,10 @@ var Mat3 = class _Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1853,7 +1867,7 @@ var Mat3 = class _Mat3 extends Float32Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -2009,7 +2023,7 @@ var Mat3 = class _Mat3 extends Float32Array { return out; } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2020,7 +2034,7 @@ var Mat3 = class _Mat3 extends Float32Array { 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]; } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2131,9 +2145,9 @@ var Mat4 = class _Mat4 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` @@ -2143,9 +2157,9 @@ var Mat4 = class _Mat4 extends Float32Array { get str() { return _Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. * @category Methods @@ -2186,6 +2200,7 @@ var Mat4 = class _Mat4 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` @@ -2343,9 +2358,9 @@ var Mat4 = class _Mat4 extends Float32Array { orthoZO(left, right, bottom, top, near, far) { return _Mat4.orthoZO(this, left, right, bottom, top, near, far); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -2354,9 +2369,9 @@ var Mat4 = class _Mat4 extends Float32Array { static get BYTE_LENGTH() { return 16 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} * @category Static @@ -2517,7 +2532,7 @@ var Mat4 = class _Mat4 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; @@ -2690,6 +2705,7 @@ var Mat4 = class _Mat4 extends Float32Array { * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -2850,16 +2866,16 @@ var Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static rotateX(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[0] = a[0]; out[1] = a[1]; @@ -2890,16 +2906,16 @@ var Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static rotateY(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[4] = a[4]; out[5] = a[5]; @@ -2930,16 +2946,16 @@ var Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static rotateZ(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; if (a !== out) { out[8] = a[8]; out[9] = a[9]; @@ -2963,9 +2979,10 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -2994,9 +3011,10 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3025,9 +3043,10 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3071,9 +3090,10 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3081,8 +3101,8 @@ var Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static fromXRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = 1; out[1] = 0; out[2] = 0; @@ -3104,9 +3124,10 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3114,8 +3135,8 @@ var Mat4 = class _Mat4 extends Float32Array { * @returns `out` */ static fromYRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = c; out[1] = 0; out[2] = -s; @@ -3137,9 +3158,10 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3170,12 +3192,13 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3235,7 +3258,7 @@ var Mat4 = class _Mat4 extends Float32Array { const ay = a[5]; const az = a[6]; const aw = a[7]; - let magnitude = bx * bx + by * by + bz * bz + bw * bw; + const magnitude = bx * bx + by * by + bz * bz + bw * bw; if (magnitude > 0) { _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; @@ -3254,7 +3277,7 @@ var Mat4 = class _Mat4 extends Float32Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -3516,13 +3539,14 @@ var Mat4 = class _Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3570,17 +3594,18 @@ var Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3734,6 +3759,7 @@ var Mat4 = class _Mat4 extends Float32Array { static frustum(out, left, right, bottom, top, near, far = Infinity) { return out; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], @@ -3822,6 +3848,7 @@ var Mat4 = class _Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static perspective(out, fovy, aspect, near, far = Infinity) { return out; } @@ -3866,9 +3893,8 @@ var Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3904,9 +3930,8 @@ var Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3945,13 +3970,13 @@ var Mat4 = class _Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static ortho(out, left, right, bottom, top, near, far) { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3986,8 +4011,8 @@ var Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4189,6 +4214,7 @@ var Mat4 = class _Mat4 extends Float32Array { * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -4250,7 +4276,7 @@ var Mat4 = class _Mat4 extends Float32Array { return out; } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -4261,7 +4287,7 @@ var Mat4 = class _Mat4 extends Float32Array { 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]; } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -4350,9 +4376,9 @@ var Vec3 = class _Vec3 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -4469,9 +4495,9 @@ var Vec3 = class _Vec3 extends Float32Array { get str() { return _Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. * @category Methods @@ -4518,6 +4544,7 @@ var Vec3 = class _Vec3 extends Float32Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` @@ -4539,6 +4566,7 @@ var Vec3 = class _Vec3 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` @@ -4560,6 +4588,7 @@ var Vec3 = class _Vec3 extends Float32Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` @@ -4607,6 +4636,7 @@ var Vec3 = class _Vec3 extends Float32Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` @@ -4625,6 +4655,7 @@ var Vec3 = class _Vec3 extends Float32Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` @@ -4685,9 +4716,9 @@ var Vec3 = class _Vec3 extends Float32Array { normalize() { return _Vec3.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -4696,9 +4727,9 @@ var Vec3 = class _Vec3 extends Float32Array { static get BYTE_LENGTH() { return 3 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 * @category Static @@ -4726,9 +4757,9 @@ var Vec3 = class _Vec3 extends Float32Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; - let z = a[2]; + const x = a[0]; + const y = a[1]; + const z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /** @@ -4738,6 +4769,7 @@ var Vec3 = class _Vec3 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4746,10 +4778,11 @@ var Vec3 = class _Vec3 extends Float32Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4758,6 +4791,7 @@ var Vec3 = class _Vec3 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values * @category Static @@ -4834,6 +4868,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0, 0]; } @@ -4856,6 +4891,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0, 0]; } @@ -4878,6 +4914,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0, 0]; } @@ -4947,7 +4984,8 @@ var Vec3 = class _Vec3 extends Float32Array { * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -5002,6 +5040,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -5023,6 +5062,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -5043,6 +5083,7 @@ var Vec3 = class _Vec3 extends Float32Array { * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -5232,7 +5273,8 @@ var Vec3 = class _Vec3 extends Float32Array { * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -5272,7 +5314,7 @@ var Vec3 = class _Vec3 extends Float32Array { * @returns `out` */ static transformMat3(out, a, m) { - let x = a[0], y = a[1], z = a[2]; + const x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; out[1] = x * m[1] + y * m[4] + z * m[7]; out[2] = x * m[2] + y * m[5] + z * m[8]; @@ -5410,7 +5452,7 @@ var Vec3 = class _Vec3 extends Float32Array { return `Vec3(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -5421,7 +5463,7 @@ var Vec3 = class _Vec3 extends Float32Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -5482,9 +5524,9 @@ var Vec4 = class _Vec4 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -5602,9 +5644,9 @@ var Vec4 = class _Vec4 extends Float32Array { get str() { return _Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. * @category Methods @@ -5653,6 +5695,7 @@ var Vec4 = class _Vec4 extends Float32Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` @@ -5675,6 +5718,7 @@ var Vec4 = class _Vec4 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` @@ -5697,6 +5741,7 @@ var Vec4 = class _Vec4 extends Float32Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` @@ -5746,6 +5791,7 @@ var Vec4 = class _Vec4 extends Float32Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` @@ -5764,6 +5810,7 @@ var Vec4 = class _Vec4 extends Float32Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` @@ -5827,9 +5874,9 @@ var Vec4 = class _Vec4 extends Float32Array { normalize() { return _Vec4.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -5838,9 +5885,9 @@ var Vec4 = class _Vec4 extends Float32Array { static get BYTE_LENGTH() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} * @category Static @@ -5942,6 +5989,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -5965,6 +6013,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -5988,6 +6037,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return out; } @@ -6120,6 +6170,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -6142,6 +6193,7 @@ var Vec4 = class _Vec4 extends Float32Array { * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -6166,15 +6218,17 @@ var Vec4 = class _Vec4 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static @@ -6183,6 +6237,7 @@ var Vec4 = class _Vec4 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} * @category Static @@ -6204,6 +6259,7 @@ var Vec4 = class _Vec4 extends Float32Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} * @category Static @@ -6339,7 +6395,8 @@ var Vec4 = class _Vec4 extends Float32Array { * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -6437,7 +6494,7 @@ var Vec4 = class _Vec4 extends Float32Array { return `Vec4(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -6448,7 +6505,7 @@ var Vec4 = class _Vec4 extends Float32Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -6521,9 +6578,9 @@ var Quat = class _Quat extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -6599,9 +6656,9 @@ var Quat = class _Quat extends Float32Array { get str() { return _Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. * @category Methods @@ -6645,6 +6702,7 @@ var Quat = class _Quat extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` @@ -6714,9 +6772,9 @@ var Quat = class _Quat extends Float32Array { dot(b) { return _Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -6725,9 +6783,9 @@ var Quat = class _Quat extends Float32Array { static get BYTE_LENGTH() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat * @category Static @@ -6762,7 +6820,7 @@ var Quat = class _Quat extends Float32Array { * @returns `out` **/ static setAxisAngle(out, axis, rad) { - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -6774,7 +6832,7 @@ var Quat = class _Quat extends Float32Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -6812,7 +6870,7 @@ var Quat = class _Quat extends Float32Array { return Math.acos(2 * dotproduct * dotproduct - 1); } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -7019,7 +7077,7 @@ var Quat = class _Quat extends Float32Array { * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -7055,7 +7113,7 @@ var Quat = class _Quat extends Float32Array { } /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -7073,7 +7131,7 @@ var Quat = class _Quat extends Float32Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -7092,10 +7150,14 @@ var Quat = class _Quat extends Float32Array { out[2] = (m[1] - m[3]) * fRoot; } else { let i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - let j = (i + 1) % 3; - let k = (i + 2) % 3; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); out[i] = 0.5 * fRoot; fRoot = 0.5 / fRoot; @@ -7117,16 +7179,16 @@ var Quat = class _Quat extends Float32Array { * @returns `out` */ static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) { - let halfToRad = 0.5 * Math.PI / 180; + const halfToRad = 0.5 * Math.PI / 180; x *= halfToRad; y *= halfToRad; z *= halfToRad; - let sx = Math.sin(x); - let cx = Math.cos(x); - let sy = Math.sin(y); - let cy = Math.cos(y); - let sz = Math.sin(z); - let cz = Math.cos(z); + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); switch (order) { case "xyz": out[0] = sx * cy * cz + cx * sy * sz; @@ -7165,7 +7227,7 @@ var Quat = class _Quat extends Float32Array { out[3] = cx * cy * cz + sx * sy * sz; break; default: - throw new Error("Unknown angle order " + order); + throw new Error(`Unknown angle order ${order}`); } return out; } @@ -7228,6 +7290,7 @@ var Quat = class _Quat extends Float32Array { * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static set(out, x, y, z, w) { return out; } @@ -7240,6 +7303,7 @@ var Quat = class _Quat extends Float32Array { * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static add(out, a, b) { return out; } @@ -7247,6 +7311,7 @@ var Quat = class _Quat extends Float32Array { * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -7287,6 +7352,7 @@ var Quat = class _Quat extends Float32Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static lerp(out, a, b, t) { return out; } @@ -7297,6 +7363,7 @@ var Quat = class _Quat extends Float32Array { * @param a - quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -7304,6 +7371,7 @@ var Quat = class _Quat extends Float32Array { * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mag(a) { return 0; } @@ -7312,10 +7380,11 @@ var Quat = class _Quat extends Float32Array { * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static @@ -7324,6 +7393,7 @@ var Quat = class _Quat extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} * @category Static @@ -7331,6 +7401,7 @@ var Quat = class _Quat extends Float32Array { * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -7341,6 +7412,7 @@ var Quat = class _Quat extends Float32Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} * @category Static @@ -7349,28 +7421,31 @@ var Quat = class _Quat extends Float32Array { * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static normalize(out, a) { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static exactEquals(a, b) { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static equals(a, b) { return false; } @@ -7387,10 +7462,12 @@ var Quat = class _Quat extends Float32Array { * @returns `out` */ static rotationTo(out, a, b) { - let dot = Vec3.dot(a, b); + const dot = Vec3.dot(a, b); if (dot < -0.999999) { Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a); - if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + } Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3); _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI); return out; @@ -7501,9 +7578,9 @@ var Quat2 = class _Quat2 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` @@ -7513,9 +7590,9 @@ var Quat2 = class _Quat2 extends Float32Array { get str() { return _Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. * @category Methods @@ -7527,9 +7604,9 @@ var Quat2 = class _Quat2 extends Float32Array { super.set(a); return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -7538,9 +7615,9 @@ var Quat2 = class _Quat2 extends Float32Array { static get BYTE_LENGTH() { return 8 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} * @category Static @@ -8037,7 +8114,7 @@ var Quat2 = class _Quat2 extends Float32Array { return _Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); const bx = s * axis[0] / axisLength; const by = s * axis[1] / axisLength; @@ -8121,6 +8198,7 @@ var Quat2 = class _Quat2 extends Float32Array { * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -8152,6 +8230,7 @@ var Quat2 = class _Quat2 extends Float32Array { * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dot(a, b) { return 0; } @@ -8168,7 +8247,9 @@ var Quat2 = class _Quat2 extends Float32Array { */ static lerp(out, a, b, t) { const mt = 1 - t; - if (_Quat2.dot(a, b) < 0) t = -t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; out[2] = a[2] * mt + b[2] * t; @@ -8200,8 +8281,8 @@ var Quat2 = class _Quat2 extends Float32Array { return out; } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -8226,6 +8307,7 @@ var Quat2 = class _Quat2 extends Float32Array { * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -8236,15 +8318,17 @@ var Quat2 = class _Quat2 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static @@ -8253,6 +8337,7 @@ var Quat2 = class _Quat2 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} * @category Static @@ -8260,6 +8345,7 @@ var Quat2 = class _Quat2 extends Float32Array { * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -8270,6 +8356,7 @@ var Quat2 = class _Quat2 extends Float32Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} * @category Static @@ -8313,7 +8400,7 @@ var Quat2 = class _Quat2 extends Float32Array { return `Quat2(${a.join(", ")})`; } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -8324,7 +8411,7 @@ var Quat2 = class _Quat2 extends Float32Array { 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]; } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -8391,9 +8478,9 @@ var Vec2 = class _Vec2 extends Float32Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -8486,9 +8573,9 @@ var Vec2 = class _Vec2 extends Float32Array { get str() { return _Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. * @category Methods @@ -8534,6 +8621,7 @@ var Vec2 = class _Vec2 extends Float32Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` @@ -8554,6 +8642,7 @@ var Vec2 = class _Vec2 extends Float32Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` @@ -8574,6 +8663,7 @@ var Vec2 = class _Vec2 extends Float32Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` @@ -8619,6 +8709,7 @@ var Vec2 = class _Vec2 extends Float32Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` @@ -8637,6 +8728,7 @@ var Vec2 = class _Vec2 extends Float32Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` @@ -8694,9 +8786,9 @@ var Vec2 = class _Vec2 extends Float32Array { normalize() { return _Vec2.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -8705,9 +8797,9 @@ var Vec2 = class _Vec2 extends Float32Array { static get BYTE_LENGTH() { return 2 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} * @category Static @@ -8797,6 +8889,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0]; } @@ -8818,6 +8911,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0]; } @@ -8839,6 +8933,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0]; } @@ -8953,6 +9048,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -8973,6 +9069,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -8984,8 +9081,8 @@ var Vec2 = class _Vec2 extends Float32Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; + const x = a[0]; + const y = a[1]; return Math.sqrt(x * x + y * y); } /** @@ -8995,6 +9092,7 @@ var Vec2 = class _Vec2 extends Float32Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9003,10 +9101,11 @@ var Vec2 = class _Vec2 extends Float32Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9015,6 +9114,7 @@ var Vec2 = class _Vec2 extends Float32Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} * @category Static @@ -9031,6 +9131,7 @@ var Vec2 = class _Vec2 extends Float32Array { * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -9253,7 +9354,7 @@ var Vec2 = class _Vec2 extends Float32Array { return out; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -9264,7 +9365,7 @@ var Vec2 = class _Vec2 extends Float32Array { return a[0] === b[0] && a[1] === b[1]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -9331,13 +9432,23 @@ function EnableSwizzles() { }; case 3: return function() { - return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + return new Vec3( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]] + ); }; case 4: return function() { - return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + return new Vec4( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], + this[SWIZZLE_INDEX[swizzle[3]]] + ); }; } + throw new Error("Illegal swizzle length"); } for (const swizzle of VEC2_SWIZZLES) { const impl = getSwizzleImpl(swizzle); diff --git a/dist-cdn/esm/2022/gl-matrix-f32.js.map b/dist-cdn/esm/2022/gl-matrix-f32.js.map index baa34475..04eb5848 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f32.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;;;AASO,IAAM,cAAsB;;;ACF5B,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AAC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**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float32Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float32Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float32Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;AASO,IAAM,cAAc;;;ACFpB,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAoE;AACjF,YAAQ,OAAO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,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;ACxIA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": [] } diff --git a/dist-cdn/esm/2022/gl-matrix-f32.min.js b/dist-cdn/esm/2022/gl-matrix-f32.min.js index 2bb065aa..7c0105dc 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.min.js +++ b/dist-cdn/esm/2022/gl-matrix-f32.min.js @@ -2,5 +2,5 @@ // @author Brandon Jones // @author Colin MacKenzie IV // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) -var Z=class b extends Float32Array{static#t=new Float32Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float32Array{static#t=new Float32Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[3]=k-o,e[6]=M+x,e[1]=k+o,e[4]=1-L-d,e[7]=h-m,e[2]=M-x,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=(r*D-s*N-a*F)*Q,e[4]=(n*N-r*f+a*B)*Q,e[5]=(s*f-n*D-a*A)*Q,e[6]=(m*T-x*V+o*w)*Q,e[7]=(x*g-d*T-o*R)*Q,e[8]=(d*V-m*g+o*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(r*D-s*N-a*F)*Q,e[2]=(m*T-x*V+o*w)*Q,e[3]=(M*V-l*T-h*w)*Q,e[4]=(y*f-i*N-L*B)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(x*g-d*T-o*R)*Q,e[7]=(k*T-M*g+h*R)*Q,e[8]=(i*D-c*f+L*A)*Q,e[9]=(s*f-n*D-a*A)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=(l*g-k*V-h*z)*Q,e[12]=(c*B-i*F-y*A)*Q,e[13]=(n*F-s*B+r*A)*Q,e[14]=(m*R-d*w-x*z)*Q,e[15]=(k*w-l*R+M*z)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x;return e[0]=c*N-y*D+L*F,e[1]=r*D-s*N-a*F,e[2]=m*T-x*V+o*w,e[3]=M*V-l*T-h*w,e[4]=y*f-i*N-L*B,e[5]=n*N-r*f+a*B,e[6]=x*g-d*T-o*R,e[7]=k*T-M*g+h*R,e[8]=i*D-c*f+L*A,e[9]=s*f-n*D-a*A,e[10]=d*V-m*g+o*z,e[11]=l*g-k*V-h*z,e[12]=c*B-i*F-y*A,e[13]=n*F-s*B+r*A,e[14]=m*R-d*w-x*z,e[15]=k*w-l*R+M*z,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],x=e[15],o=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,B=L*R-k*z+l*o,f=h*R-d*z+m*o;return y*T-r*A+x*B-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],x=t[13],o=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*x,e[2]=R*a+g*L+w*h+V*o,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*x,e[6]=R*a+g*L+w*h+V*o,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*x,e[10]=R*a+g*L+w*h+V*o,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*x,e[14]=R*a+g*L+w*h+V*o,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],x=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=x,e[11]=o,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+x*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,B=i*r*k-a*y,f=r*a*k-i*y,F=a*a*k+L,D=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*B,e[1]=M*T+x*A+g*B,e[2]=h*T+o*A+w*B,e[3]=d*T+z*A+V*B,e[4]=l*f+m*F+R*D,e[5]=M*f+x*F+g*D,e[6]=h*f+o*F+w*D,e[7]=d*f+z*F+V*D,e[8]=l*N+m*Q+R*Y,e[9]=M*N+x*Q+g*Y,e[10]=h*N+o*Q+w*Y,e[11]=d*N+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,x=i*c,o=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-o,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+x,e[7]=0,e[8]=M+o,e[9]=d-x,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,F=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*F+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*F)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=0,e[4]=(r*D-s*N-a*F)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(s*f-n*D-a*A)*Q,e[7]=0,e[8]=(m*T-x*V+o*w)*Q,e[9]=(x*g-d*T-o*R)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],x=r*h,o=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,B=x+g+A,f=0;return B>0?(f=Math.sqrt(B+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(o-R)/f):x>g&&x>A?(f=Math.sqrt(1+x-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(o+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-x-A)*2,e[3]=(V-z)/f,e[0]=(o+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-x-g)*2,e[3]=(o-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,x=i*k,o=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+x))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+x))*w,e[6]=(m+o)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-o)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,x=i*l,o=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],B=r[1],f=r[2],F=(1-(m+o))*w,D=(h+g)*w,N=(d-R)*w,Q=(h-g)*V,Y=(1-(M+o))*V,X=(x+z)*V,C=(d+R)*T,H=(x-z)*T,$=(1-(M+m))*T;return e[0]=F,e[1]=D,e[2]=N,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+A-(F*A+Q*B+C*f),e[13]=n[1]+B-(D*A+Y*B+H*f),e[14]=n[2]+f-(N*A+X*B+$*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[1]=k+o,e[2]=M-x,e[3]=0,e[4]=k-o,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+x,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,x=1/Math.sqrt(h*h+d*d+m*m);h*=x,d*=x,m*=x;let o=y*m-L*d,z=L*h-c*m,R=c*d-y*h;x=Math.sqrt(o*o+z*z+R*R),x?(x=1/x,o*=x,z*=x,R*=x):(o=0,z=0,R=0);let g=d*R-m*z,w=m*o-h*R,V=h*z-d*o;return x=Math.sqrt(g*g+w*w+V*V),x?(x=1/x,g*=x,w*=x,V*=x):(g=0,w=0,V=0),e[0]=o,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(o*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,x=c*l-y*k;return h=d*d+m*m+x*x,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,x*=h),e[0]=d,e[1]=m,e[2]=x,e[3]=0,e[4]=l*x-M*m,e[5]=M*d-k*x,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],x=e[14],o=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],B=t[7],f=t[8],F=t[9],D=t[10],N=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-B)<=1e-6*Math.max(1,Math.abs(L),Math.abs(B))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-F)<=1e-6*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(M-D)<=1e-6*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(h-N)<=1e-6*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(x-X)<=1e-6*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(o-C)<=1e-6*Math.max(1,Math.abs(o),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var I=class b extends Float32Array{static#t="zyx";static#e=new Float32Array(4);static#r=new Float32Array(4);static#n=new Float32Array(9);static#s=new Float32Array(3);static#a=new Float32Array([1,0,0]);static#i=new Float32Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),x=Math.sin(m);M=Math.sin((1-s)*m)/x,h=Math.sin(s*m)/x}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};I.set=E.set;I.add=E.add;I.lerp=E.lerp;I.normalize=E.normalize;I.squaredLength=E.squaredLength;I.sqrLen=E.squaredLength;I.exactEquals=E.exactEquals;I.equals=E.equals;I.magnitude=E.magnitude;I.prototype.mul=I.prototype.multiply;I.mul=I.multiply;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var O=class b extends Float32Array{static#t=new Float32Array(4);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return I.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],x=t[6],o=t[7];return e[4]=d*L+o*i+m*y-x*c,e[5]=m*L+o*c+x*i-d*y,e[6]=x*L+o*y+d*c-m*i,e[7]=o*L-d*i-m*c-x*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],x=n[1],o=n[2],z=n[3];return e[0]=s*z+i*m+r*o-a*x,e[1]=r*z+i*x+a*m-s*o,e[2]=a*z+i*o+s*x-r*m,e[3]=i*z-s*m-r*x-a*o,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*o-h*x,e[5]=r*k+i*y+a*c-s*L+M*z+d*x+h*m-l*o,e[6]=a*k+i*L+s*y-r*c+h*z+d*o+l*x-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*x-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],x=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};O.dot=I.dot;O.squaredLength=I.squaredLength;O.sqrLen=I.squaredLength;O.mag=I.magnitude;O.length=I.magnitude;O.len=I.magnitude;O.mul=O.multiply;var S=class b extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};S.prototype.sub=S.prototype.subtract;S.prototype.mul=S.prototype.multiply;S.prototype.div=S.prototype.divide;S.prototype.dist=S.prototype.distance;S.prototype.sqrDist=S.prototype.squaredDistance;S.sub=S.subtract;S.mul=S.multiply;S.div=S.divide;S.dist=S.distance;S.sqrDist=S.squaredDistance;S.sqrLen=S.squaredLength;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var W=!1;function ze(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new S(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of b){let a=s(r);Object.defineProperty(S.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function pe(b){return b*J}function fe(b){return b*U}export{ze as EnableSwizzles,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,I as Quat,O as Quat2,S as Vec2,q as Vec3,E as Vec4,Z as mat2,j as mat2d,G as mat3,P as mat4,I as quat,O as quat2,pe as toDegree,fe as toRadian,S as vec2,q as vec3,E as vec4}; +var Z=class b extends Float32Array{static#t=new Float32Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float32Array{static#t=new Float32Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[3]=k-x,e[6]=M+o,e[1]=k+x,e[4]=1-L-d,e[7]=h-m,e[2]=M-o,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(y*f-i*F-L*D)*Q,e[2]=(i*S-c*f+L*A)*Q,e[3]=(r*S-s*F-a*I)*Q,e[4]=(n*F-r*f+a*D)*Q,e[5]=(s*f-n*S-a*A)*Q,e[6]=(m*T-o*V+x*w)*Q,e[7]=(o*g-d*T-x*R)*Q,e[8]=(d*V-m*g+x*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-o)<=1e-6*Math.max(1,Math.abs(c),Math.abs(o))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float32Array{static#t=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o,Q=z*F-R*S+g*I+w*f-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=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,D=L*R-k*z+l*x,f=h*R-d*z+m*x;return y*T-r*A+o*D-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],o=t[13],x=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*o,e[2]=R*a+g*L+w*h+V*x,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*o,e[6]=R*a+g*L+w*h+V*x,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*o,e[10]=R*a+g*L+w*h+V*x,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*o,e[14]=R*a+g*L+w*h+V*x,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],o=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=o,e[11]=x,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+o*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,D=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,S=i*a*k+r*y,F=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*D,e[1]=M*T+o*A+g*D,e[2]=h*T+x*A+w*D,e[3]=d*T+z*A+V*D,e[4]=l*f+m*I+R*S,e[5]=M*f+o*I+g*S,e[6]=h*f+x*I+w*S,e[7]=d*f+z*I+V*S,e[8]=l*F+m*Q+R*Y,e[9]=M*F+o*Q+g*Y,e[10]=h*F+x*Q+w*Y,e[11]=d*F+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,o=i*c,x=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-x,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+o,e[7]=0,e[8]=M+x,e[9]=d-o,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(y*f-i*F-L*D)*Q,e[2]=(i*S-c*f+L*A)*Q,e[3]=0,e[4]=(r*S-s*F-a*I)*Q,e[5]=(n*F-r*f+a*D)*Q,e[6]=(s*f-n*S-a*A)*Q,e[7]=0,e[8]=(m*T-o*V+x*w)*Q,e[9]=(o*g-d*T-x*R)*Q,e[10]=(d*V-m*g+x*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],o=r*h,x=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,D=o+g+A,f=0;return D>0?(f=Math.sqrt(D+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(x-R)/f):o>g&&o>A?(f=Math.sqrt(1+o-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(x+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-o-A)*2,e[3]=(V-z)/f,e[0]=(x+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-o-g)*2,e[3]=(x-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,o=i*k,x=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+o))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+o))*w,e[6]=(m+x)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-x)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,o=i*l,x=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],D=r[1],f=r[2],I=(1-(m+x))*w,S=(h+g)*w,F=(d-R)*w,Q=(h-g)*V,Y=(1-(M+x))*V,X=(o+z)*V,C=(d+R)*T,$=(o-z)*T,H=(1-(M+m))*T;return e[0]=I,e[1]=S,e[2]=F,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=$,e[10]=H,e[11]=0,e[12]=n[0]+A-(I*A+Q*D+C*f),e[13]=n[1]+D-(S*A+Y*D+$*f),e[14]=n[2]+f-(F*A+X*D+H*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[1]=k+x,e[2]=M-o,e[3]=0,e[4]=k-x,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+o,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,o=1/Math.sqrt(h*h+d*d+m*m);h*=o,d*=o,m*=o;let x=y*m-L*d,z=L*h-c*m,R=c*d-y*h;o=Math.sqrt(x*x+z*z+R*R),o?(o=1/o,x*=o,z*=o,R*=o):(x=0,z=0,R=0);let g=d*R-m*z,w=m*x-h*R,V=h*z-d*x;return o=Math.sqrt(g*g+w*w+V*V),o?(o=1/o,g*=o,w*=o,V*=o):(g=0,w=0,V=0),e[0]=x,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(x*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,o=c*l-y*k;return h=d*d+m*m+o*o,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,o*=h),e[0]=d,e[1]=m,e[2]=o,e[3]=0,e[4]=l*o-M*m,e[5]=M*d-k*o,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],o=e[14],x=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],D=t[7],f=t[8],I=t[9],S=t[10],F=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-D)<=1e-6*Math.max(1,Math.abs(L),Math.abs(D))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(M-S)<=1e-6*Math.max(1,Math.abs(M),Math.abs(S))&&Math.abs(h-F)<=1e-6*Math.max(1,Math.abs(h),Math.abs(F))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(o-X)<=1e-6*Math.max(1,Math.abs(o),Math.abs(X))&&Math.abs(x-C)<=1e-6*Math.max(1,Math.abs(x),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var N=class b extends Float32Array{static#t="zyx";static#e=new Float32Array(4);static#r=new Float32Array(4);static#n=new Float32Array(9);static#s=new Float32Array(3);static#a=new Float32Array([1,0,0]);static#i=new Float32Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),o=Math.sin(m);M=Math.sin((1-s)*m)/o,h=Math.sin(s*m)/o}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};N.set=E.set;N.add=E.add;N.lerp=E.lerp;N.normalize=E.normalize;N.squaredLength=E.squaredLength;N.sqrLen=E.squaredLength;N.exactEquals=E.exactEquals;N.equals=E.equals;N.magnitude=E.magnitude;N.prototype.mul=N.prototype.multiply;N.mul=N.multiply;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var O=class b extends Float32Array{static#t=new Float32Array(4);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],o=t[6],x=t[7];return e[4]=d*L+x*i+m*y-o*c,e[5]=m*L+x*c+o*i-d*y,e[6]=o*L+x*y+d*c-m*i,e[7]=x*L-d*i-m*c-o*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],o=n[1],x=n[2],z=n[3];return e[0]=s*z+i*m+r*x-a*o,e[1]=r*z+i*o+a*m-s*x,e[2]=a*z+i*x+s*o-r*m,e[3]=i*z-s*m-r*o-a*x,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*x-h*o,e[5]=r*k+i*y+a*c-s*L+M*z+d*o+h*m-l*x,e[6]=a*k+i*L+s*y-r*c+h*z+d*x+l*o-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*o-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],o=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};O.dot=N.dot;O.squaredLength=N.squaredLength;O.sqrLen=N.squaredLength;O.mag=N.magnitude;O.length=N.magnitude;O.len=N.magnitude;O.mul=O.multiply;var B=class b extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};B.prototype.sub=B.prototype.subtract;B.prototype.mul=B.prototype.multiply;B.prototype.div=B.prototype.divide;B.prototype.dist=B.prototype.distance;B.prototype.sqrDist=B.prototype.squaredDistance;B.sub=B.subtract;B.mul=B.multiply;B.div=B.divide;B.dist=B.distance;B.sqrDist=B.squaredDistance;B.sqrLen=B.squaredLength;B.mag=B.magnitude;B.length=B.magnitude;B.len=B.magnitude;var W=!1;function ze(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new B(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error("Illegal swizzle length")}for(let r of b){let a=s(r);Object.defineProperty(B.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function pe(b){return b*J}function fe(b){return b*U}export{ze as EnableSwizzles,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,N as Quat,O as Quat2,B as Vec2,q as Vec3,E as Vec4,Z as mat2,j as mat2d,G as mat3,P as mat4,N as quat,O as quat2,pe as toDegree,fe as toRadian,B as vec2,q as vec3,E as vec4}; //# sourceMappingURL=gl-matrix-f32.min.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f32.min.js.map b/dist-cdn/esm/2022/gl-matrix-f32.min.js.map index 7e0fc984..20b49309 100644 --- a/dist-cdn/esm/2022/gl-matrix-f32.min.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f32.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;AAOO,IA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S,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CC1HA,IAAMY,EAAyB,KAAK,GAAK,IAKnCC,EAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float32Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float32Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float32Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;AAOO,IAAMA,EAAN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,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CCxIA,IAAMY,EAAyB,KAAK,GAAK,IAKnCC,EAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", "names": ["Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/esm/2022/gl-matrix-f64.js b/dist-cdn/esm/2022/gl-matrix-f64.js index 6746d817..bdd6fe37 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.js +++ b/dist-cdn/esm/2022/gl-matrix-f64.js @@ -45,9 +45,9 @@ var Mat2 = class _Mat2 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` @@ -57,9 +57,9 @@ var Mat2 = class _Mat2 extends Float64Array { get str() { return _Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. * @@ -100,6 +100,7 @@ var Mat2 = class _Mat2 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` @@ -142,9 +143,9 @@ var Mat2 = class _Mat2 extends Float64Array { rotate(rad) { return _Mat2.rotate(this, this, rad); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -153,9 +154,9 @@ var Mat2 = class _Mat2 extends Float64Array { static get BYTE_LENGTH() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} * @category Static @@ -239,7 +240,7 @@ var Mat2 = class _Mat2 extends Float64Array { */ static transpose(out, a) { if (out === a) { - let a1 = a[1]; + const a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { @@ -256,7 +257,7 @@ var Mat2 = class _Mat2 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a0 = a[0]; @@ -336,6 +337,7 @@ var Mat2 = class _Mat2 extends Float64Array { * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -367,6 +369,7 @@ var Mat2 = class _Mat2 extends Float64Array { * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -603,9 +606,9 @@ var Mat2d = class _Mat2d extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` @@ -615,9 +618,9 @@ var Mat2d = class _Mat2d extends Float64Array { get str() { return _Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. * @category Methods @@ -660,6 +663,7 @@ var Mat2d = class _Mat2d extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` @@ -693,9 +697,9 @@ var Mat2d = class _Mat2d extends Float64Array { scale(v) { return _Mat2d.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -704,9 +708,9 @@ var Mat2d = class _Mat2d extends Float64Array { static get BYTE_LENGTH() { return 6 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} * @category Static @@ -792,7 +796,7 @@ var Mat2d = class _Mat2d extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const aa = a[0]; @@ -864,6 +868,7 @@ var Mat2d = class _Mat2d extends Float64Array { * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -901,6 +906,7 @@ var Mat2d = class _Mat2d extends Float64Array { * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -986,9 +992,10 @@ var Mat2d = class _Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1007,9 +1014,10 @@ var Mat2d = class _Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1030,9 +1038,10 @@ var Mat2d = class _Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1096,7 +1105,7 @@ var Mat2d = class _Mat2d extends Float64Array { return out; } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1107,7 +1116,7 @@ var Mat2d = class _Mat2d extends Float64Array { 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]; } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1192,9 +1201,9 @@ var Mat3 = class _Mat3 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` @@ -1204,9 +1213,9 @@ var Mat3 = class _Mat3 extends Float64Array { get str() { return _Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. * @category Methods @@ -1249,6 +1258,7 @@ var Mat3 = class _Mat3 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` @@ -1302,9 +1312,9 @@ var Mat3 = class _Mat3 extends Float64Array { scale(v) { return _Mat3.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -1313,9 +1323,9 @@ var Mat3 = class _Mat3 extends Float64Array { static get BYTE_LENGTH() { return 9 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} * @category Static @@ -1440,7 +1450,7 @@ var Mat3 = class _Mat3 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2]; @@ -1559,6 +1569,7 @@ var Mat3 = class _Mat3 extends Float64Array { * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -1605,6 +1616,7 @@ var Mat3 = class _Mat3 extends Float64Array { * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -1698,9 +1710,10 @@ var Mat3 = class _Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1748,9 +1761,10 @@ var Mat3 = class _Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1853,7 +1867,7 @@ var Mat3 = class _Mat3 extends Float64Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -2009,7 +2023,7 @@ var Mat3 = class _Mat3 extends Float64Array { return out; } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2020,7 +2034,7 @@ var Mat3 = class _Mat3 extends Float64Array { 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]; } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2131,9 +2145,9 @@ var Mat4 = class _Mat4 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` @@ -2143,9 +2157,9 @@ var Mat4 = class _Mat4 extends Float64Array { get str() { return _Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. * @category Methods @@ -2186,6 +2200,7 @@ var Mat4 = class _Mat4 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` @@ -2343,9 +2358,9 @@ var Mat4 = class _Mat4 extends Float64Array { orthoZO(left, right, bottom, top, near, far) { return _Mat4.orthoZO(this, left, right, bottom, top, near, far); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -2354,9 +2369,9 @@ var Mat4 = class _Mat4 extends Float64Array { static get BYTE_LENGTH() { return 16 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} * @category Static @@ -2517,7 +2532,7 @@ var Mat4 = class _Mat4 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out, a) { const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; @@ -2690,6 +2705,7 @@ var Mat4 = class _Mat4 extends Float64Array { * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -2850,16 +2866,16 @@ var Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static rotateX(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[0] = a[0]; out[1] = a[1]; @@ -2890,16 +2906,16 @@ var Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static rotateY(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { out[4] = a[4]; out[5] = a[5]; @@ -2930,16 +2946,16 @@ var Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static rotateZ(out, a, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; if (a !== out) { out[8] = a[8]; out[9] = a[9]; @@ -2963,9 +2979,10 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -2994,9 +3011,10 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3025,9 +3043,10 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3071,9 +3090,10 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3081,8 +3101,8 @@ var Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static fromXRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = 1; out[1] = 0; out[2] = 0; @@ -3104,9 +3124,10 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3114,8 +3135,8 @@ var Mat4 = class _Mat4 extends Float64Array { * @returns `out` */ static fromYRotation(out, rad) { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); out[0] = c; out[1] = 0; out[2] = -s; @@ -3137,9 +3158,10 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3170,12 +3192,13 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3235,7 +3258,7 @@ var Mat4 = class _Mat4 extends Float64Array { const ay = a[5]; const az = a[6]; const aw = a[7]; - let magnitude = bx * bx + by * by + bz * bz + bw * bw; + const magnitude = bx * bx + by * by + bz * bz + bw * bw; if (magnitude > 0) { _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; @@ -3254,7 +3277,7 @@ var Mat4 = class _Mat4 extends Float64Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out, a) { const a00 = a[0]; @@ -3516,13 +3539,14 @@ var Mat4 = class _Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3570,17 +3594,18 @@ var Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3734,6 +3759,7 @@ var Mat4 = class _Mat4 extends Float64Array { static frustum(out, left, right, bottom, top, near, far = Infinity) { return out; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], @@ -3822,6 +3848,7 @@ var Mat4 = class _Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static perspective(out, fovy, aspect, near, far = Infinity) { return out; } @@ -3866,9 +3893,8 @@ var Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3904,9 +3930,8 @@ var Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3945,13 +3970,13 @@ var Mat4 = class _Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static ortho(out, left, right, bottom, top, near, far) { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -3986,8 +4011,8 @@ var Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4189,6 +4214,7 @@ var Mat4 = class _Mat4 extends Float64Array { * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -4250,7 +4276,7 @@ var Mat4 = class _Mat4 extends Float64Array { return out; } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -4261,7 +4287,7 @@ var Mat4 = class _Mat4 extends Float64Array { 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]; } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -4350,9 +4376,9 @@ var Vec3 = class _Vec3 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -4469,9 +4495,9 @@ var Vec3 = class _Vec3 extends Float64Array { get str() { return _Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. * @category Methods @@ -4518,6 +4544,7 @@ var Vec3 = class _Vec3 extends Float64Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` @@ -4539,6 +4566,7 @@ var Vec3 = class _Vec3 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` @@ -4560,6 +4588,7 @@ var Vec3 = class _Vec3 extends Float64Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` @@ -4607,6 +4636,7 @@ var Vec3 = class _Vec3 extends Float64Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` @@ -4625,6 +4655,7 @@ var Vec3 = class _Vec3 extends Float64Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` @@ -4685,9 +4716,9 @@ var Vec3 = class _Vec3 extends Float64Array { normalize() { return _Vec3.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -4696,9 +4727,9 @@ var Vec3 = class _Vec3 extends Float64Array { static get BYTE_LENGTH() { return 3 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 * @category Static @@ -4726,9 +4757,9 @@ var Vec3 = class _Vec3 extends Float64Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; - let z = a[2]; + const x = a[0]; + const y = a[1]; + const z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /** @@ -4738,6 +4769,7 @@ var Vec3 = class _Vec3 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4746,10 +4778,11 @@ var Vec3 = class _Vec3 extends Float64Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -4758,6 +4791,7 @@ var Vec3 = class _Vec3 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values * @category Static @@ -4834,6 +4868,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0, 0]; } @@ -4856,6 +4891,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0, 0]; } @@ -4878,6 +4914,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0, 0]; } @@ -4947,7 +4984,8 @@ var Vec3 = class _Vec3 extends Float64Array { * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -5002,6 +5040,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -5023,6 +5062,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -5043,6 +5083,7 @@ var Vec3 = class _Vec3 extends Float64Array { * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -5232,7 +5273,8 @@ var Vec3 = class _Vec3 extends Float64Array { * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -5272,7 +5314,7 @@ var Vec3 = class _Vec3 extends Float64Array { * @returns `out` */ static transformMat3(out, a, m) { - let x = a[0], y = a[1], z = a[2]; + const x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; out[1] = x * m[1] + y * m[4] + z * m[7]; out[2] = x * m[2] + y * m[5] + z * m[8]; @@ -5410,7 +5452,7 @@ var Vec3 = class _Vec3 extends Float64Array { return `Vec3(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -5421,7 +5463,7 @@ var Vec3 = class _Vec3 extends Float64Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -5482,9 +5524,9 @@ var Vec4 = class _Vec4 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -5602,9 +5644,9 @@ var Vec4 = class _Vec4 extends Float64Array { get str() { return _Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. * @category Methods @@ -5653,6 +5695,7 @@ var Vec4 = class _Vec4 extends Float64Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` @@ -5675,6 +5718,7 @@ var Vec4 = class _Vec4 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` @@ -5697,6 +5741,7 @@ var Vec4 = class _Vec4 extends Float64Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` @@ -5746,6 +5791,7 @@ var Vec4 = class _Vec4 extends Float64Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` @@ -5764,6 +5810,7 @@ var Vec4 = class _Vec4 extends Float64Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` @@ -5827,9 +5874,9 @@ var Vec4 = class _Vec4 extends Float64Array { normalize() { return _Vec4.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -5838,9 +5885,9 @@ var Vec4 = class _Vec4 extends Float64Array { static get BYTE_LENGTH() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} * @category Static @@ -5942,6 +5989,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return out; } @@ -5965,6 +6013,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -5988,6 +6037,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return out; } @@ -6120,6 +6170,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -6142,6 +6193,7 @@ var Vec4 = class _Vec4 extends Float64Array { * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -6166,15 +6218,17 @@ var Vec4 = class _Vec4 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static @@ -6183,6 +6237,7 @@ var Vec4 = class _Vec4 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} * @category Static @@ -6204,6 +6259,7 @@ var Vec4 = class _Vec4 extends Float64Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} * @category Static @@ -6339,7 +6395,8 @@ var Vec4 = class _Vec4 extends Float64Array { * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -6437,7 +6494,7 @@ var Vec4 = class _Vec4 extends Float64Array { return `Vec4(${a.join(", ")})`; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -6448,7 +6505,7 @@ var Vec4 = class _Vec4 extends Float64Array { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -6521,9 +6578,9 @@ var Quat = class _Quat extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -6599,9 +6656,9 @@ var Quat = class _Quat extends Float64Array { get str() { return _Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. * @category Methods @@ -6645,6 +6702,7 @@ var Quat = class _Quat extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` @@ -6714,9 +6772,9 @@ var Quat = class _Quat extends Float64Array { dot(b) { return _Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -6725,9 +6783,9 @@ var Quat = class _Quat extends Float64Array { static get BYTE_LENGTH() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat * @category Static @@ -6762,7 +6820,7 @@ var Quat = class _Quat extends Float64Array { * @returns `out` **/ static setAxisAngle(out, axis, rad) { - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -6774,7 +6832,7 @@ var Quat = class _Quat extends Float64Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -6812,7 +6870,7 @@ var Quat = class _Quat extends Float64Array { return Math.acos(2 * dotproduct * dotproduct - 1); } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -7019,7 +7077,7 @@ var Quat = class _Quat extends Float64Array { * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -7055,7 +7113,7 @@ var Quat = class _Quat extends Float64Array { } /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -7073,7 +7131,7 @@ var Quat = class _Quat extends Float64Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -7092,10 +7150,14 @@ var Quat = class _Quat extends Float64Array { out[2] = (m[1] - m[3]) * fRoot; } else { let i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - let j = (i + 1) % 3; - let k = (i + 2) % 3; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); out[i] = 0.5 * fRoot; fRoot = 0.5 / fRoot; @@ -7117,16 +7179,16 @@ var Quat = class _Quat extends Float64Array { * @returns `out` */ static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) { - let halfToRad = 0.5 * Math.PI / 180; + const halfToRad = 0.5 * Math.PI / 180; x *= halfToRad; y *= halfToRad; z *= halfToRad; - let sx = Math.sin(x); - let cx = Math.cos(x); - let sy = Math.sin(y); - let cy = Math.cos(y); - let sz = Math.sin(z); - let cz = Math.cos(z); + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); switch (order) { case "xyz": out[0] = sx * cy * cz + cx * sy * sz; @@ -7165,7 +7227,7 @@ var Quat = class _Quat extends Float64Array { out[3] = cx * cy * cz + sx * sy * sz; break; default: - throw new Error("Unknown angle order " + order); + throw new Error(`Unknown angle order ${order}`); } return out; } @@ -7228,6 +7290,7 @@ var Quat = class _Quat extends Float64Array { * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static set(out, x, y, z, w) { return out; } @@ -7240,6 +7303,7 @@ var Quat = class _Quat extends Float64Array { * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static add(out, a, b) { return out; } @@ -7247,6 +7311,7 @@ var Quat = class _Quat extends Float64Array { * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -7287,6 +7352,7 @@ var Quat = class _Quat extends Float64Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static lerp(out, a, b, t) { return out; } @@ -7297,6 +7363,7 @@ var Quat = class _Quat extends Float64Array { * @param a - quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -7304,6 +7371,7 @@ var Quat = class _Quat extends Float64Array { * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mag(a) { return 0; } @@ -7312,10 +7380,11 @@ var Quat = class _Quat extends Float64Array { * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static @@ -7324,6 +7393,7 @@ var Quat = class _Quat extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} * @category Static @@ -7331,6 +7401,7 @@ var Quat = class _Quat extends Float64Array { * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -7341,6 +7412,7 @@ var Quat = class _Quat extends Float64Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} * @category Static @@ -7349,28 +7421,31 @@ var Quat = class _Quat extends Float64Array { * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static normalize(out, a) { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static exactEquals(a, b) { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static equals(a, b) { return false; } @@ -7387,10 +7462,12 @@ var Quat = class _Quat extends Float64Array { * @returns `out` */ static rotationTo(out, a, b) { - let dot = Vec3.dot(a, b); + const dot = Vec3.dot(a, b); if (dot < -0.999999) { Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a); - if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + } Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3); _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI); return out; @@ -7501,9 +7578,9 @@ var Quat2 = class _Quat2 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` @@ -7513,9 +7590,9 @@ var Quat2 = class _Quat2 extends Float64Array { get str() { return _Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. * @category Methods @@ -7527,9 +7604,9 @@ var Quat2 = class _Quat2 extends Float64Array { super.set(a); return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -7538,9 +7615,9 @@ var Quat2 = class _Quat2 extends Float64Array { static get BYTE_LENGTH() { return 8 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} * @category Static @@ -8037,7 +8114,7 @@ var Quat2 = class _Quat2 extends Float64Array { return _Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); const bx = s * axis[0] / axisLength; const by = s * axis[1] / axisLength; @@ -8121,6 +8198,7 @@ var Quat2 = class _Quat2 extends Float64Array { * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return out; } @@ -8152,6 +8230,7 @@ var Quat2 = class _Quat2 extends Float64Array { * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dot(a, b) { return 0; } @@ -8168,7 +8247,9 @@ var Quat2 = class _Quat2 extends Float64Array { */ static lerp(out, a, b, t) { const mt = 1 - t; - if (_Quat2.dot(a, b) < 0) t = -t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; out[2] = a[2] * mt + b[2] * t; @@ -8200,8 +8281,8 @@ var Quat2 = class _Quat2 extends Float64Array { return out; } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -8226,6 +8307,7 @@ var Quat2 = class _Quat2 extends Float64Array { * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a) { return 0; } @@ -8236,15 +8318,17 @@ var Quat2 = class _Quat2 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static @@ -8253,6 +8337,7 @@ var Quat2 = class _Quat2 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} * @category Static @@ -8260,6 +8345,7 @@ var Quat2 = class _Quat2 extends Float64Array { * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a) { return 0; } @@ -8270,6 +8356,7 @@ var Quat2 = class _Quat2 extends Float64Array { static sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} * @category Static @@ -8313,7 +8400,7 @@ var Quat2 = class _Quat2 extends Float64Array { return `Quat2(${a.join(", ")})`; } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -8324,7 +8411,7 @@ var Quat2 = class _Quat2 extends Float64Array { 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]; } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -8391,9 +8478,9 @@ var Vec2 = class _Vec2 extends Float64Array { break; } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -8486,9 +8573,9 @@ var Vec2 = class _Vec2 extends Float64Array { get str() { return _Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. * @category Methods @@ -8534,6 +8621,7 @@ var Vec2 = class _Vec2 extends Float64Array { sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` @@ -8554,6 +8642,7 @@ var Vec2 = class _Vec2 extends Float64Array { mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` @@ -8574,6 +8663,7 @@ var Vec2 = class _Vec2 extends Float64Array { div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` @@ -8619,6 +8709,7 @@ var Vec2 = class _Vec2 extends Float64Array { dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` @@ -8637,6 +8728,7 @@ var Vec2 = class _Vec2 extends Float64Array { sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` @@ -8694,9 +8786,9 @@ var Vec2 = class _Vec2 extends Float64Array { normalize() { return _Vec2.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -8705,9 +8797,9 @@ var Vec2 = class _Vec2 extends Float64Array { static get BYTE_LENGTH() { return 2 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} * @category Static @@ -8797,6 +8889,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out, a, b) { return [0, 0]; } @@ -8818,6 +8911,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out, a, b) { return [0, 0]; } @@ -8839,6 +8933,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out, a, b) { return [0, 0]; } @@ -8953,6 +9048,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a, b) { return 0; } @@ -8973,6 +9069,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a, b) { return 0; } @@ -8984,8 +9081,8 @@ var Vec2 = class _Vec2 extends Float64Array { * @returns Magnitude of a */ static magnitude(a) { - let x = a[0]; - let y = a[1]; + const x = a[0]; + const y = a[1]; return Math.sqrt(x * x + y * y); } /** @@ -8995,6 +9092,7 @@ var Vec2 = class _Vec2 extends Float64Array { static mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9003,10 +9101,11 @@ var Vec2 = class _Vec2 extends Float64Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length static length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -9015,6 +9114,7 @@ var Vec2 = class _Vec2 extends Float64Array { static len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} * @category Static @@ -9031,6 +9131,7 @@ var Vec2 = class _Vec2 extends Float64Array { * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a, b) { return 0; } @@ -9253,7 +9354,7 @@ var Vec2 = class _Vec2 extends Float64Array { return out; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -9264,7 +9365,7 @@ var Vec2 = class _Vec2 extends Float64Array { return a[0] === b[0] && a[1] === b[1]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -9331,13 +9432,23 @@ function EnableSwizzlesF64() { }; case 3: return function() { - return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); + return new Vec3( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]] + ); }; case 4: return function() { - return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + return new Vec4( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], + this[SWIZZLE_INDEX[swizzle[3]]] + ); }; } + throw new Error("Illegal swizzle length"); } for (const swizzle of VEC2_SWIZZLES) { const impl = getSwizzleImpl(swizzle); diff --git a/dist-cdn/esm/2022/gl-matrix-f64.js.map b/dist-cdn/esm/2022/gl-matrix-f64.js.map index 00f9025e..812a35d2 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f64.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON: number = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;;;AASO,IAAM,cAAsB;;;ACF5B,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAqE;AAClF,YAAO,OAAO,QAAQ;AAAA,MACpB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GAAsB,GAAG,CAAC;AAAA,QAClC;AACA;AAAA,MACF;AACE,cAAM,MAAK,aAAa;AAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,IAAI,MAAc;AAChB,WAAO,MAAK,IAAI,IAAI;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAK,GAA6B;AAChC,SAAK,IAAI,CAAC;AACV,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAiB;AACf,SAAK,IAAI,MAAK,aAAa;AAC3B,WAAO;AAAA,EACT;AAAA;AAAA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,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;AC3HA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", + "sourcesContent": ["/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float64Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float64Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float64Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;AASO,IAAM,cAAc;;;ACFpB,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gBAAgB,IAAI,aAAa;AAAA,IACtC;AAAA,IAAG;AAAA,IACH;AAAA,IAAG;AAAA,EACL,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,eAAe,QAAoE;AACjF,YAAQ,OAAO,QAAQ;AAAA,MACrB,KAAK;AACH,cAAM,MAAM;AAAG;AAAA,MACjB,KAAK;AACH,cAAM,OAAO,CAAC,GAAsB,OAAO,CAAC,GAAG,CAAC;AAAG;AAAA,MACrD,KAAK;AACH,cAAM,IAAI,OAAO,CAAC;AAClB,YAAI,OAAO,MAAM,UAAU;AACzB,gBAAM;AAAA,YACJ;AAAA,YAAG;AAAA,YACH;AAAA,YAAG;AAAA,UAAC,CAAC;AAAA,QACT,OAAO;AACL,gBAAM,GAAsB,GAAG,CAAC;AAAA,QAClC;AACA;AAAA,MACF;AACE,cAAM,MAAK,aAAa;AAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,IAAI,MAAc;AAChB,WAAO,MAAK,IAAI,IAAI;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAK,GAA6B;AAChC,SAAK,IAAI,CAAC;AACV,WAAO;AAAA,EACT;AAAA;AAAA;AAA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;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", "names": [] } diff --git a/dist-cdn/esm/2022/gl-matrix-f64.min.js b/dist-cdn/esm/2022/gl-matrix-f64.min.js index c6e8f94e..802d45c0 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.min.js +++ b/dist-cdn/esm/2022/gl-matrix-f64.min.js @@ -2,5 +2,5 @@ // @author Brandon Jones // @author Colin MacKenzie IV // @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) -var Z=class b extends Float64Array{static#t=new Float64Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float64Array{static#t=new Float64Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[3]=k-o,e[6]=M+x,e[1]=k+o,e[4]=1-L-d,e[7]=h-m,e[2]=M-x,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=(r*D-s*N-a*I)*Q,e[4]=(n*N-r*f+a*B)*Q,e[5]=(s*f-n*D-a*A)*Q,e[6]=(m*T-x*V+o*w)*Q,e[7]=(x*g-d*T-o*R)*Q,e[8]=(d*V-m*g+o*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(r*D-s*N-a*I)*Q,e[2]=(m*T-x*V+o*w)*Q,e[3]=(M*V-l*T-h*w)*Q,e[4]=(y*f-i*N-L*B)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(x*g-d*T-o*R)*Q,e[7]=(k*T-M*g+h*R)*Q,e[8]=(i*D-c*f+L*A)*Q,e[9]=(s*f-n*D-a*A)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=(l*g-k*V-h*z)*Q,e[12]=(c*B-i*I-y*A)*Q,e[13]=(n*I-s*B+r*A)*Q,e[14]=(m*R-d*w-x*z)*Q,e[15]=(k*w-l*R+M*z)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x;return e[0]=c*N-y*D+L*I,e[1]=r*D-s*N-a*I,e[2]=m*T-x*V+o*w,e[3]=M*V-l*T-h*w,e[4]=y*f-i*N-L*B,e[5]=n*N-r*f+a*B,e[6]=x*g-d*T-o*R,e[7]=k*T-M*g+h*R,e[8]=i*D-c*f+L*A,e[9]=s*f-n*D-a*A,e[10]=d*V-m*g+o*z,e[11]=l*g-k*V-h*z,e[12]=c*B-i*I-y*A,e[13]=n*I-s*B+r*A,e[14]=m*R-d*w-x*z,e[15]=k*w-l*R+M*z,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],x=e[15],o=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,B=L*R-k*z+l*o,f=h*R-d*z+m*o;return y*T-r*A+x*B-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],x=t[13],o=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*x,e[2]=R*a+g*L+w*h+V*o,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*x,e[6]=R*a+g*L+w*h+V*o,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*x,e[10]=R*a+g*L+w*h+V*o,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*x,e[14]=R*a+g*L+w*h+V*o,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],x=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=x,e[11]=o,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+x*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],x=t[5],o=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,B=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,D=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*B,e[1]=M*T+x*A+g*B,e[2]=h*T+o*A+w*B,e[3]=d*T+z*A+V*B,e[4]=l*f+m*I+R*D,e[5]=M*f+x*I+g*D,e[6]=h*f+o*I+w*D,e[7]=d*f+z*I+V*D,e[8]=l*N+m*Q+R*Y,e[9]=M*N+x*Q+g*Y,e[10]=h*N+o*Q+w*Y,e[11]=d*N+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,x=i*c,o=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-o,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+x,e[7]=0,e[8]=M+o,e[9]=d-x,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],x=t[14],o=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,B=k*x-M*d,f=k*o-h*d,I=l*x-M*m,D=l*o-h*m,N=M*o-h*x,Q=z*N-R*D+g*I+w*f-V*B+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*D+L*I)*Q,e[1]=(y*f-i*N-L*B)*Q,e[2]=(i*D-c*f+L*A)*Q,e[3]=0,e[4]=(r*D-s*N-a*I)*Q,e[5]=(n*N-r*f+a*B)*Q,e[6]=(s*f-n*D-a*A)*Q,e[7]=0,e[8]=(m*T-x*V+o*w)*Q,e[9]=(x*g-d*T-o*R)*Q,e[10]=(d*V-m*g+o*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],x=r*h,o=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,B=x+g+A,f=0;return B>0?(f=Math.sqrt(B+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(o-R)/f):x>g&&x>A?(f=Math.sqrt(1+x-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(o+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-x-A)*2,e[3]=(V-z)/f,e[0]=(o+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-x-g)*2,e[3]=(o-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,x=i*k,o=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+x))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+x))*w,e[6]=(m+o)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-o)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,x=i*l,o=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],B=r[1],f=r[2],I=(1-(m+o))*w,D=(h+g)*w,N=(d-R)*w,Q=(h-g)*V,Y=(1-(M+o))*V,X=(x+z)*V,C=(d+R)*T,H=(x-z)*T,$=(1-(M+m))*T;return e[0]=I,e[1]=D,e[2]=N,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=$,e[11]=0,e[12]=n[0]+A-(I*A+Q*B+C*f),e[13]=n[1]+B-(D*A+Y*B+H*f),e[14]=n[2]+f-(N*A+X*B+$*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,x=a*c,o=a*y;return e[0]=1-l-d,e[1]=k+o,e[2]=M-x,e[3]=0,e[4]=k-o,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+x,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,x=1/Math.sqrt(h*h+d*d+m*m);h*=x,d*=x,m*=x;let o=y*m-L*d,z=L*h-c*m,R=c*d-y*h;x=Math.sqrt(o*o+z*z+R*R),x?(x=1/x,o*=x,z*=x,R*=x):(o=0,z=0,R=0);let g=d*R-m*z,w=m*o-h*R,V=h*z-d*o;return x=Math.sqrt(g*g+w*w+V*V),x?(x=1/x,g*=x,w*=x,V*=x):(g=0,w=0,V=0),e[0]=o,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(o*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,x=c*l-y*k;return h=d*d+m*m+x*x,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,x*=h),e[0]=d,e[1]=m,e[2]=x,e[3]=0,e[4]=l*x-M*m,e[5]=M*d-k*x,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],x=e[14],o=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],B=t[7],f=t[8],I=t[9],D=t[10],N=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-B)<=1e-6*Math.max(1,Math.abs(L),Math.abs(B))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(M-D)<=1e-6*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(h-N)<=1e-6*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(x-X)<=1e-6*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(o-C)<=1e-6*Math.max(1,Math.abs(o),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var F=class b extends Float64Array{static#t="zyx";static#e=new Float64Array(4);static#r=new Float64Array(4);static#n=new Float64Array(9);static#s=new Float64Array(3);static#a=new Float64Array([1,0,0]);static#i=new Float64Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),x=Math.sin(m);M=Math.sin((1-s)*m)/x,h=Math.sin(s*m)/x}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error("Unknown angle order "+r)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};F.set=E.set;F.add=E.add;F.lerp=E.lerp;F.normalize=E.normalize;F.squaredLength=E.squaredLength;F.sqrLen=E.squaredLength;F.exactEquals=E.exactEquals;F.equals=E.equals;F.magnitude=E.magnitude;F.prototype.mul=F.prototype.multiply;F.mul=F.multiply;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var O=class b extends Float64Array{static#t=new Float64Array(4);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return F.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],x=t[6],o=t[7];return e[4]=d*L+o*i+m*y-x*c,e[5]=m*L+o*c+x*i-d*y,e[6]=x*L+o*y+d*c-m*i,e[7]=o*L-d*i-m*c-x*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],x=n[1],o=n[2],z=n[3];return e[0]=s*z+i*m+r*o-a*x,e[1]=r*z+i*x+a*m-s*o,e[2]=a*z+i*o+s*x-r*m,e[3]=i*z-s*m-r*x-a*o,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*o-h*x,e[5]=r*k+i*y+a*c-s*L+M*z+d*x+h*m-l*o,e[6]=a*k+i*L+s*y-r*c+h*z+d*o+l*x-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*x-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],x=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};O.dot=F.dot;O.squaredLength=F.squaredLength;O.sqrLen=F.squaredLength;O.mag=F.magnitude;O.length=F.magnitude;O.len=F.magnitude;O.mul=O.multiply;var S=class b extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};S.prototype.sub=S.prototype.subtract;S.prototype.mul=S.prototype.multiply;S.prototype.div=S.prototype.divide;S.prototype.dist=S.prototype.distance;S.prototype.sqrDist=S.prototype.squaredDistance;S.sub=S.subtract;S.mul=S.multiply;S.div=S.divide;S.dist=S.distance;S.sqrDist=S.squaredDistance;S.sqrLen=S.squaredLength;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var W=!1;function ge(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new S(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of b){let a=s(r);Object.defineProperty(S.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function ze(b){return b*J}function we(b){return b*U}export{ge as EnableSwizzlesF64,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,F as Quat,O as Quat2,S as Vec2,q as Vec3,E as Vec4,ze as toDegree,we as toRadian}; +var Z=class b extends Float64Array{static#t=new Float64Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}scale(e){return b.scale(this,this,e)}rotate(e){return b.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class b extends Float64Array{static#t=new Float64Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*d+c,e[5]=r*h+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e){return b.rotate(this,this,e)}scale(e){return b.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,d=n*l+s*M+r*h;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=M*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=h*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],d=n[2];return e[0]=M*s+h*i+d*L,e[1]=M*r+h*c+d*k,e[2]=M*a+h*y+d*l,M=n[3],h=n[4],d=n[5],e[3]=M*s+h*i+d*L,e[4]=M*r+h*c+d*k,e[5]=M*a+h*y+d*l,M=n[6],h=n[7],d=n[8],e[6]=M*s+h*i+d*L,e[7]=M*r+h*c+d*k,e[8]=M*a+h*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[3]=k-x,e[6]=M+o,e[1]=k+x,e[4]=1-L-d,e[7]=h-m,e[2]=M-o,e[5]=h+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(y*f-i*F-L*D)*Q,e[2]=(i*S-c*f+L*A)*Q,e[3]=(r*S-s*F-a*I)*Q,e[4]=(n*F-r*f+a*D)*Q,e[5]=(s*f-n*S-a*A)*Q,e[6]=(m*T-o*V+x*w)*Q,e[7]=(o*g-d*T-x*R)*Q,e[8]=(d*V-m*g+x*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-o)<=1e-6*Math.max(1,Math.abs(c),Math.abs(o))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class b extends Float64Array{static#t=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(b.#t);break}}get str(){return b.str(this)}copy(e){return this.set(e),this}identity(){return this.set(b.#t),this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}transpose(){return b.transpose(this,this)}invert(){return b.invert(this,this)}translate(e){return b.translate(this,this,e)}rotate(e,t){return b.rotate(this,this,e,t)}scale(e){return b.scale(this,this,e)}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return b.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return b.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return b.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return b.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new b(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(r*S-s*F-a*I)*Q,e[2]=(m*T-o*V+x*w)*Q,e[3]=(M*V-l*T-h*w)*Q,e[4]=(y*f-i*F-L*D)*Q,e[5]=(n*F-r*f+a*D)*Q,e[6]=(o*g-d*T-x*R)*Q,e[7]=(k*T-M*g+h*R)*Q,e[8]=(i*S-c*f+L*A)*Q,e[9]=(s*f-n*S-a*A)*Q,e[10]=(d*V-m*g+x*z)*Q,e[11]=(l*g-k*V-h*z)*Q,e[12]=(c*D-i*I-y*A)*Q,e[13]=(n*I-s*D+r*A)*Q,e[14]=(m*R-d*w-o*z)*Q,e[15]=(k*w-l*R+M*z)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o;return e[0]=c*F-y*S+L*I,e[1]=r*S-s*F-a*I,e[2]=m*T-o*V+x*w,e[3]=M*V-l*T-h*w,e[4]=y*f-i*F-L*D,e[5]=n*F-r*f+a*D,e[6]=o*g-d*T-x*R,e[7]=k*T-M*g+h*R,e[8]=i*S-c*f+L*A,e[9]=s*f-n*S-a*A,e[10]=d*V-m*g+x*z,e[11]=l*g-k*V-h*z,e[12]=c*D-i*I-y*A,e[13]=n*I-s*D+r*A,e[14]=m*R-d*w-o*z,e[15]=k*w-l*R+M*z,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],d=e[13],m=e[14],o=e[15],x=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*h,w=L*m-l*h,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,D=L*R-k*z+l*x,f=h*R-d*z+m*x;return y*T-r*A+o*D-M*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],d=t[11],m=t[12],o=t[13],x=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*M+V*o,e[2]=R*a+g*L+w*h+V*x,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*M+V*o,e[6]=R*a+g*L+w*h+V*x,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*M+V*o,e[10]=R*a+g*L+w*h+V*x,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*M+V*o,e[14]=R*a+g*L+w*h+V*x,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],d=t[8],m=t[9],o=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=d,e[9]=m,e[10]=o,e[11]=x,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+M*r+o*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,D=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,S=i*a*k+r*y,F=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*D,e[1]=M*T+o*A+g*D,e[2]=h*T+x*A+w*D,e[3]=d*T+z*A+V*D,e[4]=l*f+m*I+R*S,e[5]=M*f+o*I+g*S,e[6]=h*f+x*I+w*S,e[7]=d*f+z*I+V*S,e[8]=l*F+m*Q+R*Y,e[9]=M*F+o*Q+g*Y,e[10]=h*F+x*Q+w*Y,e[11]=d*F+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,d=r*L,m=a*L,o=i*c,x=i*y,z=i*L;return e[0]=1-(h+m),e[1]=l+z,e[2]=M-x,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+o,e[7]=0,e[8]=M+x,e[9]=d-o,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(b.#e[0]=(i*a+L*n+c*r-y*s)*2/k,b.#e[1]=(c*a+L*s+y*n-i*r)*2/k,b.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(b.#e[0]=(i*a+L*n+c*r-y*s)*2,b.#e[1]=(c*a+L*s+y*n-i*r)*2,b.#e[2]=(y*a+L*r+i*s-c*n)*2),b.fromRotationTranslation(e,t,b.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-M*d,f=k*x-h*d,I=l*o-M*m,S=l*x-h*m,F=M*x-h*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(y*f-i*F-L*D)*Q,e[2]=(i*S-c*f+L*A)*Q,e[3]=0,e[4]=(r*S-s*F-a*I)*Q,e[5]=(n*F-r*f+a*D)*Q,e[6]=(s*f-n*S-a*A)*Q,e[7]=0,e[8]=(m*T-o*V+x*w)*Q,e[9]=(o*g-d*T-x*R)*Q,e[10]=(d*V-m*g+x*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){b.getScaling(b.#e,t);let n=1/b.#e[0],s=1/b.#e[1],r=1/b.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,d=a+L+h,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-M)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>h?(m=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>h?(m=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+M)/m):(m=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+M)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],d=1/n[1],m=1/n[2],o=r*h,x=a*d,z=i*m,R=c*h,g=y*d,w=L*m,V=k*h,T=l*d,A=M*m,D=o+g+A,f=0;return D>0?(f=Math.sqrt(D+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(x-R)/f):o>g&&o>A?(f=Math.sqrt(1+o-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(x+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-o-A)*2,e[3]=(V-z)/f,e[0]=(x+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-o-g)*2,e[3]=(x-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,d=a*L,m=a*k,o=i*k,x=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+o))*g,e[1]=(M+R)*g,e[2]=(h-z)*g,e[3]=0,e[4]=(M-R)*w,e[5]=(1-(l+o))*w,e[6]=(m+x)*w,e[7]=0,e[8]=(h+z)*V,e[9]=(m-x)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,d=a*l,m=i*k,o=i*l,x=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],D=r[1],f=r[2],I=(1-(m+x))*w,S=(h+g)*w,F=(d-R)*w,Q=(h-g)*V,Y=(1-(M+x))*V,X=(o+z)*V,C=(d+R)*T,$=(o-z)*T,H=(1-(M+m))*T;return e[0]=I,e[1]=S,e[2]=F,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=$,e[10]=H,e[11]=0,e[12]=n[0]+A-(I*A+Q*D+C*f),e[13]=n[1]+D-(S*A+Y*D+$*f),e[14]=n[2]+f-(F*A+X*D+H*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[1]=k+x,e[2]=M-o,e[3]=0,e[4]=k-x,e[5]=1-L-d,e[6]=h+m,e[7]=0,e[8]=M+o,e[9]=h-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return b.identity(e);let h=r-k,d=a-l,m=i-M,o=1/Math.sqrt(h*h+d*d+m*m);h*=o,d*=o,m*=o;let x=y*m-L*d,z=L*h-c*m,R=c*d-y*h;o=Math.sqrt(x*x+z*z+R*R),o?(o=1/o,x*=o,z*=o,R*=o):(x=0,z=0,R=0);let g=d*R-m*z,w=m*x-h*R,V=h*z-d*x;return o=Math.sqrt(g*g+w*w+V*V),o?(o=1/o,g*=o,w*=o,V*=o):(g=0,w=0,V=0),e[0]=x,e[1]=g,e[2]=h,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(x*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(h*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let d=y*M-L*l,m=L*k-c*M,o=c*l-y*k;return h=d*d+m*m+o*o,h>0&&(h=1/Math.sqrt(h),d*=h,m*=h,o*=h),e[0]=d,e[1]=m,e[2]=o,e[3]=0,e[4]=l*o-M*m,e[5]=M*d-k*o,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],d=e[12],m=e[13],o=e[14],x=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],D=t[7],f=t[8],I=t[9],S=t[10],F=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-D)<=1e-6*Math.max(1,Math.abs(L),Math.abs(D))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(M-S)<=1e-6*Math.max(1,Math.abs(M),Math.abs(S))&&Math.abs(h-F)<=1e-6*Math.max(1,Math.abs(h),Math.abs(F))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(o-X)<=1e-6*Math.max(1,Math.abs(o),Math.abs(X))&&Math.abs(x-C)<=1e-6*Math.max(1,Math.abs(x),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class b extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new b(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(b.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,d=(a*k-s*M)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+d,e[2]=L+M*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&b.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class b extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var N=class b extends Float64Array{static#t="zyx";static#e=new Float64Array(4);static#r=new Float64Array(4);static#n=new Float64Array(9);static#s=new Float64Array(3);static#a=new Float64Array([1,0,0]);static#i=new Float64Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return b.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return b.multiply(this,this,e)}mul(e){return this}rotateX(e){return b.rotateX(this,this,e)}rotateY(e){return b.rotateY(this,this,e)}rotateZ(e){return b.rotateZ(this,this,e)}invert(){return b.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return b.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=b.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return b.ln(e,t),b.scale(e,e,n),b.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),o=Math.sin(m);M=Math.sin((1-s)*m)/o,h=Math.sin(s*m)/o}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=b.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new b(e)}static fromValues(e,t,n,s){return new b(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(b.#s,b.#a,t),q.mag(b.#s)<1e-6&&q.cross(b.#s,b.#i,t),q.normalize(b.#s,b.#s),b.setAxisAngle(e,b.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(b.#s,t,n),e[0]=b.#s[0],e[1]=b.#s[1],e[2]=b.#s[2],e[3]=1+s,b.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return b.slerp(b.#e,t,r,a),b.slerp(b.#r,n,s,a),b.slerp(e,b.#e,b.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return b.#n[0]=n[0],b.#n[3]=n[1],b.#n[6]=n[2],b.#n[1]=s[0],b.#n[4]=s[1],b.#n[7]=s[2],b.#n[2]=-t[0],b.#n[5]=-t[1],b.#n[8]=-t[2],b.normalize(e,b.fromMat3(e,b.#n))}};N.set=E.set;N.add=E.add;N.lerp=E.lerp;N.normalize=E.normalize;N.squaredLength=E.squaredLength;N.sqrLen=E.squaredLength;N.exactEquals=E.exactEquals;N.equals=E.equals;N.magnitude=E.magnitude;N.prototype.mul=N.prototype.multiply;N.mul=N.multiply;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var O=class b extends Float64Array{static#t=new Float64Array(4);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return b.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t,n,s,r,a,i,c){return new b(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new b(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(b.#t,t),P.getTranslation(b.#e,t),b.fromRotationTranslation(e,b.#t,b.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+M*a-h*r,e[5]=M*i+d*r+h*s-l*a,e[6]=h*i+d*a+l*r-M*s,e[7]=d*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return b.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let d=t[4],m=t[5],o=t[6],x=t[7];return e[4]=d*L+x*i+m*y-o*c,e[5]=m*L+x*c+o*i-d*y,e[6]=o*L+x*y+d*c-m*i,e[7]=x*L-d*i-m*c-o*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],d=t[7],m=n[0],o=n[1],x=n[2],z=n[3];return e[0]=s*z+i*m+r*x-a*o,e[1]=r*z+i*o+a*m-s*x,e[2]=a*z+i*x+s*o-r*m,e[3]=i*z-s*m-r*o-a*x,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+M*x-h*o,e[5]=r*k+i*y+a*c-s*L+M*z+d*o+h*m-l*x,e[6]=a*k+i*L+s*y-r*c+h*z+d*x+l*o-M*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-M*o-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return b.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=b.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=b.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],d=t[4],m=t[5],o=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};O.dot=N.dot;O.squaredLength=N.squaredLength;O.sqrLen=N.squaredLength;O.mag=N.magnitude;O.length=N.magnitude;O.len=N.magnitude;O.mul=O.multiply;var B=class b extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return b.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return b.distance(this,e)}dist(e){return 0}squaredDistance(e){return b.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return b.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new b}static clone(e){return new b(e)}static fromValues(e,t){return new b(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};B.prototype.sub=B.prototype.subtract;B.prototype.mul=B.prototype.multiply;B.prototype.div=B.prototype.divide;B.prototype.dist=B.prototype.distance;B.prototype.sqrDist=B.prototype.squaredDistance;B.sub=B.subtract;B.mul=B.multiply;B.div=B.divide;B.dist=B.distance;B.sqrDist=B.squaredDistance;B.sqrLen=B.squaredLength;B.mag=B.magnitude;B.length=B.magnitude;B.len=B.magnitude;var W=!1;function ge(){if(W)return;let b=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new B(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error("Illegal swizzle length")}for(let r of b){let a=s(r);Object.defineProperty(B.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}W=!0}var U=Math.PI/180,J=180/Math.PI;function ze(b){return b*J}function we(b){return b*U}export{ge as EnableSwizzlesF64,Z as Mat2,j as Mat2d,G as Mat3,P as Mat4,N as Quat,O as Quat2,B as Vec2,q as Vec3,E as Vec4,ze as toDegree,we as toRadian}; //# sourceMappingURL=gl-matrix-f64.min.js.map diff --git a/dist-cdn/esm/2022/gl-matrix-f64.min.js.map b/dist-cdn/esm/2022/gl-matrix-f64.min.js.map index dd378abd..f433c6ac 100644 --- a/dist-cdn/esm/2022/gl-matrix-f64.min.js.map +++ b/dist-cdn/esm/2022/gl-matrix-f64.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], - "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n let a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) {\r\n switch(values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n //===================\r\n // Instance methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a20 = a[8];\r\n let a21 = a[9];\r\n let a22 = a[10];\r\n let a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n let a00 = a[0];\r\n let a01 = a[1];\r\n let a02 = a[2];\r\n let a03 = a[3];\r\n let a10 = a[4];\r\n let a11 = a[5];\r\n let a12 = a[6];\r\n let a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n let s = Math.sin(rad);\r\n let c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n //Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertable\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like {\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n /**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n let z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n let x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx*w2) + uuvx;\r\n out[1] = y + (uvy*w2) + uuvy;\r\n out[2] = z + (uvz*w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n //Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n //perform rotation\r\n //translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract;\r\nVec3.prototype.mul = Vec3.prototype.multiply;\r\nVec3.prototype.div = Vec3.prototype.divide;\r\nVec3.prototype.dist = Vec3.prototype.distance;\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract;\r\nVec4.prototype.mul = Vec4.prototype.multiply;\r\nVec4.prototype.div = Vec4.prototype.divide;\r\nVec4.prototype.dist = Vec4.prototype.distance;\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /*static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) i = 1;\r\n if (m[8] > m[i * 3 + i]) i = 2;\r\n let j = (i + 1) % 3;\r\n let k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n let halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n let sx = Math.sin(x);\r\n let cx = Math.cos(x);\r\n let sy = Math.sin(y);\r\n let cy = Math.cos(y);\r\n let sz = Math.sin(z);\r\n let cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error('Unknown angle order ' + order);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n let dot = Vec3.dot(a, b);\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a);\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply;\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n //Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad = rad * 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) t = -t;\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}\r\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-ignore\r\nQuat2.dot = Quat.dot;\r\n// @ts-ignore\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-ignore\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.length = Quat.magnitude;\r\n// @ts-ignore\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch(values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n //============\r\n // Accessors\r\n //============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n //===================\r\n // Instances methods\r\n //===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; }\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n //===================\r\n // Static accessors\r\n //===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //===================\r\n // Static methods\r\n //===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n let x = a[0];\r\n let y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // @ts-ignore: Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; }\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n //TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n //Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n //perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract;\r\nVec2.prototype.mul = Vec2.prototype.multiply;\r\nVec2.prototype.div = Vec2.prototype.divide;\r\nVec2.prototype.dist = Vec2.prototype.distance;\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64: boolean = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\n\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\n\n // [/Swizzle Autogen]\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => any {\r\n switch(swizzle.length) {\r\n case 2:\r\n return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); };\r\n case 3:\r\n return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); };\r\n case 4:\r\n return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); };\r\n }\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], - "mappings": ";;;;AAOO,IAAMA,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAqE,CAClF,OAAOA,EAAO,OAAQ,CACpB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMH,EAAKC,EAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOD,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAIJ,EAAKC,EAAa,EACpB,IACT,CAUA,SAASI,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,KAAM,IAAI,CAClC,CASA,QAAe,CACb,OAAOA,EAAK,OAAO,KAAM,IAAI,CAC/B,CAUA,MAAMG,EAA6B,CACjC,OAAOH,EAAK,MAAM,KAAM,KAAMG,CAAC,CACjC,CAUA,OAAOG,EAAmB,CACxB,OAAON,EAAK,OAAO,KAAM,KAAMM,CAAG,CACpC,CAWA,WAAW,aAAsB,CAC/B,MAAO,GAAI,aAAa,iBAC1B,CAYA,OAAO,QAAe,CACpB,OAAO,IAAIN,CACb,CASA,OAAO,MAAMI,EAA6B,CACxC,OAAO,IA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,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CC3HA,IAAMY,EAAyB,KAAK,GAAK,IAKnCC,EAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", + "sourcesContent": ["import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float64Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float64Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float64Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;AAOO,IAAMA,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAoE,CACjF,OAAQA,EAAO,OAAQ,CACrB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMH,EAAKC,EAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOD,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAIJ,EAAKC,EAAa,EACpB,IACT,CAUA,SAASI,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,KAAM,IAAI,CAClC,CASA,QAAe,CACb,OAAOA,EAAK,OAAO,KAAM,IAAI,CAC/B,CAUA,MAAMG,EAA6B,CACjC,OAAOH,EAAK,MAAM,KAAM,KAAMG,CAAC,CACjC,CAUA,OAAOG,EAAmB,CACxB,OAAON,EAAK,OAAO,KAAM,KAAMM,CAAG,CACpC,CAWA,WAAW,aAAsB,CAC/B,MAAO,GAAI,aAAa,iBAC1B,CAYA,OAAO,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,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CCzIA,IAAMY,EAAyB,KAAK,GAAK,IAKnCC,EAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,CACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,CACjB", "names": ["Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] } diff --git a/dist-cdn/types/gl-matrix-f32.d.mts b/dist-cdn/types/gl-matrix-f32.d.mts index c443625f..0e3da008 100644 --- a/dist-cdn/types/gl-matrix-f32.d.mts +++ b/dist-cdn/types/gl-matrix-f32.d.mts @@ -242,7 +242,7 @@ declare class Mat2 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null; /** @@ -393,7 +393,7 @@ declare class Mat2 extends Float32Array { D: Readonly, U: Mat2Like, a: Readonly, - ): (Readonly | Readonly | readonly [number, number, number, number])[]; + ): [Mat2Like, Readonly, Mat2Like]; /** * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) * @category Static @@ -560,7 +560,7 @@ declare class Mat2d extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null; /** @@ -644,9 +644,10 @@ declare class Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -657,9 +658,10 @@ declare class Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -670,9 +672,10 @@ declare class Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -710,7 +713,7 @@ declare class Mat2d extends Float32Array { */ static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike; /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -719,7 +722,7 @@ declare class Mat2d extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -900,7 +903,7 @@ declare class Mat3 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null; /** @@ -993,9 +996,10 @@ declare class Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1019,9 +1023,10 @@ declare class Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1064,7 +1069,7 @@ declare class Mat3 extends Float32Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null; /** @@ -1119,7 +1124,7 @@ declare class Mat3 extends Float32Array { */ static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like; /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1128,7 +1133,7 @@ declare class Mat3 extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1397,7 +1402,7 @@ declare class Mat4 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null; /** @@ -1496,9 +1501,10 @@ declare class Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1509,9 +1515,10 @@ declare class Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1522,9 +1529,10 @@ declare class Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1536,9 +1544,10 @@ declare class Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1549,9 +1558,10 @@ declare class Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1562,9 +1572,10 @@ declare class Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1575,12 +1586,13 @@ declare class Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1604,7 +1616,7 @@ declare class Mat4 extends Float32Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null; /** @@ -1671,13 +1683,14 @@ declare class Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1693,17 +1706,18 @@ declare class Mat4 extends Float32Array { s: Readonly, ): Mat4Like; /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1830,9 +1844,8 @@ declare class Mat4 extends Float32Array { */ static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1842,11 +1855,20 @@ declare class Mat4 extends Float32Array { * @returns `out` * @deprecated */ - static perspectiveFromFieldOfView(out: Mat4Like, fov: any, near: number, far: number): Mat4Like; + static perspectiveFromFieldOfView( + out: Mat4Like, + fov: { + upDegrees: number; + downDegrees: number; + leftDegrees: number; + rightDegrees: number; + }, + near: number, + far: number, + ): Mat4Like; /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1882,9 +1904,8 @@ declare class Mat4 extends Float32Array { far: number, ): Mat4Like; /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1906,8 +1927,8 @@ declare class Mat4 extends Float32Array { far: number, ): Mat4Like; /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1983,7 +2004,7 @@ declare class Mat4 extends Float32Array { */ static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like; /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1992,7 +2013,7 @@ declare class Mat4 extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2187,7 +2208,7 @@ declare class Quat extends Float32Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -2209,7 +2230,7 @@ declare class Quat extends Float32Array { */ static getAngle(a: Readonly, b: Readonly): number; /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -2316,7 +2337,7 @@ declare class Quat extends Float32Array { static invert(out: QuatLike, a: Readonly): QuatLike; /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -2328,7 +2349,7 @@ declare class Quat extends Float32Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -2489,7 +2510,7 @@ declare class Quat extends Float32Array { */ static normalize(out: QuatLike, a: Readonly): QuatLike; /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. @@ -2498,7 +2519,7 @@ declare class Quat extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -2909,8 +2930,8 @@ declare class Quat2 extends Float32Array { */ static invert(out: Quat2Like, a: Readonly): Quat2Like; /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -2974,7 +2995,7 @@ declare class Quat2 extends Float32Array { */ static str(a: Readonly): string; /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -2983,7 +3004,7 @@ declare class Quat2 extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -3591,7 +3612,7 @@ declare class Vec2 extends Float32Array { */ static zero(out: Vec2Like): Vec2Like; /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -3600,7 +3621,7 @@ declare class Vec2 extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -4305,7 +4326,7 @@ declare class Vec3 extends Float32Array { */ static str(a: Readonly): string; /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -4314,7 +4335,7 @@ declare class Vec3 extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -4906,7 +4927,7 @@ declare class Vec4 extends Float32Array { */ static str(a: Readonly): string; /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -4915,7 +4936,7 @@ declare class Vec4 extends Float32Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. diff --git a/dist-cdn/types/gl-matrix-f64.d.mts b/dist-cdn/types/gl-matrix-f64.d.mts index eefdc9a8..e1de483f 100644 --- a/dist-cdn/types/gl-matrix-f64.d.mts +++ b/dist-cdn/types/gl-matrix-f64.d.mts @@ -242,7 +242,7 @@ declare class Mat2 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null; /** @@ -393,7 +393,7 @@ declare class Mat2 extends Float64Array { D: Readonly, U: Mat2Like, a: Readonly, - ): (Readonly | Readonly | readonly [number, number, number, number])[]; + ): [Mat2Like, Readonly, Mat2Like]; /** * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) * @category Static @@ -560,7 +560,7 @@ declare class Mat2d extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null; /** @@ -644,9 +644,10 @@ declare class Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -657,9 +658,10 @@ declare class Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -670,9 +672,10 @@ declare class Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -710,7 +713,7 @@ declare class Mat2d extends Float64Array { */ static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike; /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -719,7 +722,7 @@ declare class Mat2d extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -900,7 +903,7 @@ declare class Mat3 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null; /** @@ -993,9 +996,10 @@ declare class Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1019,9 +1023,10 @@ declare class Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -1064,7 +1069,7 @@ declare class Mat3 extends Float64Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null; /** @@ -1119,7 +1124,7 @@ declare class Mat3 extends Float64Array { */ static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like; /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1128,7 +1133,7 @@ declare class Mat3 extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1397,7 +1402,7 @@ declare class Mat4 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null; /** @@ -1496,9 +1501,10 @@ declare class Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1509,9 +1515,10 @@ declare class Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1522,9 +1529,10 @@ declare class Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1536,9 +1544,10 @@ declare class Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1549,9 +1558,10 @@ declare class Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1562,9 +1572,10 @@ declare class Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1575,12 +1586,13 @@ declare class Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1604,7 +1616,7 @@ declare class Mat4 extends Float64Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null; /** @@ -1671,13 +1683,14 @@ declare class Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1693,17 +1706,18 @@ declare class Mat4 extends Float64Array { s: Readonly, ): Mat4Like; /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1830,9 +1844,8 @@ declare class Mat4 extends Float64Array { */ static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1842,11 +1855,20 @@ declare class Mat4 extends Float64Array { * @returns `out` * @deprecated */ - static perspectiveFromFieldOfView(out: Mat4Like, fov: any, near: number, far: number): Mat4Like; + static perspectiveFromFieldOfView( + out: Mat4Like, + fov: { + upDegrees: number; + downDegrees: number; + leftDegrees: number; + rightDegrees: number; + }, + near: number, + far: number, + ): Mat4Like; /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1882,9 +1904,8 @@ declare class Mat4 extends Float64Array { far: number, ): Mat4Like; /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1906,8 +1927,8 @@ declare class Mat4 extends Float64Array { far: number, ): Mat4Like; /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -1983,7 +2004,7 @@ declare class Mat4 extends Float64Array { */ static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like; /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1992,7 +2013,7 @@ declare class Mat4 extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2187,7 +2208,7 @@ declare class Quat extends Float64Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -2209,7 +2230,7 @@ declare class Quat extends Float64Array { */ static getAngle(a: Readonly, b: Readonly): number; /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -2316,7 +2337,7 @@ declare class Quat extends Float64Array { static invert(out: QuatLike, a: Readonly): QuatLike; /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -2328,7 +2349,7 @@ declare class Quat extends Float64Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -2489,7 +2510,7 @@ declare class Quat extends Float64Array { */ static normalize(out: QuatLike, a: Readonly): QuatLike; /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. @@ -2498,7 +2519,7 @@ declare class Quat extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -2909,8 +2930,8 @@ declare class Quat2 extends Float64Array { */ static invert(out: Quat2Like, a: Readonly): Quat2Like; /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -2974,7 +2995,7 @@ declare class Quat2 extends Float64Array { */ static str(a: Readonly): string; /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -2983,7 +3004,7 @@ declare class Quat2 extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -3591,7 +3612,7 @@ declare class Vec2 extends Float64Array { */ static zero(out: Vec2Like): Vec2Like; /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -3600,7 +3621,7 @@ declare class Vec2 extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -4305,7 +4326,7 @@ declare class Vec3 extends Float64Array { */ static str(a: Readonly): string; /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -4314,7 +4335,7 @@ declare class Vec3 extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -4906,7 +4927,7 @@ declare class Vec4 extends Float64Array { */ static str(a: Readonly): string; /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -4915,7 +4936,7 @@ declare class Vec4 extends Float64Array { */ static exactEquals(a: Readonly, b: Readonly): boolean; /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. diff --git a/dist-cdn/umd/gl-matrix-f32.js b/dist-cdn/umd/gl-matrix-f32.js index 129e9332..e3b3f6f0 100644 --- a/dist-cdn/umd/gl-matrix-f32.js +++ b/dist-cdn/umd/gl-matrix-f32.js @@ -183,9 +183,9 @@ } return _assertThisInitialized(_this); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` @@ -198,9 +198,9 @@ get: function get() { return _Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. * @@ -249,6 +249,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` @@ -299,9 +300,9 @@ value: function rotate(rad) { return _Mat2.rotate(this, this, rad); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -312,9 +313,9 @@ get: function get() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} * @category Static @@ -432,7 +433,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -522,6 +523,7 @@ * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -557,6 +559,7 @@ * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -813,9 +816,9 @@ } return _assertThisInitialized(_this2); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` @@ -828,9 +831,9 @@ get: function get() { return _Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. * @category Methods @@ -881,6 +884,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` @@ -920,9 +924,9 @@ value: function scale(v) { return _Mat2d.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -933,9 +937,9 @@ get: function get() { return 6 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} * @category Static @@ -1036,7 +1040,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -1116,6 +1120,7 @@ * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -1157,6 +1162,7 @@ * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -1250,9 +1256,10 @@ /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1273,9 +1280,10 @@ /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1298,9 +1306,10 @@ /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1372,7 +1381,7 @@ return out; } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1385,7 +1394,7 @@ 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]; } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1464,9 +1473,9 @@ } return _assertThisInitialized(_this3); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` @@ -1479,9 +1488,9 @@ get: function get() { return _Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. * @category Methods @@ -1532,6 +1541,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` @@ -1595,9 +1605,9 @@ value: function scale(v) { return _Mat3.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -1608,9 +1618,9 @@ get: function get() { return 9 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} * @category Static @@ -1754,7 +1764,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -1889,6 +1899,7 @@ * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -1939,6 +1950,7 @@ * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -2040,9 +2052,10 @@ /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -2094,9 +2107,10 @@ /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -2207,7 +2221,7 @@ * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "normalFromMat4", @@ -2373,7 +2387,7 @@ return out; } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2386,7 +2400,7 @@ 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]; } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2472,9 +2486,9 @@ } return _assertThisInitialized(_this4); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` @@ -2487,9 +2501,9 @@ get: function get() { return _Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. * @category Methods @@ -2538,6 +2552,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` @@ -2719,9 +2734,9 @@ value: function orthoZO(left, right, bottom, top, near, far) { return _Mat4.orthoZO(this, left, right, bottom, top, near, far); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -2732,9 +2747,9 @@ get: function get() { return 16 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} * @category Static @@ -2915,7 +2930,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -3132,6 +3147,7 @@ * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -3419,9 +3435,10 @@ /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3452,9 +3469,10 @@ /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3485,9 +3503,10 @@ /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3533,9 +3552,10 @@ /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3568,9 +3588,10 @@ /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3603,9 +3624,10 @@ /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3638,12 +3660,13 @@ /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3726,7 +3749,7 @@ * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "normalFromMat4", @@ -4000,13 +4023,14 @@ /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -4056,17 +4080,18 @@ return out; } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -4229,6 +4254,7 @@ value: function frustum(out, left, right, bottom, top, near) { return out; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], @@ -4323,6 +4349,7 @@ * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "perspective", value: function perspective(out, fovy, aspect, near) { @@ -4372,9 +4399,8 @@ return out; } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4412,9 +4438,8 @@ return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4455,15 +4480,15 @@ * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "ortho", value: function ortho(out, left, right, bottom, top, near, far) { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4500,8 +4525,8 @@ return out; } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4711,6 +4736,7 @@ * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -4778,7 +4804,7 @@ return out; } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -4791,7 +4817,7 @@ 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]; } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -4901,9 +4927,9 @@ } return _assertThisInitialized(_this5); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -5043,9 +5069,9 @@ get: function get() { return _Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. * @category Methods @@ -5100,6 +5126,7 @@ value: function sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` @@ -5125,6 +5152,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` @@ -5150,6 +5178,7 @@ value: function div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` @@ -5205,6 +5234,7 @@ value: function dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` @@ -5227,6 +5257,7 @@ value: function sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` @@ -5297,9 +5328,9 @@ value: function normalize() { return _Vec3.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -5310,9 +5341,9 @@ get: function get() { return 3 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 * @category Static @@ -5360,6 +5391,7 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -5368,12 +5400,13 @@ * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -5384,6 +5417,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values * @category Static @@ -5470,6 +5504,7 @@ * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -5496,6 +5531,7 @@ * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -5522,6 +5558,7 @@ * Alias for {@link Vec3.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "div", value: function div(out, a, b) { @@ -5601,7 +5638,8 @@ * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -5662,6 +5700,7 @@ * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dist", value: function dist(a, b) { @@ -5687,6 +5726,7 @@ * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrDist", value: function sqrDist(a, b) { @@ -5711,6 +5751,7 @@ * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrLen", value: function sqrLen(a, b) { @@ -5926,7 +5967,8 @@ * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -6126,7 +6168,7 @@ return "Vec3(".concat(a.join(", "), ")"); } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -6139,7 +6181,7 @@ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -6210,9 +6252,9 @@ } return _assertThisInitialized(_this6); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -6353,9 +6395,9 @@ get: function get() { return _Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. * @category Methods @@ -6412,6 +6454,7 @@ value: function sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` @@ -6438,6 +6481,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` @@ -6464,6 +6508,7 @@ value: function div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` @@ -6521,6 +6566,7 @@ value: function dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` @@ -6543,6 +6589,7 @@ value: function sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` @@ -6616,9 +6663,9 @@ value: function normalize() { return _Vec4.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -6629,9 +6676,9 @@ get: function get() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} * @category Static @@ -6747,6 +6794,7 @@ * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -6774,6 +6822,7 @@ * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -6801,6 +6850,7 @@ * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "div", value: function div(out, a, b) { @@ -6951,6 +7001,7 @@ * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dist", value: function dist(a, b) { @@ -6977,6 +7028,7 @@ * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrDist", value: function sqrDist(a, b) { @@ -7007,17 +7059,19 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static @@ -7028,6 +7082,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} * @category Static @@ -7053,6 +7108,7 @@ value: function sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} * @category Static @@ -7202,7 +7258,8 @@ * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -7308,7 +7365,7 @@ return "Vec4(".concat(a.join(", "), ")"); } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -7321,7 +7378,7 @@ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -7396,9 +7453,9 @@ } return _assertThisInitialized(_this7); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -7489,9 +7546,9 @@ get: function get() { return _Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. * @category Methods @@ -7543,6 +7600,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` @@ -7624,9 +7682,9 @@ value: function dot(b) { return _Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -7637,9 +7695,9 @@ get: function get() { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat * @category Static @@ -7680,7 +7738,7 @@ }, { key: "setAxisAngle", value: function setAxisAngle(out, axis, rad) { - rad = rad * 0.5; + rad *= 0.5; var s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -7692,7 +7750,7 @@ * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -7734,7 +7792,7 @@ return Math.acos(2 * dotproduct * dotproduct - 1); } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -7973,7 +8031,7 @@ * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -8014,7 +8072,7 @@ } /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -8034,7 +8092,7 @@ * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -8055,8 +8113,12 @@ out[2] = (m[1] - m[3]) * fRoot; } else { var i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } var j = (i + 1) % 3; var k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); @@ -8131,7 +8193,7 @@ out[3] = cx * cy * cz + sx * sy * sz; break; default: - throw new Error("Unknown angle order " + order); + throw new Error("Unknown angle order ".concat(order)); } return out; } @@ -8202,6 +8264,7 @@ * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "set", value: function set(out, x, y, z, w) { @@ -8216,6 +8279,7 @@ * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "add", value: function add(out, a, b) { @@ -8225,6 +8289,7 @@ * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -8271,6 +8336,7 @@ * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "lerp", value: function lerp(out, a, b, t) { @@ -8283,6 +8349,7 @@ * @param a - quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "magnitude", value: function magnitude(a) { @@ -8292,6 +8359,7 @@ * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mag", value: function mag(a) { @@ -8302,12 +8370,13 @@ * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static @@ -8318,6 +8387,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} * @category Static @@ -8325,6 +8395,7 @@ * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "squaredLength", value: function squaredLength(a) { @@ -8339,6 +8410,7 @@ value: function sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} * @category Static @@ -8347,32 +8419,35 @@ * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "normalize", value: function normalize(out, a) { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "exactEquals", value: function exactEquals(a, b) { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "equals", value: function equals(a, b) { @@ -8396,7 +8471,9 @@ var dot = Vec3.dot(a, b); if (dot < -0.999999) { Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); - if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + } Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); return out; @@ -8533,9 +8610,9 @@ } return _assertThisInitialized(_this8); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` @@ -8548,9 +8625,9 @@ get: function get() { return _Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. * @category Methods @@ -8564,9 +8641,9 @@ _get(_getPrototypeOf(_Quat2.prototype), "set", this).call(this, a); return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -8577,9 +8654,9 @@ get: function get() { return 8 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} * @category Static @@ -9113,7 +9190,7 @@ return _Quat2.copy(out, a); } var axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; var s = Math.sin(rad); var bx = s * axis[0] / axisLength; var by = s * axis[1] / axisLength; @@ -9201,6 +9278,7 @@ * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -9236,6 +9314,7 @@ * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dot", value: function dot(a, b) { @@ -9256,7 +9335,9 @@ key: "lerp", value: function lerp(out, a, b, t) { var mt = 1 - t; - if (_Quat2.dot(a, b) < 0) t = -t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; out[2] = a[2] * mt + b[2] * t; @@ -9290,8 +9371,8 @@ return out; } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -9318,6 +9399,7 @@ * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "magnitude", value: function magnitude(a) { @@ -9332,17 +9414,19 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static @@ -9353,6 +9437,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} * @category Static @@ -9360,6 +9445,7 @@ * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "squaredLength", value: function squaredLength(a) { @@ -9374,6 +9460,7 @@ value: function sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} * @category Static @@ -9421,7 +9508,7 @@ return "Quat2(".concat(a.join(", "), ")"); } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -9434,7 +9521,7 @@ 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]; } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -9516,9 +9603,9 @@ } return _assertThisInitialized(_this9); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -9630,9 +9717,9 @@ get: function get() { return _Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. * @category Methods @@ -9686,6 +9773,7 @@ value: function sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` @@ -9710,6 +9798,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` @@ -9734,6 +9823,7 @@ value: function div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` @@ -9787,6 +9877,7 @@ value: function dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` @@ -9809,6 +9900,7 @@ value: function sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` @@ -9876,9 +9968,9 @@ value: function normalize() { return _Vec2.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -9889,9 +9981,9 @@ get: function get() { return 2 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} * @category Static @@ -9995,6 +10087,7 @@ * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -10020,6 +10113,7 @@ * Alias for {@link Vec2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -10045,6 +10139,7 @@ * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "div", value: function div(out, a, b) { @@ -10177,6 +10272,7 @@ * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dist", value: function dist(a, b) { @@ -10201,6 +10297,7 @@ * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrDist", value: function sqrDist(a, b) { @@ -10229,6 +10326,7 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -10237,12 +10335,13 @@ * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -10253,6 +10352,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} * @category Static @@ -10271,6 +10371,7 @@ * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrLen", value: function sqrLen(a, b) { @@ -10523,7 +10624,7 @@ return out; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -10536,7 +10637,7 @@ return a[0] === b[0] && a[1] === b[1]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -10615,6 +10716,7 @@ return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; } + throw new Error("Illegal swizzle length"); } for (var _i = 0, _VEC2_SWIZZLES = VEC2_SWIZZLES; _i < _VEC2_SWIZZLES.length; _i++) { var swizzle = _VEC2_SWIZZLES[_i]; diff --git a/dist-cdn/umd/gl-matrix-f32.js.map b/dist-cdn/umd/gl-matrix-f32.js.map index 73d59220..aab90e7c 100644 --- a/dist-cdn/umd/gl-matrix-f32.js.map +++ b/dist-cdn/umd/gl-matrix-f32.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAc,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.min.js b/dist-cdn/umd/gl-matrix-f32.min.js index 7e0f568c..9af348bc 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.js +++ b/dist-cdn/umd/gl-matrix-f32.min.js @@ -135,11 +135,11 @@ var de = function de(A) { throw TypeError(A); }; - var xe = function xe(A, e, t) { + var oe = function oe(A, e, t) { return e.has(A) || de("Cannot " + t); }; var E = function E(A, e, t) { - return xe(A, e, "read from private field"), t ? t.call(A) : e.get(A); + return oe(A, e, "read from private field"), t ? t.call(A) : e.get(A); }, Z = function Z(A, e, t) { return e.has(A) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(A) : e.set(A, t); @@ -401,35 +401,35 @@ v.mul = v.multiply; v.sub = v.subtract; var se, - $ = /*#__PURE__*/function (_Float32Array2) { - function $() { + H = /*#__PURE__*/function (_Float32Array2) { + function H() { var _this2; - _classCallCheck(this, $); + _classCallCheck(this, H); for (var _len3 = arguments.length, e = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { e[_key3] = arguments[_key3]; } switch (e.length) { case 6: - _this2 = _callSuper(this, $, [e]); + _this2 = _callSuper(this, H, [e]); break; case 2: - _this2 = _callSuper(this, $, [e[0], e[1], 6]); + _this2 = _callSuper(this, H, [e[0], e[1], 6]); break; case 1: var t = e[0]; - typeof t == "number" ? _this2 = _callSuper(this, $, [[t, t, t, t, t, t]]) : _this2 = _callSuper(this, $, [t, 0, 6]); + typeof t == "number" ? _this2 = _callSuper(this, H, [[t, t, t, t, t, t]]) : _this2 = _callSuper(this, H, [t, 0, 6]); break; default: - _this2 = _callSuper(this, $, [E($, se)]); + _this2 = _callSuper(this, H, [E(H, se)]); break; } return _assertThisInitialized(_this2); } - _inherits($, _Float32Array2); - return _createClass($, [{ + _inherits(H, _Float32Array2); + return _createClass(H, [{ key: "str", get: function get() { - return $.str(this); + return H.str(this); } }, { key: "copy", @@ -439,12 +439,12 @@ }, { key: "identity", value: function identity() { - return this.set(E($, se)), this; + return this.set(E(H, se)), this; } }, { key: "multiply", value: function multiply(e) { - return $.multiply(this, this, e); + return H.multiply(this, this, e); } }, { key: "mul", @@ -454,17 +454,17 @@ }, { key: "translate", value: function translate(e) { - return $.translate(this, this, e); + return H.translate(this, this, e); } }, { key: "rotate", value: function rotate(e) { - return $.rotate(this, this, e); + return H.rotate(this, this, e); } }, { key: "scale", value: function scale(e) { - return $.scale(this, this, e); + return H.scale(this, this, e); } }], [{ key: "BYTE_LENGTH", @@ -474,12 +474,12 @@ }, { key: "create", value: function create() { - return new $(); + return new H(); } }, { key: "clone", value: function clone(e) { - return new $(e); + return new H(e); } }, { key: "copy", @@ -492,7 +492,7 @@ for (var _len4 = arguments.length, e = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { e[_key4] = arguments[_key4]; } - return _construct($, e); + return _construct(H, e); } }, { key: "set", @@ -658,8 +658,8 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); - se = new WeakMap(), Z($, se, new Float32Array([1, 0, 0, 1, 0, 0])); - var _ = $; + se = new WeakMap(), Z(H, se, new Float32Array([1, 0, 0, 1, 0, 0])); + var _ = H; _.mul = _.multiply; _.sub = _.subtract; var re, @@ -949,8 +949,8 @@ b = r * y, d = a * i, m = a * c, - x = a * y; - return e[0] = 1 - l - b, e[3] = k - x, e[6] = M + m, e[1] = k + x, e[4] = 1 - L - b, e[7] = h - d, e[2] = M - m, e[5] = h + d, e[8] = 1 - L - l, e; + o = a * y; + return e[0] = 1 - l - b, e[3] = k - o, e[6] = M + m, e[1] = k + o, e[4] = 1 - L - b, e[7] = h - d, e[2] = M - m, e[5] = h + d, e[8] = 1 - L - l, e; } }, { key: "fromMat4", @@ -975,21 +975,21 @@ b = t[12], d = t[13], m = t[14], - x = t[15], + o = t[15], V = n * c - s * i, - o = n * y - r * i, + x = n * y - r * i, R = n * L - a * i, z = s * y - r * c, g = s * L - a * c, - S = r * L - a * y, - B = k * d - l * b, - N = k * m - M * b, - p = k * x - h * b, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, Y = l * m - M * d, - F = l * x - h * d, - P = M * x - h * m, - Q = V * P - o * F + R * Y + z * p - g * N + S * B; - return Q ? (Q = 1 / Q, e[0] = (c * P - y * F + L * Y) * Q, e[1] = (y * p - i * P - L * N) * Q, e[2] = (i * F - c * p + L * B) * Q, e[3] = (r * F - s * P - a * Y) * Q, e[4] = (n * P - r * p + a * N) * Q, e[5] = (s * p - n * F - a * B) * Q, e[6] = (d * S - m * g + x * z) * Q, e[7] = (m * R - b * S - x * o) * Q, e[8] = (b * g - d * R + x * V) * Q, e) : null; + I = l * o - h * d, + P = M * o - h * m, + Q = V * P - x * I + R * Y + z * p - g * F + B * D; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - i * P - L * F) * Q, e[2] = (i * I - c * p + L * D) * Q, e[3] = (r * I - s * P - a * Y) * Q, e[4] = (n * P - r * p + a * F) * Q, e[5] = (s * p - n * I - a * D) * Q, e[6] = (d * B - m * g + o * z) * Q, e[7] = (m * R - b * B - o * x) * Q, e[8] = (b * g - d * R + o * V) * Q, e) : null; } }, { key: "normalFromMat4Fast", @@ -1048,10 +1048,10 @@ b = t[3], d = t[4], m = t[5], - x = t[6], + o = t[6], V = t[7], - o = t[8]; - return Math.abs(n - l) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(l)) && Math.abs(s - M) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(M)) && Math.abs(r - h) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(h)) && Math.abs(a - b) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(i - d) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(d)) && Math.abs(c - m) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(y - x) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(x)) && Math.abs(L - V) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(V)) && Math.abs(k - o) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(o)); + x = t[8]; + return Math.abs(n - l) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(l)) && Math.abs(s - M) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(M)) && Math.abs(r - h) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(h)) && Math.abs(a - b) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(i - d) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(d)) && Math.abs(c - m) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(y - o) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(o)) && Math.abs(L - V) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(V)) && Math.abs(k - x) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(x)); } }, { key: "str", @@ -1066,36 +1066,36 @@ u.mul = u.multiply; u.sub = u.subtract; var ae, - H, - D = /*#__PURE__*/function (_Float32Array4) { - function D() { + $, + S = /*#__PURE__*/function (_Float32Array4) { + function S() { var _this4; - _classCallCheck(this, D); + _classCallCheck(this, S); for (var _len7 = arguments.length, e = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { e[_key7] = arguments[_key7]; } switch (e.length) { case 16: - _this4 = _callSuper(this, D, [e]); + _this4 = _callSuper(this, S, [e]); break; case 2: - _this4 = _callSuper(this, D, [e[0], e[1], 16]); + _this4 = _callSuper(this, S, [e[0], e[1], 16]); break; case 1: var t = e[0]; - typeof t == "number" ? _this4 = _callSuper(this, D, [[t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]]) : _this4 = _callSuper(this, D, [t, 0, 16]); + typeof t == "number" ? _this4 = _callSuper(this, S, [[t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]]) : _this4 = _callSuper(this, S, [t, 0, 16]); break; default: - _this4 = _callSuper(this, D, [E(D, ae)]); + _this4 = _callSuper(this, S, [E(S, ae)]); break; } return _assertThisInitialized(_this4); } - _inherits(D, _Float32Array4); - return _createClass(D, [{ + _inherits(S, _Float32Array4); + return _createClass(S, [{ key: "str", get: function get() { - return D.str(this); + return S.str(this); } }, { key: "copy", @@ -1105,12 +1105,12 @@ }, { key: "identity", value: function identity() { - return this.set(E(D, ae)), this; + return this.set(E(S, ae)), this; } }, { key: "multiply", value: function multiply(e) { - return D.multiply(this, this, e); + return S.multiply(this, this, e); } }, { key: "mul", @@ -1120,62 +1120,62 @@ }, { key: "transpose", value: function transpose() { - return D.transpose(this, this); + return S.transpose(this, this); } }, { key: "invert", value: function invert() { - return D.invert(this, this); + return S.invert(this, this); } }, { key: "translate", value: function translate(e) { - return D.translate(this, this, e); + return S.translate(this, this, e); } }, { key: "rotate", value: function rotate(e, t) { - return D.rotate(this, this, e, t); + return S.rotate(this, this, e, t); } }, { key: "scale", value: function scale(e) { - return D.scale(this, this, e); + return S.scale(this, this, e); } }, { key: "rotateX", value: function rotateX(e) { - return D.rotateX(this, this, e); + return S.rotateX(this, this, e); } }, { key: "rotateY", value: function rotateY(e) { - return D.rotateY(this, this, e); + return S.rotateY(this, this, e); } }, { key: "rotateZ", value: function rotateZ(e) { - return D.rotateZ(this, this, e); + return S.rotateZ(this, this, e); } }, { key: "perspectiveNO", value: function perspectiveNO(e, t, n, s) { - return D.perspectiveNO(this, e, t, n, s); + return S.perspectiveNO(this, e, t, n, s); } }, { key: "perspectiveZO", value: function perspectiveZO(e, t, n, s) { - return D.perspectiveZO(this, e, t, n, s); + return S.perspectiveZO(this, e, t, n, s); } }, { key: "orthoNO", value: function orthoNO(e, t, n, s, r, a) { - return D.orthoNO(this, e, t, n, s, r, a); + return S.orthoNO(this, e, t, n, s, r, a); } }, { key: "orthoZO", value: function orthoZO(e, t, n, s, r, a) { - return D.orthoZO(this, e, t, n, s, r, a); + return S.orthoZO(this, e, t, n, s, r, a); } }], [{ key: "BYTE_LENGTH", @@ -1185,12 +1185,12 @@ }, { key: "create", value: function create() { - return new D(); + return new S(); } }, { key: "clone", value: function clone(e) { - return new D(e); + return new S(e); } }, { key: "copy", @@ -1203,7 +1203,7 @@ for (var _len8 = arguments.length, e = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { e[_key8] = arguments[_key8]; } - return _construct(D, e); + return _construct(S, e); } }, { key: "set", @@ -1247,21 +1247,21 @@ b = t[12], d = t[13], m = t[14], - x = t[15], + o = t[15], V = n * c - s * i, - o = n * y - r * i, + x = n * y - r * i, R = n * L - a * i, z = s * y - r * c, g = s * L - a * c, - S = r * L - a * y, - B = k * d - l * b, - N = k * m - M * b, - p = k * x - h * b, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, Y = l * m - M * d, - F = l * x - h * d, - P = M * x - h * m, - Q = V * P - o * F + R * Y + z * p - g * N + S * B; - return Q ? (Q = 1 / Q, e[0] = (c * P - y * F + L * Y) * Q, e[1] = (r * F - s * P - a * Y) * Q, e[2] = (d * S - m * g + x * z) * Q, e[3] = (M * g - l * S - h * z) * Q, e[4] = (y * p - i * P - L * N) * Q, e[5] = (n * P - r * p + a * N) * Q, e[6] = (m * R - b * S - x * o) * Q, e[7] = (k * S - M * R + h * o) * Q, e[8] = (i * F - c * p + L * B) * Q, e[9] = (s * p - n * F - a * B) * Q, e[10] = (b * g - d * R + x * V) * Q, e[11] = (l * R - k * g - h * V) * Q, e[12] = (c * N - i * Y - y * B) * Q, e[13] = (n * Y - s * N + r * B) * Q, e[14] = (d * o - b * z - m * V) * Q, e[15] = (k * z - l * o + M * V) * Q, e) : null; + I = l * o - h * d, + P = M * o - h * m, + Q = V * P - x * I + R * Y + z * p - g * F + B * D; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (r * I - s * P - a * Y) * Q, e[2] = (d * B - m * g + o * z) * Q, e[3] = (M * g - l * B - h * z) * Q, e[4] = (y * p - i * P - L * F) * Q, e[5] = (n * P - r * p + a * F) * Q, e[6] = (m * R - b * B - o * x) * Q, e[7] = (k * B - M * R + h * x) * Q, e[8] = (i * I - c * p + L * D) * Q, e[9] = (s * p - n * I - a * D) * Q, e[10] = (b * g - d * R + o * V) * Q, e[11] = (l * R - k * g - h * V) * Q, e[12] = (c * F - i * Y - y * D) * Q, e[13] = (n * Y - s * F + r * D) * Q, e[14] = (d * x - b * z - m * V) * Q, e[15] = (k * z - l * x + M * V) * Q, e) : null; } }, { key: "adjoint", @@ -1281,20 +1281,20 @@ b = t[12], d = t[13], m = t[14], - x = t[15], + o = t[15], V = n * c - s * i, - o = n * y - r * i, + x = n * y - r * i, R = n * L - a * i, z = s * y - r * c, g = s * L - a * c, - S = r * L - a * y, - B = k * d - l * b, - N = k * m - M * b, - p = k * x - h * b, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, Y = l * m - M * d, - F = l * x - h * d, - P = M * x - h * m; - return e[0] = c * P - y * F + L * Y, e[1] = r * F - s * P - a * Y, e[2] = d * S - m * g + x * z, e[3] = M * g - l * S - h * z, e[4] = y * p - i * P - L * N, e[5] = n * P - r * p + a * N, e[6] = m * R - b * S - x * o, e[7] = k * S - M * R + h * o, e[8] = i * F - c * p + L * B, e[9] = s * p - n * F - a * B, e[10] = b * g - d * R + x * V, e[11] = l * R - k * g - h * V, e[12] = c * N - i * Y - y * B, e[13] = n * Y - s * N + r * B, e[14] = d * o - b * z - m * V, e[15] = k * z - l * o + M * V, e; + I = l * o - h * d, + P = M * o - h * m; + return e[0] = c * P - y * I + L * Y, e[1] = r * I - s * P - a * Y, e[2] = d * B - m * g + o * z, e[3] = M * g - l * B - h * z, e[4] = y * p - i * P - L * F, e[5] = n * P - r * p + a * F, e[6] = m * R - b * B - o * x, e[7] = k * B - M * R + h * x, e[8] = i * I - c * p + L * D, e[9] = s * p - n * I - a * D, e[10] = b * g - d * R + o * V, e[11] = l * R - k * g - h * V, e[12] = c * F - i * Y - y * D, e[13] = n * Y - s * F + r * D, e[14] = d * x - b * z - m * V, e[15] = k * z - l * x + M * V, e; } }, { key: "determinant", @@ -1315,17 +1315,17 @@ b = e[13], d = e[14], m = e[15], - x = t * i - n * a, + o = t * i - n * a, V = t * c - s * a, - o = n * c - s * i, + x = n * c - s * i, R = L * b - k * h, z = L * d - l * h, g = k * d - l * b, - S = t * g - n * z + s * R, - B = a * g - i * z + c * R, - N = L * o - k * V + l * x, - p = h * o - b * V + d * x; - return y * S - r * B + m * N - M * p; + B = t * g - n * z + s * R, + D = a * g - i * z + c * R, + F = L * x - k * V + l * o, + p = h * x - b * V + d * o; + return y * B - r * D + m * F - M * p; } }, { key: "multiply", @@ -1344,13 +1344,13 @@ b = t[11], d = t[12], m = t[13], - x = t[14], + o = t[14], V = t[15], - o = n[0], + x = n[0], R = n[1], z = n[2], g = n[3]; - return e[0] = o * s + R * c + z * l + g * d, e[1] = o * r + R * y + z * M + g * m, e[2] = o * a + R * L + z * h + g * x, e[3] = o * i + R * k + z * b + g * V, o = n[4], R = n[5], z = n[6], g = n[7], e[4] = o * s + R * c + z * l + g * d, e[5] = o * r + R * y + z * M + g * m, e[6] = o * a + R * L + z * h + g * x, e[7] = o * i + R * k + z * b + g * V, o = n[8], R = n[9], z = n[10], g = n[11], e[8] = o * s + R * c + z * l + g * d, e[9] = o * r + R * y + z * M + g * m, e[10] = o * a + R * L + z * h + g * x, e[11] = o * i + R * k + z * b + g * V, o = n[12], R = n[13], z = n[14], g = n[15], e[12] = o * s + R * c + z * l + g * d, e[13] = o * r + R * y + z * M + g * m, e[14] = o * a + R * L + z * h + g * x, e[15] = o * i + R * k + z * b + g * V, e; + return e[0] = x * s + R * c + z * l + g * d, e[1] = x * r + R * y + z * M + g * m, e[2] = x * a + R * L + z * h + g * o, e[3] = x * i + R * k + z * b + g * V, x = n[4], R = n[5], z = n[6], g = n[7], e[4] = x * s + R * c + z * l + g * d, e[5] = x * r + R * y + z * M + g * m, e[6] = x * a + R * L + z * h + g * o, e[7] = x * i + R * k + z * b + g * V, x = n[8], R = n[9], z = n[10], g = n[11], e[8] = x * s + R * c + z * l + g * d, e[9] = x * r + R * y + z * M + g * m, e[10] = x * a + R * L + z * h + g * o, e[11] = x * i + R * k + z * b + g * V, x = n[12], R = n[13], z = n[14], g = n[15], e[12] = x * s + R * c + z * l + g * d, e[13] = x * r + R * y + z * M + g * m, e[14] = x * a + R * L + z * h + g * o, e[15] = x * i + R * k + z * b + g * V, e; } }, { key: "mul", @@ -1375,8 +1375,8 @@ b = t[8], d = t[9], m = t[10], - x = t[11]; - e[0] = i, e[1] = c, e[2] = y, e[3] = L, e[4] = k, e[5] = l, e[6] = M, e[7] = h, e[8] = b, e[9] = d, e[10] = m, e[11] = x, e[12] = i * s + k * r + b * a + t[12], e[13] = c * s + l * r + d * a + t[13], e[14] = y * s + M * r + m * a + t[14], e[15] = L * s + h * r + x * a + t[15]; + o = t[11]; + e[0] = i, e[1] = c, e[2] = y, e[3] = L, e[4] = k, e[5] = l, e[6] = M, e[7] = h, e[8] = b, e[9] = d, e[10] = m, e[11] = o, e[12] = i * s + k * r + b * a + t[12], e[13] = c * s + l * r + d * a + t[13], e[14] = y * s + M * r + m * a + t[14], e[15] = L * s + h * r + o * a + t[15]; } return e; } @@ -1406,22 +1406,22 @@ b = t[3], d = t[4], m = t[5], - x = t[6], + o = t[6], V = t[7], - o = t[8], + x = t[8], R = t[9], z = t[10], g = t[11], - S = r * r * k + L, - B = a * r * k + i * y, - N = i * r * k - a * y, + B = r * r * k + L, + D = a * r * k + i * y, + F = i * r * k - a * y, p = r * a * k - i * y, Y = a * a * k + L, - F = i * a * k + r * y, + I = i * a * k + r * y, P = r * i * k + a * y, Q = a * i * k - r * y, K = i * i * k + L; - return e[0] = l * S + d * B + o * N, e[1] = M * S + m * B + R * N, e[2] = h * S + x * B + z * N, e[3] = b * S + V * B + g * N, e[4] = l * p + d * Y + o * F, e[5] = M * p + m * Y + R * F, e[6] = h * p + x * Y + z * F, e[7] = b * p + V * Y + g * F, e[8] = l * P + d * Q + o * K, e[9] = M * P + m * Q + R * K, e[10] = h * P + x * Q + z * K, e[11] = b * P + V * Q + g * K, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e; + return e[0] = l * B + d * D + x * F, e[1] = M * B + m * D + R * F, e[2] = h * B + o * D + z * F, e[3] = b * B + V * D + g * F, e[4] = l * p + d * Y + x * I, e[5] = M * p + m * Y + R * I, e[6] = h * p + o * Y + z * I, e[7] = b * p + V * Y + g * I, e[8] = l * P + d * Q + x * K, e[9] = M * P + m * Q + R * K, e[10] = h * P + o * Q + z * K, e[11] = b * P + V * Q + g * K, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e; } }, { key: "rotateX", @@ -1530,9 +1530,9 @@ b = r * L, d = a * L, m = i * c, - x = i * y, + o = i * y, V = i * L; - return e[0] = 1 - (h + d), e[1] = l + V, e[2] = M - x, e[3] = 0, e[4] = l - V, e[5] = 1 - (k + d), e[6] = b + m, e[7] = 0, e[8] = M + x, e[9] = b - m, e[10] = 1 - (k + h), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + return e[0] = 1 - (h + d), e[1] = l + V, e[2] = M - o, e[3] = 0, e[4] = l - V, e[5] = 1 - (k + d), e[6] = b + m, e[7] = 0, e[8] = M + o, e[9] = b - m, e[10] = 1 - (k + h), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; } }, { key: "fromQuat2", @@ -1546,7 +1546,7 @@ y = t[6], L = t[7], k = n * n + s * s + r * r + a * a; - return k > 0 ? (E(D, H)[0] = (i * a + L * n + c * r - y * s) * 2 / k, E(D, H)[1] = (c * a + L * s + y * n - i * r) * 2 / k, E(D, H)[2] = (y * a + L * r + i * s - c * n) * 2 / k) : (E(D, H)[0] = (i * a + L * n + c * r - y * s) * 2, E(D, H)[1] = (c * a + L * s + y * n - i * r) * 2, E(D, H)[2] = (y * a + L * r + i * s - c * n) * 2), D.fromRotationTranslation(e, t, E(D, H)), e; + return k > 0 ? (E(S, $)[0] = (i * a + L * n + c * r - y * s) * 2 / k, E(S, $)[1] = (c * a + L * s + y * n - i * r) * 2 / k, E(S, $)[2] = (y * a + L * r + i * s - c * n) * 2 / k) : (E(S, $)[0] = (i * a + L * n + c * r - y * s) * 2, E(S, $)[1] = (c * a + L * s + y * n - i * r) * 2, E(S, $)[2] = (y * a + L * r + i * s - c * n) * 2), S.fromRotationTranslation(e, t, E(S, $)), e; } }, { key: "normalFromMat4", @@ -1566,21 +1566,21 @@ b = t[12], d = t[13], m = t[14], - x = t[15], + o = t[15], V = n * c - s * i, - o = n * y - r * i, + x = n * y - r * i, R = n * L - a * i, z = s * y - r * c, g = s * L - a * c, - S = r * L - a * y, - B = k * d - l * b, - N = k * m - M * b, - p = k * x - h * b, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, Y = l * m - M * d, - F = l * x - h * d, - P = M * x - h * m, - Q = V * P - o * F + R * Y + z * p - g * N + S * B; - return Q ? (Q = 1 / Q, e[0] = (c * P - y * F + L * Y) * Q, e[1] = (y * p - i * P - L * N) * Q, e[2] = (i * F - c * p + L * B) * Q, e[3] = 0, e[4] = (r * F - s * P - a * Y) * Q, e[5] = (n * P - r * p + a * N) * Q, e[6] = (s * p - n * F - a * B) * Q, e[7] = 0, e[8] = (d * S - m * g + x * z) * Q, e[9] = (m * R - b * S - x * o) * Q, e[10] = (b * g - d * R + x * V) * Q, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e) : null; + I = l * o - h * d, + P = M * o - h * m, + Q = V * P - x * I + R * Y + z * p - g * F + B * D; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - i * P - L * F) * Q, e[2] = (i * I - c * p + L * D) * Q, e[3] = 0, e[4] = (r * I - s * P - a * Y) * Q, e[5] = (n * P - r * p + a * F) * Q, e[6] = (s * p - n * I - a * D) * Q, e[7] = 0, e[8] = (d * B - m * g + o * z) * Q, e[9] = (m * R - b * B - o * x) * Q, e[10] = (b * g - d * R + o * V) * Q, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e) : null; } }, { key: "normalFromMat4Fast", @@ -1618,10 +1618,10 @@ }, { key: "getRotation", value: function getRotation(e, t) { - D.getScaling(E(D, H), t); - var n = 1 / E(D, H)[0], - s = 1 / E(D, H)[1], - r = 1 / E(D, H)[2], + S.getScaling(E(S, $), t); + var n = 1 / E(S, $)[0], + s = 1 / E(S, $)[1], + r = 1 / E(S, $)[2], a = t[0] * n, i = t[1] * s, c = t[2] * r, @@ -1653,17 +1653,17 @@ b = 1 / n[1], d = 1 / n[2], m = r * h, - x = a * b, + o = a * b, V = i * d, - o = c * h, + x = c * h, R = y * b, z = L * d, g = k * h, - S = l * b, - B = M * d, - N = m + R + B, + B = l * b, + D = M * d, + F = m + R + D, p = 0; - return N > 0 ? (p = Math.sqrt(N + 1) * 2, e[3] = .25 * p, e[0] = (z - S) / p, e[1] = (g - V) / p, e[2] = (x - o) / p) : m > R && m > B ? (p = Math.sqrt(1 + m - R - B) * 2, e[3] = (z - S) / p, e[0] = .25 * p, e[1] = (x + o) / p, e[2] = (g + V) / p) : R > B ? (p = Math.sqrt(1 + R - m - B) * 2, e[3] = (g - V) / p, e[0] = (x + o) / p, e[1] = .25 * p, e[2] = (z + S) / p) : (p = Math.sqrt(1 + B - m - R) * 2, e[3] = (x - o) / p, e[0] = (g + V) / p, e[1] = (z + S) / p, e[2] = .25 * p), e; + return F > 0 ? (p = Math.sqrt(F + 1) * 2, e[3] = .25 * p, e[0] = (z - B) / p, e[1] = (g - V) / p, e[2] = (o - x) / p) : m > R && m > D ? (p = Math.sqrt(1 + m - R - D) * 2, e[3] = (z - B) / p, e[0] = .25 * p, e[1] = (o + x) / p, e[2] = (g + V) / p) : R > D ? (p = Math.sqrt(1 + R - m - D) * 2, e[3] = (g - V) / p, e[0] = (o + x) / p, e[1] = .25 * p, e[2] = (z + B) / p) : (p = Math.sqrt(1 + D - m - R) * 2, e[3] = (o - x) / p, e[0] = (g + V) / p, e[1] = (z + B) / p, e[2] = .25 * p), e; } }, { key: "fromRotationTranslationScale", @@ -1681,13 +1681,13 @@ b = a * L, d = a * k, m = i * k, - x = c * y, + o = c * y, V = c * L, - o = c * k, + x = c * k, R = s[0], z = s[1], g = s[2]; - return e[0] = (1 - (b + m)) * R, e[1] = (M + o) * R, e[2] = (h - V) * R, e[3] = 0, e[4] = (M - o) * z, e[5] = (1 - (l + m)) * z, e[6] = (d + x) * z, e[7] = 0, e[8] = (h + V) * g, e[9] = (d - x) * g, e[10] = (1 - (l + b)) * g, e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + return e[0] = (1 - (b + m)) * R, e[1] = (M + x) * R, e[2] = (h - V) * R, e[3] = 0, e[4] = (M - x) * z, e[5] = (1 - (l + m)) * z, e[6] = (d + o) * z, e[7] = 0, e[8] = (h + V) * g, e[9] = (d - o) * g, e[10] = (1 - (l + b)) * g, e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; } }, { key: "fromRotationTranslationScaleOrigin", @@ -1704,26 +1704,26 @@ b = a * l, d = i * k, m = i * l, - x = c * l, + o = c * l, V = y * L, - o = y * k, + x = y * k, R = y * l, z = s[0], g = s[1], - S = s[2], - B = r[0], - N = r[1], + B = s[2], + D = r[0], + F = r[1], p = r[2], - Y = (1 - (d + x)) * z, - F = (h + R) * z, - P = (b - o) * z, + Y = (1 - (d + o)) * z, + I = (h + R) * z, + P = (b - x) * z, Q = (h - R) * g, - K = (1 - (M + x)) * g, + K = (1 - (M + o)) * g, ee = (m + V) * g, - te = (b + o) * S, - Me = (m - V) * S, - be = (1 - (M + d)) * S; - return e[0] = Y, e[1] = F, e[2] = P, e[3] = 0, e[4] = Q, e[5] = K, e[6] = ee, e[7] = 0, e[8] = te, e[9] = Me, e[10] = be, e[11] = 0, e[12] = n[0] + B - (Y * B + Q * N + te * p), e[13] = n[1] + N - (F * B + K * N + Me * p), e[14] = n[2] + p - (P * B + ee * N + be * p), e[15] = 1, e; + te = (b + x) * B, + Me = (m - V) * B, + be = (1 - (M + d)) * B; + return e[0] = Y, e[1] = I, e[2] = P, e[3] = 0, e[4] = Q, e[5] = K, e[6] = ee, e[7] = 0, e[8] = te, e[9] = Me, e[10] = be, e[11] = 0, e[12] = n[0] + D - (Y * D + Q * F + te * p), e[13] = n[1] + F - (I * D + K * F + Me * p), e[14] = n[2] + p - (P * D + ee * F + be * p), e[15] = 1, e; } }, { key: "fromQuat", @@ -1743,8 +1743,8 @@ b = r * y, d = a * i, m = a * c, - x = a * y; - return e[0] = 1 - l - b, e[1] = k + x, e[2] = M - m, e[3] = 0, e[4] = k - x, e[5] = 1 - L - b, e[6] = h + d, e[7] = 0, e[8] = M + m, e[9] = h - d, e[10] = 1 - L - l, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + o = a * y; + return e[0] = 1 - l - b, e[1] = k + o, e[2] = M - m, e[3] = 0, e[4] = k - o, e[5] = 1 - L - b, e[6] = h + d, e[7] = 0, e[8] = M + m, e[9] = h - d, e[10] = 1 - L - l, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } }, { key: "frustumNO", @@ -1846,20 +1846,20 @@ k = n[0], l = n[1], M = n[2]; - if (Math.abs(r - k) < 1e-6 && Math.abs(a - l) < 1e-6 && Math.abs(i - M) < 1e-6) return D.identity(e); + if (Math.abs(r - k) < 1e-6 && Math.abs(a - l) < 1e-6 && Math.abs(i - M) < 1e-6) return S.identity(e); var h = r - k, b = a - l, d = i - M, m = 1 / Math.sqrt(h * h + b * b + d * d); h *= m, b *= m, d *= m; - var x = y * d - L * b, + var o = y * d - L * b, V = L * h - c * d, - o = c * b - y * h; - m = Math.sqrt(x * x + V * V + o * o), m ? (m = 1 / m, x *= m, V *= m, o *= m) : (x = 0, V = 0, o = 0); - var R = b * o - d * V, - z = d * x - h * o, - g = h * V - b * x; - return m = Math.sqrt(R * R + z * z + g * g), m ? (m = 1 / m, R *= m, z *= m, g *= m) : (R = 0, z = 0, g = 0), e[0] = x, e[1] = R, e[2] = h, e[3] = 0, e[4] = V, e[5] = z, e[6] = b, e[7] = 0, e[8] = o, e[9] = g, e[10] = d, e[11] = 0, e[12] = -(x * r + V * a + o * i), e[13] = -(R * r + z * a + g * i), e[14] = -(h * r + b * a + d * i), e[15] = 1, e; + x = c * b - y * h; + m = Math.sqrt(o * o + V * V + x * x), m ? (m = 1 / m, o *= m, V *= m, x *= m) : (o = 0, V = 0, x = 0); + var R = b * x - d * V, + z = d * o - h * x, + g = h * V - b * o; + return m = Math.sqrt(R * R + z * z + g * g), m ? (m = 1 / m, R *= m, z *= m, g *= m) : (R = 0, z = 0, g = 0), e[0] = o, e[1] = R, e[2] = h, e[3] = 0, e[4] = V, e[5] = z, e[6] = b, e[7] = 0, e[8] = x, e[9] = g, e[10] = d, e[11] = 0, e[12] = -(o * r + V * a + x * i), e[13] = -(R * r + z * a + g * i), e[14] = -(h * r + b * a + d * i), e[15] = 1, e; } }, { key: "targetTo", @@ -1933,24 +1933,24 @@ b = e[12], d = e[13], m = e[14], - x = e[15], + o = e[15], V = t[0], - o = t[1], + x = t[1], R = t[2], z = t[3], g = t[4], - S = t[5], - B = t[6], - N = t[7], + B = t[5], + D = t[6], + F = t[7], p = t[8], Y = t[9], - F = t[10], + I = t[10], P = t[11], Q = t[12], K = t[13], ee = t[14], te = t[15]; - return Math.abs(n - V) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(V)) && Math.abs(s - o) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(o)) && Math.abs(r - R) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(R)) && Math.abs(a - z) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(z)) && Math.abs(i - g) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(g)) && Math.abs(c - S) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(S)) && Math.abs(y - B) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(B)) && Math.abs(L - N) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(N)) && Math.abs(k - p) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(p)) && Math.abs(l - Y) <= 1e-6 * Math.max(1, Math.abs(l), Math.abs(Y)) && Math.abs(M - F) <= 1e-6 * Math.max(1, Math.abs(M), Math.abs(F)) && Math.abs(h - P) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(P)) && Math.abs(b - Q) <= 1e-6 * Math.max(1, Math.abs(b), Math.abs(Q)) && Math.abs(d - K) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(K)) && Math.abs(m - ee) <= 1e-6 * Math.max(1, Math.abs(m), Math.abs(ee)) && Math.abs(x - te) <= 1e-6 * Math.max(1, Math.abs(x), Math.abs(te)); + return Math.abs(n - V) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(V)) && Math.abs(s - x) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(x)) && Math.abs(r - R) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(R)) && Math.abs(a - z) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(z)) && Math.abs(i - g) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(g)) && Math.abs(c - B) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(B)) && Math.abs(y - D) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(D)) && Math.abs(L - F) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(F)) && Math.abs(k - p) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(p)) && Math.abs(l - Y) <= 1e-6 * Math.max(1, Math.abs(l), Math.abs(Y)) && Math.abs(M - I) <= 1e-6 * Math.max(1, Math.abs(M), Math.abs(I)) && Math.abs(h - P) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(P)) && Math.abs(b - Q) <= 1e-6 * Math.max(1, Math.abs(b), Math.abs(Q)) && Math.abs(d - K) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(K)) && Math.abs(m - ee) <= 1e-6 * Math.max(1, Math.abs(m), Math.abs(ee)) && Math.abs(o - te) <= 1e-6 * Math.max(1, Math.abs(o), Math.abs(te)); } }, { key: "str", @@ -1959,8 +1959,8 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); - ae = new WeakMap(), H = new WeakMap(), Z(D, ae, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(D, H, new Float32Array(3)); - var G = D; + ae = new WeakMap(), $ = new WeakMap(), Z(S, ae, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(S, $, new Float32Array(3)); + var G = S; G.prototype.mul = G.prototype.multiply; G.sub = G.subtract; G.mul = G.multiply; @@ -3168,7 +3168,7 @@ }, { key: "setAxisAngle", value: function setAxisAngle(e, t, n) { - n = n * .5; + n *= .5; var s = Math.sin(n); return e[0] = s * t[0], e[1] = s * t[1], e[2] = s * t[2], e[3] = Math.cos(n), e; } @@ -3353,7 +3353,7 @@ e[0] = i * L * l - c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l + i * y * k; break; default: - throw new Error("Unknown angle order " + r); + throw new Error("Unknown angle order ".concat(r)); } return e; } @@ -3726,7 +3726,7 @@ value: function rotateAroundAxis(e, t, n, s) { if (Math.abs(s) < 1e-6) return j.copy(e, t); var r = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); - s = s * .5; + s *= .5; var a = Math.sin(s), i = a * n[0] / r, c = a * n[1] / r, @@ -3740,8 +3740,8 @@ var b = t[4], d = t[5], m = t[6], - x = t[7]; - return e[4] = b * L + x * i + d * y - m * c, e[5] = d * L + x * c + m * i - b * y, e[6] = m * L + x * y + b * c - d * i, e[7] = x * L - b * i - d * c - m * y, e; + o = t[7]; + return e[4] = b * L + o * i + d * y - m * c, e[5] = d * L + o * c + m * i - b * y, e[6] = m * L + o * y + b * c - d * i, e[7] = o * L - b * i - d * c - m * y, e; } }, { key: "add", @@ -3765,9 +3765,9 @@ b = t[7], d = n[0], m = n[1], - x = n[2], + o = n[2], V = n[3]; - return e[0] = s * V + i * d + r * x - a * m, e[1] = r * V + i * m + a * d - s * x, e[2] = a * V + i * x + s * m - r * d, e[3] = i * V - s * d - r * m - a * x, e[4] = s * k + i * c + r * L - a * y + l * V + b * d + M * x - h * m, e[5] = r * k + i * y + a * c - s * L + M * V + b * m + h * d - l * x, e[6] = a * k + i * L + s * y - r * c + h * V + b * x + l * m - M * d, e[7] = i * k - s * c - r * y - a * L + b * V - l * d - M * m - h * x, e; + return e[0] = s * V + i * d + r * o - a * m, e[1] = r * V + i * m + a * d - s * o, e[2] = a * V + i * o + s * m - r * d, e[3] = i * V - s * d - r * m - a * o, e[4] = s * k + i * c + r * L - a * y + l * V + b * d + M * o - h * m, e[5] = r * k + i * y + a * c - s * L + M * V + b * m + h * d - l * o, e[6] = a * k + i * L + s * y - r * c + h * V + b * o + l * m - M * d, e[7] = i * k - s * c - r * y - a * L + b * V - l * d - M * m - h * o, e; } }, { key: "mul", @@ -3878,8 +3878,8 @@ b = t[4], d = t[5], m = t[6], - x = t[7]; - return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - M) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(M)) && Math.abs(a - h) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(h)) && Math.abs(i - b) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(b)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - x) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(x)); + o = t[7]; + return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - M) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(M)) && Math.abs(a - h) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(h)) && Math.abs(i - b) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(b)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - o) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(o)); } }]); }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); @@ -3892,7 +3892,7 @@ J.length = O.magnitude; J.len = O.magnitude; J.mul = J.multiply; - var I = /*#__PURE__*/function (_Float32Array9) { + var N = /*#__PURE__*/function (_Float32Array9) { function A() { var _this9; _classCallCheck(this, A); @@ -4341,20 +4341,20 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); - I.prototype.sub = I.prototype.subtract; - I.prototype.mul = I.prototype.multiply; - I.prototype.div = I.prototype.divide; - I.prototype.dist = I.prototype.distance; - I.prototype.sqrDist = I.prototype.squaredDistance; - I.sub = I.subtract; - I.mul = I.multiply; - I.div = I.divide; - I.dist = I.distance; - I.sqrDist = I.squaredDistance; - I.sqrLen = I.squaredLength; - I.mag = I.magnitude; - I.length = I.magnitude; - I.len = I.magnitude; + N.prototype.sub = N.prototype.subtract; + N.prototype.mul = N.prototype.multiply; + N.prototype.div = N.prototype.divide; + N.prototype.dist = N.prototype.distance; + N.prototype.sqrDist = N.prototype.squaredDistance; + N.sub = N.subtract; + N.mul = N.multiply; + N.div = N.divide; + N.dist = N.distance; + N.sqrDist = N.squaredDistance; + N.sqrLen = N.squaredLength; + N.mag = N.magnitude; + N.length = N.magnitude; + N.len = N.magnitude; var me = !1; function _e() { if (me) return; @@ -4375,7 +4375,7 @@ switch (r.length) { case 2: return function () { - return new I(this[n[r[0]]], this[n[r[1]]]); + return new N(this[n[r[0]]], this[n[r[1]]]); }; case 3: return function () { @@ -4386,11 +4386,12 @@ return new q(this[n[r[0]]], this[n[r[1]]], this[n[r[2]]], this[n[r[3]]]); }; } + throw new Error("Illegal swizzle length"); } for (var _i = 0, _A = A; _i < _A.length; _i++) { var r = _A[_i]; var a = s(r); - Object.defineProperty(I.prototype, r, { + Object.defineProperty(N.prototype, r, { get: a }), Object.defineProperty(T.prototype, r, { get: a @@ -4416,13 +4417,13 @@ } me = !0; } - var oe = Math.PI / 180, + var xe = Math.PI / 180, Re = 180 / Math.PI; function tt(A) { return A * Re; } function nt(A) { - return A * oe; + return A * xe; } exports.EnableSwizzles = _e; @@ -4432,7 +4433,7 @@ exports.Mat4 = G; exports.Quat = O; exports.Quat2 = J; - exports.Vec2 = I; + exports.Vec2 = N; exports.Vec3 = T; exports.Vec4 = q; exports.mat2 = v; @@ -4443,7 +4444,7 @@ exports.quat2 = J; exports.toDegree = tt; exports.toRadian = nt; - exports.vec2 = I; + exports.vec2 = N; exports.vec3 = T; exports.vec4 = q; diff --git a/dist-cdn/umd/gl-matrix-f32.min.js.map b/dist-cdn/umd/gl-matrix-f32.min.js.map index 6824a38e..9c2c6b41 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.js.map +++ b/dist-cdn/umd/gl-matrix-f32.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float32Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[3]=k-x,e[6]=M+m,e[1]=k+x,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=(r*F-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*N)*Q,e[5]=(s*p-n*F-a*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-b*S-x*o)*Q,e[8]=(b*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,H,D=class D extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ae));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ae)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return D.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return D.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(r*F-s*P-a*Y)*Q,e[2]=(d*S-m*g+x*z)*Q,e[3]=(M*g-l*S-h*z)*Q,e[4]=(y*p-i*P-L*N)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(m*R-b*S-x*o)*Q,e[7]=(k*S-M*R+h*o)*Q,e[8]=(i*F-c*p+L*B)*Q,e[9]=(s*p-n*F-a*B)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*N-i*Y-y*B)*Q,e[13]=(n*Y-s*N+r*B)*Q,e[14]=(d*o-b*z-m*V)*Q,e[15]=(k*z-l*o+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m;return e[0]=c*P-y*F+L*Y,e[1]=r*F-s*P-a*Y,e[2]=d*S-m*g+x*z,e[3]=M*g-l*S-h*z,e[4]=y*p-i*P-L*N,e[5]=n*P-r*p+a*N,e[6]=m*R-b*S-x*o,e[7]=k*S-M*R+h*o,e[8]=i*F-c*p+L*B,e[9]=s*p-n*F-a*B,e[10]=b*g-d*R+x*V,e[11]=l*R-k*g-h*V,e[12]=c*N-i*Y-y*B,e[13]=n*Y-s*N+r*B,e[14]=d*o-b*z-m*V,e[15]=k*z-l*o+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],x=t*i-n*a,V=t*c-s*a,o=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,S=t*g-n*z+s*R,B=a*g-i*z+c*R,N=L*o-k*V+l*x,p=h*o-b*V+d*x;return y*S-r*B+m*N-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*M+g*m,e[2]=o*a+R*L+z*h+g*x,e[3]=o*i+R*k+z*b+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*M+g*m,e[6]=o*a+R*L+z*h+g*x,e[7]=o*i+R*k+z*b+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*M+g*m,e[10]=o*a+R*L+z*h+g*x,e[11]=o*i+R*k+z*b+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*M+g*m,e[14]=o*a+R*L+z*h+g*x,e[15]=o*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=x,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=a*r*k+i*y,N=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,F=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*S+d*B+o*N,e[1]=M*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=b*S+V*B+g*N,e[4]=l*p+d*Y+o*F,e[5]=M*p+m*Y+R*F,e[6]=h*p+x*Y+z*F,e[7]=b*p+V*Y+g*F,e[8]=l*P+d*Q+o*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,x=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+x,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2/k,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(D,H)[0]=(i*a+L*n+c*r-y*s)*2,E(D,H)[1]=(c*a+L*s+y*n-i*r)*2,E(D,H)[2]=(y*a+L*r+i*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*i,o=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,S=r*L-a*y,B=k*d-l*b,N=k*m-M*b,p=k*x-h*b,Y=l*m-M*d,F=l*x-h*d,P=M*x-h*m,Q=V*P-o*F+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*F+L*Y)*Q,e[1]=(y*p-i*P-L*N)*Q,e[2]=(i*F-c*p+L*B)*Q,e[3]=0,e[4]=(r*F-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*N)*Q,e[6]=(s*p-n*F-a*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-b*S-x*o)*Q,e[10]=(b*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,x=a*b,V=i*d,o=c*h,R=y*b,z=L*d,g=k*h,S=l*b,B=M*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,F=(h+R)*z,P=(b-o)*z,Q=(h-R)*g,K=(1-(M+x))*g,ee=(m+V)*g,te=(b+o)*S,Me=(m-V)*S,be=(1-(M+d))*S;return e[0]=Y,e[1]=F,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(F*B+K*N+Me*p),e[14]=n[2]+p-(P*B+ee*N+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,x=a*y;return e[0]=1-l-b,e[1]=k+x,e[2]=M-m,e[3]=0,e[4]=k-x,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return D.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let x=y*d-L*b,V=L*h-c*d,o=c*b-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=b*o-d*V,z=d*x-h*o,g=h*V-b*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*a+o*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],F=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,H=new WeakMap,Z(D,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float32Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],x=t[7];return e[4]=b*L+x*i+d*y-m*c,e[5]=d*L+x*c+m*i-b*y,e[6]=m*L+x*y+b*c-d*i,e[7]=x*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+i*d+r*x-a*m,e[1]=r*V+i*m+a*d-s*x,e[2]=a*V+i*x+s*m-r*d,e[3]=i*V-s*d-r*m-a*x,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*x-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*x,e[6]=a*k+i*L+s*y-r*c+h*V+b*x+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var I=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};I.prototype.sub=I.prototype.subtract;I.prototype.mul=I.prototype.multiply;I.prototype.div=I.prototype.divide;I.prototype.dist=I.prototype.distance;I.prototype.sqrDist=I.prototype.squaredDistance;I.sub=I.subtract;I.mul=I.multiply;I.div=I.divide;I.dist=I.distance;I.sqrDist=I.squaredDistance;I.sqrLen=I.squaredLength;I.mag=I.magnitude;I.length=I.magnitude;I.len=I.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new I(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let a=s(r);Object.defineProperty(I.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*oe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,I as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,I as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAoF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAArEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;EAAAF,QAAAA,CAAA,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;EAAA,OAAA;QACb,QAAOF,CAAA,CAAOD,MAAA;UACZ,KAAK,CAAA;EACHJ,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA,CAAA,GAAMO,CAAM,CAAA,CAAA,CAAA;EAAG,UAAA,MAAA;UACjB,KAAK,CAAA;EACHL,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA,CAAA,EAAMO,CAAAA,CAAA,CAAO,CAAC,CAAsBA,EAAAA,CAAA,CAAO,CAAC,GAAG,CAAC,CAAA,CAAA,CAAA;EAAG,UAAA,MAAA;UACrD,KAAK,CAAA;EACH,UAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float32Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-a*Y)*Q,e[2]=(d*B-m*g+o*z)*Q,e[3]=(M*g-l*B-h*z)*Q,e[4]=(y*p-i*P-L*F)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(m*R-b*B-o*x)*Q,e[7]=(k*B-M*R+h*x)*Q,e[8]=(i*I-c*p+L*D)*Q,e[9]=(s*p-n*I-a*D)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*F-i*Y-y*D)*Q,e[13]=(n*Y-s*F+r*D)*Q,e[14]=(d*x-b*z-m*V)*Q,e[15]=(k*z-l*x+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-a*Y,e[2]=d*B-m*g+o*z,e[3]=M*g-l*B-h*z,e[4]=y*p-i*P-L*F,e[5]=n*P-r*p+a*F,e[6]=m*R-b*B-o*x,e[7]=k*B-M*R+h*x,e[8]=i*I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float32Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*xe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,N as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAmF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAApEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;EAAAF,QAAAA,CAAA,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;EAAA,OAAA;QACb,QAAQF,CAAA,CAAOD,MAAA;UACb,KAAK,CAAA;EACHJ,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.js b/dist-cdn/umd/gl-matrix-f64.js index 91be7c40..288a2c3a 100644 --- a/dist-cdn/umd/gl-matrix-f64.js +++ b/dist-cdn/umd/gl-matrix-f64.js @@ -183,9 +183,9 @@ } return _assertThisInitialized(_this); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2.str(this);` @@ -198,9 +198,9 @@ get: function get() { return _Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. * @@ -249,6 +249,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} * Equivalent to `Mat2.transpose(this, this);` @@ -299,9 +300,9 @@ value: function rotate(rad) { return _Mat2.rotate(this, this, rad); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -312,9 +313,9 @@ get: function get() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} * @category Static @@ -432,7 +433,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -522,6 +523,7 @@ * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -557,6 +559,7 @@ * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -813,9 +816,9 @@ } return _assertThisInitialized(_this2); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat2d.str(this);` @@ -828,9 +831,9 @@ get: function get() { return _Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. * @category Methods @@ -881,6 +884,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector * Equivalent to `Mat2d.translate(this, this, v);` @@ -920,9 +924,9 @@ value: function scale(v) { return _Mat2d.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -933,9 +937,9 @@ get: function get() { return 6 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} * @category Static @@ -1036,7 +1040,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -1116,6 +1120,7 @@ * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -1157,6 +1162,7 @@ * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -1250,9 +1256,10 @@ /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1273,9 +1280,10 @@ /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1298,9 +1306,10 @@ /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -1372,7 +1381,7 @@ return out; } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -1385,7 +1394,7 @@ 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]; } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1464,9 +1473,9 @@ } return _assertThisInitialized(_this3); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat3.str(this);` @@ -1479,9 +1488,9 @@ get: function get() { return _Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. * @category Methods @@ -1532,6 +1541,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} * Equivalent to `Mat3.transpose(this, this);` @@ -1595,9 +1605,9 @@ value: function scale(v) { return _Mat3.scale(this, this, v); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -1608,9 +1618,9 @@ get: function get() { return 9 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} * @category Static @@ -1754,7 +1764,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -1889,6 +1899,7 @@ * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -1939,6 +1950,7 @@ * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -2040,9 +2052,10 @@ /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -2094,9 +2107,10 @@ /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -2207,7 +2221,7 @@ * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "normalFromMat4", @@ -2373,7 +2387,7 @@ return out; } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2386,7 +2400,7 @@ 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]; } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2472,9 +2486,9 @@ } return _assertThisInitialized(_this4); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Mat4.str(this);` @@ -2487,9 +2501,9 @@ get: function get() { return _Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. * @category Methods @@ -2538,6 +2552,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} * Equivalent to `Mat4.transpose(this, this);` @@ -2719,9 +2734,9 @@ value: function orthoZO(left, right, bottom, top, near, far) { return _Mat4.orthoZO(this, left, right, bottom, top, near, far); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -2732,9 +2747,9 @@ get: function get() { return 16 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} * @category Static @@ -2915,7 +2930,7 @@ * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "invert", @@ -3132,6 +3147,7 @@ * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -3419,9 +3435,10 @@ /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3452,9 +3469,10 @@ /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3485,9 +3503,10 @@ /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -3533,9 +3552,10 @@ /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3568,9 +3588,10 @@ /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3603,9 +3624,10 @@ /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3638,12 +3660,13 @@ /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -3726,7 +3749,7 @@ * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ }, { key: "normalFromMat4", @@ -4000,13 +4023,14 @@ /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -4056,17 +4080,18 @@ return out; } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -4229,6 +4254,7 @@ value: function frustum(out, left, right, bottom, top, near) { return out; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], @@ -4323,6 +4349,7 @@ * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "perspective", value: function perspective(out, fovy, aspect, near) { @@ -4372,9 +4399,8 @@ return out; } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4412,9 +4438,8 @@ return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4455,15 +4480,15 @@ * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "ortho", value: function ortho(out, left, right, bottom, top, near, far) { return out; } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4500,8 +4525,8 @@ return out; } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -4711,6 +4736,7 @@ * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -4778,7 +4804,7 @@ return out; } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -4791,7 +4817,7 @@ 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]; } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -4901,9 +4927,9 @@ } return _assertThisInitialized(_this5); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -5043,9 +5069,9 @@ get: function get() { return _Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. * @category Methods @@ -5100,6 +5126,7 @@ value: function sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. * Equivalent to `Vec3.multiply(this, this, b);` @@ -5125,6 +5152,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. * Equivalent to `Vec3.divide(this, this, b);` @@ -5150,6 +5178,7 @@ value: function div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec3.scale(this, this, b);` @@ -5205,6 +5234,7 @@ value: function dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. * Equivalent to `Vec3.squaredDistance(this, b);` @@ -5227,6 +5257,7 @@ value: function sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec3.negate(this, this);` @@ -5297,9 +5328,9 @@ value: function normalize() { return _Vec3.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -5310,9 +5341,9 @@ get: function get() { return 3 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 * @category Static @@ -5360,6 +5391,7 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -5368,12 +5400,13 @@ * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -5384,6 +5417,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values * @category Static @@ -5470,6 +5504,7 @@ * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -5496,6 +5531,7 @@ * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -5522,6 +5558,7 @@ * Alias for {@link Vec3.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "div", value: function div(out, a, b) { @@ -5601,7 +5638,8 @@ * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -5662,6 +5700,7 @@ * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dist", value: function dist(a, b) { @@ -5687,6 +5726,7 @@ * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrDist", value: function sqrDist(a, b) { @@ -5711,6 +5751,7 @@ * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrLen", value: function sqrLen(a, b) { @@ -5926,7 +5967,8 @@ * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -6126,7 +6168,7 @@ return "Vec3(".concat(a.join(", "), ")"); } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -6139,7 +6181,7 @@ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -6210,9 +6252,9 @@ } return _assertThisInitialized(_this6); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -6353,9 +6395,9 @@ get: function get() { return _Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. * @category Methods @@ -6412,6 +6454,7 @@ value: function sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. * Equivalent to `Vec4.multiply(this, this, b);` @@ -6438,6 +6481,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. * Equivalent to `Vec4.divide(this, this, b);` @@ -6464,6 +6508,7 @@ value: function div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec4.scale(this, this, b);` @@ -6521,6 +6566,7 @@ value: function dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. * Equivalent to `Vec4.squaredDistance(this, b);` @@ -6543,6 +6589,7 @@ value: function sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec4.negate(this, this);` @@ -6616,9 +6663,9 @@ value: function normalize() { return _Vec4.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -6629,9 +6676,9 @@ get: function get() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} * @category Static @@ -6747,6 +6794,7 @@ * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -6774,6 +6822,7 @@ * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -6801,6 +6850,7 @@ * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "div", value: function div(out, a, b) { @@ -6951,6 +7001,7 @@ * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dist", value: function dist(a, b) { @@ -6977,6 +7028,7 @@ * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrDist", value: function sqrDist(a, b) { @@ -7007,17 +7059,19 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static @@ -7028,6 +7082,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} * @category Static @@ -7053,6 +7108,7 @@ value: function sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} * @category Static @@ -7202,7 +7258,8 @@ * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -7308,7 +7365,7 @@ return "Vec4(".concat(a.join(", "), ")"); } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -7321,7 +7378,7 @@ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -7396,9 +7453,9 @@ } return _assertThisInitialized(_this7); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -7489,9 +7546,9 @@ get: function get() { return _Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. * @category Methods @@ -7543,6 +7600,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis * Equivalent to `Quat.rotateX(this, this, rad);` @@ -7624,9 +7682,9 @@ value: function dot(b) { return _Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -7637,9 +7695,9 @@ get: function get() { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat * @category Static @@ -7680,7 +7738,7 @@ }, { key: "setAxisAngle", value: function setAxisAngle(out, axis, rad) { - rad = rad * 0.5; + rad *= 0.5; var s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -7692,7 +7750,7 @@ * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -7734,7 +7792,7 @@ return Math.acos(2 * dotproduct * dotproduct - 1); } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -7973,7 +8031,7 @@ * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -8014,7 +8072,7 @@ } /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -8034,7 +8092,7 @@ * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -8055,8 +8113,12 @@ out[2] = (m[1] - m[3]) * fRoot; } else { var i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } var j = (i + 1) % 3; var k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); @@ -8131,7 +8193,7 @@ out[3] = cx * cy * cz + sx * sy * sz; break; default: - throw new Error("Unknown angle order " + order); + throw new Error("Unknown angle order ".concat(order)); } return out; } @@ -8202,6 +8264,7 @@ * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "set", value: function set(out, x, y, z, w) { @@ -8216,6 +8279,7 @@ * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "add", value: function add(out, a, b) { @@ -8225,6 +8289,7 @@ * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -8271,6 +8336,7 @@ * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "lerp", value: function lerp(out, a, b, t) { @@ -8283,6 +8349,7 @@ * @param a - quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "magnitude", value: function magnitude(a) { @@ -8292,6 +8359,7 @@ * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mag", value: function mag(a) { @@ -8302,12 +8370,13 @@ * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static @@ -8318,6 +8387,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} * @category Static @@ -8325,6 +8395,7 @@ * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "squaredLength", value: function squaredLength(a) { @@ -8339,6 +8410,7 @@ value: function sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} * @category Static @@ -8347,32 +8419,35 @@ * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "normalize", value: function normalize(out, a) { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "exactEquals", value: function exactEquals(a, b) { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "equals", value: function equals(a, b) { @@ -8396,7 +8471,9 @@ var dot = Vec3.dot(a, b); if (dot < -0.999999) { Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a); - if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) { + Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a); + } Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32)); _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI); return out; @@ -8533,9 +8610,9 @@ } return _assertThisInitialized(_this8); } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` * Equivalent to `Quat2.str(this);` @@ -8548,9 +8625,9 @@ get: function get() { return _Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. * @category Methods @@ -8564,9 +8641,9 @@ _get(_getPrototypeOf(_Quat2.prototype), "set", this).call(this, a); return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -8577,9 +8654,9 @@ get: function get() { return 8 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} * @category Static @@ -9113,7 +9190,7 @@ return _Quat2.copy(out, a); } var axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; var s = Math.sin(rad); var bx = s * axis[0] / axisLength; var by = s * axis[1] / axisLength; @@ -9201,6 +9278,7 @@ * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -9236,6 +9314,7 @@ * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dot", value: function dot(a, b) { @@ -9256,7 +9335,9 @@ key: "lerp", value: function lerp(out, a, b, t) { var mt = 1 - t; - if (_Quat2.dot(a, b) < 0) t = -t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; out[2] = a[2] * mt + b[2] * t; @@ -9290,8 +9371,8 @@ return out; } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -9318,6 +9399,7 @@ * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "magnitude", value: function magnitude(a) { @@ -9332,17 +9414,19 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static @@ -9353,6 +9437,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} * @category Static @@ -9360,6 +9445,7 @@ * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "squaredLength", value: function squaredLength(a) { @@ -9374,6 +9460,7 @@ value: function sqrLen(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} * @category Static @@ -9421,7 +9508,7 @@ return "Quat2(".concat(a.join(", "), ")"); } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -9434,7 +9521,7 @@ 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]; } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -9516,9 +9603,9 @@ } return _assertThisInitialized(_this9); } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. /** @@ -9630,9 +9717,9 @@ get: function get() { return _Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. * @category Methods @@ -9686,6 +9773,7 @@ value: function sub(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. * Equivalent to `Vec2.multiply(this, this, b);` @@ -9710,6 +9798,7 @@ value: function mul(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. * Equivalent to `Vec2.divide(this, this, b);` @@ -9734,6 +9823,7 @@ value: function div(b) { return this; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. * Equivalent to `Vec2.scale(this, this, b);` @@ -9787,6 +9877,7 @@ value: function dist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. * Equivalent to `Vec2.squaredDistance(this, b);` @@ -9809,6 +9900,7 @@ value: function sqrDist(b) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. * Equivalent to `Vec2.negate(this, this);` @@ -9876,9 +9968,9 @@ value: function normalize() { return _Vec2.normalize(this, this); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static * @@ -9889,9 +9981,9 @@ get: function get() { return 2 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} * @category Static @@ -9995,6 +10087,7 @@ * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sub", value: function sub(out, a, b) { @@ -10020,6 +10113,7 @@ * Alias for {@link Vec2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "mul", value: function mul(out, a, b) { @@ -10045,6 +10139,7 @@ * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "div", value: function div(out, a, b) { @@ -10177,6 +10272,7 @@ * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "dist", value: function dist(a, b) { @@ -10201,6 +10297,7 @@ * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrDist", value: function sqrDist(a, b) { @@ -10229,6 +10326,7 @@ value: function mag(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -10237,12 +10335,13 @@ * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length + // Length conflicts with Function.length }, { key: "length", value: function length(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec2.magnitude} * @category Static @@ -10253,6 +10352,7 @@ value: function len(a) { return 0; } + // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} * @category Static @@ -10271,6 +10371,7 @@ * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars }, { key: "sqrLen", value: function sqrLen(a, b) { @@ -10523,7 +10624,7 @@ return out; } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -10536,7 +10637,7 @@ return a[0] === b[0] && a[1] === b[1]; } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -10615,6 +10716,7 @@ return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; } + throw new Error("Illegal swizzle length"); } for (var _i = 0, _VEC2_SWIZZLES = VEC2_SWIZZLES; _i < _VEC2_SWIZZLES.length; _i++) { var swizzle = _VEC2_SWIZZLES[_i]; diff --git a/dist-cdn/umd/gl-matrix-f64.js.map b/dist-cdn/umd/gl-matrix-f64.js.map index 57dbdabe..a3d3f192 100644 --- a/dist-cdn/umd/gl-matrix-f64.js.map +++ b/dist-cdn/umd/gl-matrix-f64.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n //===================\n // Instance methods\n //===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertable\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n let magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertable\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /*static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n let j = (i + 1) % 3;\n let k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n let halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(\"Unknown angle order \" + order);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n let dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n //============\n // Accessors\n //============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad = rad * 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}\n * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n //============\n // Accessors\n //============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n //===================\n // Instances methods\n //===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n //===================\n // Static accessors\n //===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n //===================\n // Static methods\n //===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n let x = a[0];\n let y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // @ts-ignore: Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]);\n };\n case 4:\n return function() {\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\n };\n }\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAsB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.min.js b/dist-cdn/umd/gl-matrix-f64.min.js index 9d9d83ed..a76c8773 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.js +++ b/dist-cdn/umd/gl-matrix-f64.min.js @@ -135,11 +135,11 @@ var de = function de(A) { throw TypeError(A); }; - var xe = function xe(A, e, t) { + var oe = function oe(A, e, t) { return e.has(A) || de("Cannot " + t); }; var E = function E(A, e, t) { - return xe(A, e, "read from private field"), t ? t.call(A) : e.get(A); + return oe(A, e, "read from private field"), t ? t.call(A) : e.get(A); }, Z = function Z(A, e, t) { return e.has(A) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(A) : e.set(A, t); @@ -268,9 +268,9 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = n * i - r * s; - return a ? (a = 1 / a, e[0] = i * a, e[1] = -s * a, e[2] = -r * a, e[3] = n * a, e) : null; + a = t[3], + i = n * a - r * s; + return i ? (i = 1 / i, e[0] = a * i, e[1] = -s * i, e[2] = -r * i, e[3] = n * i, e) : null; } }, { key: "adjoint", @@ -303,13 +303,13 @@ value: function multiply(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = n[0], y = n[1], L = n[2], k = n[3]; - return e[0] = s * c + i * y, e[1] = r * c + a * y, e[2] = s * L + i * k, e[3] = r * L + a * k, e; + return e[0] = s * c + a * y, e[1] = r * c + i * y, e[2] = s * L + a * k, e[3] = r * L + i * k, e; } }, { key: "mul", @@ -321,22 +321,22 @@ value: function rotate(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = Math.sin(n), y = Math.cos(n); - return e[0] = s * y + i * c, e[1] = r * y + a * c, e[2] = s * -c + i * y, e[3] = r * -c + a * y, e; + return e[0] = s * y + a * c, e[1] = r * y + i * c, e[2] = s * -c + a * y, e[3] = r * -c + i * y, e; } }, { key: "scale", value: function scale(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = n[0], y = n[1]; - return e[0] = s * c, e[1] = r * c, e[2] = i * y, e[3] = a * y, e; + return e[0] = s * c, e[1] = r * c, e[2] = a * y, e[3] = i * y, e; } }, { key: "fromRotation", @@ -381,12 +381,12 @@ var n = e[0], s = e[1], r = e[2], - i = e[3], - a = t[0], + a = e[3], + i = t[0], c = t[1], y = t[2], L = t[3]; - return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(i - L) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(L)); + return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(a - L) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(L)); } }, { key: "str", @@ -401,35 +401,35 @@ v.mul = v.multiply; v.sub = v.subtract; var se, - $ = /*#__PURE__*/function (_Float64Array2) { - function $() { + H = /*#__PURE__*/function (_Float64Array2) { + function H() { var _this2; - _classCallCheck(this, $); + _classCallCheck(this, H); for (var _len3 = arguments.length, e = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { e[_key3] = arguments[_key3]; } switch (e.length) { case 6: - _this2 = _callSuper(this, $, [e]); + _this2 = _callSuper(this, H, [e]); break; case 2: - _this2 = _callSuper(this, $, [e[0], e[1], 6]); + _this2 = _callSuper(this, H, [e[0], e[1], 6]); break; case 1: var t = e[0]; - typeof t == "number" ? _this2 = _callSuper(this, $, [[t, t, t, t, t, t]]) : _this2 = _callSuper(this, $, [t, 0, 6]); + typeof t == "number" ? _this2 = _callSuper(this, H, [[t, t, t, t, t, t]]) : _this2 = _callSuper(this, H, [t, 0, 6]); break; default: - _this2 = _callSuper(this, $, [E($, se)]); + _this2 = _callSuper(this, H, [E(H, se)]); break; } return _assertThisInitialized(_this2); } - _inherits($, _Float64Array2); - return _createClass($, [{ + _inherits(H, _Float64Array2); + return _createClass(H, [{ key: "str", get: function get() { - return $.str(this); + return H.str(this); } }, { key: "copy", @@ -439,12 +439,12 @@ }, { key: "identity", value: function identity() { - return this.set(E($, se)), this; + return this.set(E(H, se)), this; } }, { key: "multiply", value: function multiply(e) { - return $.multiply(this, this, e); + return H.multiply(this, this, e); } }, { key: "mul", @@ -454,17 +454,17 @@ }, { key: "translate", value: function translate(e) { - return $.translate(this, this, e); + return H.translate(this, this, e); } }, { key: "rotate", value: function rotate(e) { - return $.rotate(this, this, e); + return H.rotate(this, this, e); } }, { key: "scale", value: function scale(e) { - return $.scale(this, this, e); + return H.scale(this, this, e); } }], [{ key: "BYTE_LENGTH", @@ -474,12 +474,12 @@ }, { key: "create", value: function create() { - return new $(); + return new H(); } }, { key: "clone", value: function clone(e) { - return new $(e); + return new H(e); } }, { key: "copy", @@ -492,7 +492,7 @@ for (var _len4 = arguments.length, e = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { e[_key4] = arguments[_key4]; } - return _construct($, e); + return _construct(H, e); } }, { key: "set", @@ -510,11 +510,11 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], - y = n * i - s * r; - return y ? (y = 1 / y, e[0] = i * y, e[1] = -s * y, e[2] = -r * y, e[3] = n * y, e[4] = (r * c - i * a) * y, e[5] = (s * a - n * c) * y, e) : null; + y = n * a - s * r; + return y ? (y = 1 / y, e[0] = a * y, e[1] = -s * y, e[2] = -r * y, e[3] = n * y, e[4] = (r * c - a * i) * y, e[5] = (s * i - n * c) * y, e) : null; } }, { key: "determinant", @@ -541,17 +541,17 @@ value: function multiply(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = n[0], k = n[1], l = n[2], - b = n[3], + M = n[3], h = n[4], - M = n[5]; - return e[0] = s * L + i * k, e[1] = r * L + a * k, e[2] = s * l + i * b, e[3] = r * l + a * b, e[4] = s * h + i * M + c, e[5] = r * h + a * M + y, e; + b = n[5]; + return e[0] = s * L + a * k, e[1] = r * L + i * k, e[2] = s * l + a * M, e[3] = r * l + i * M, e[4] = s * h + a * b + c, e[5] = r * h + i * b + y, e; } }, { key: "mul", @@ -563,39 +563,39 @@ value: function translate(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = n[0], k = n[1]; - return e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = s * L + i * k + c, e[5] = r * L + a * k + y, e; + return e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = s * L + a * k + c, e[5] = r * L + i * k + y, e; } }, { key: "rotate", value: function rotate(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = Math.sin(n), k = Math.cos(n); - return e[0] = s * k + i * L, e[1] = r * k + a * L, e[2] = s * -L + i * k, e[3] = r * -L + a * k, e[4] = c, e[5] = y, e; + return e[0] = s * k + a * L, e[1] = r * k + i * L, e[2] = s * -L + a * k, e[3] = r * -L + i * k, e[4] = c, e[5] = y, e; } }, { key: "scale", value: function scale(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = n[0], k = n[1]; - return e[0] = s * L, e[1] = r * L, e[2] = i * k, e[3] = a * k, e[4] = c, e[5] = y, e; + return e[0] = s * L, e[1] = r * L, e[2] = a * k, e[3] = i * k, e[4] = c, e[5] = y, e; } }, { key: "fromTranslation", @@ -640,16 +640,16 @@ var n = e[0], s = e[1], r = e[2], - i = e[3], - a = e[4], + a = e[3], + i = e[4], c = e[5], y = t[0], L = t[1], k = t[2], l = t[3], - b = t[4], + M = t[4], h = t[5]; - return Math.abs(n - y) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(y)) && Math.abs(s - L) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(L)) && Math.abs(r - k) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(k)) && Math.abs(i - l) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(l)) && Math.abs(a - b) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(c - h) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(h)); + return Math.abs(n - y) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(y)) && Math.abs(s - L) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(L)) && Math.abs(r - k) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(k)) && Math.abs(a - l) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(l)) && Math.abs(i - M) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(M)) && Math.abs(c - h) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(h)); } }, { key: "str", @@ -658,8 +658,8 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); - se = new WeakMap(), Z($, se, new Float64Array([1, 0, 0, 1, 0, 0])); - var _ = $; + se = new WeakMap(), Z(H, se, new Float64Array([1, 0, 0, 1, 0, 0])); + var _ = H; _.mul = _.multiply; _.sub = _.subtract; var re, @@ -793,17 +793,17 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], k = t[8], - l = k * a - c * L, - b = -k * i + c * y, - h = L * i - a * y, - M = n * l + s * b + r * h; - return M ? (M = 1 / M, e[0] = l * M, e[1] = (-k * s + r * L) * M, e[2] = (c * s - r * a) * M, e[3] = b * M, e[4] = (k * n - r * y) * M, e[5] = (-c * n + r * i) * M, e[6] = h * M, e[7] = (-L * n + s * y) * M, e[8] = (a * n - s * i) * M, e) : null; + l = k * i - c * L, + M = -k * a + c * y, + h = L * a - i * y, + b = n * l + s * M + r * h; + return b ? (b = 1 / b, e[0] = l * b, e[1] = (-k * s + r * L) * b, e[2] = (c * s - r * i) * b, e[3] = M * b, e[4] = (k * n - r * y) * b, e[5] = (-c * n + r * a) * b, e[6] = h * b, e[7] = (-L * n + s * y) * b, e[8] = (i * n - s * a) * b, e) : null; } }, { key: "adjoint", @@ -811,13 +811,13 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], k = t[8]; - return e[0] = a * k - c * L, e[1] = r * L - s * k, e[2] = s * c - r * a, e[3] = c * y - i * k, e[4] = n * k - r * y, e[5] = r * i - n * c, e[6] = i * L - a * y, e[7] = s * y - n * L, e[8] = n * a - s * i, e; + return e[0] = i * k - c * L, e[1] = r * L - s * k, e[2] = s * c - r * i, e[3] = c * y - a * k, e[4] = n * k - r * y, e[5] = r * a - n * c, e[6] = a * L - i * y, e[7] = s * y - n * L, e[8] = n * i - s * a, e; } }, { key: "determinant", @@ -826,12 +826,12 @@ n = e[1], s = e[2], r = e[3], - i = e[4], - a = e[5], + a = e[4], + i = e[5], c = e[6], y = e[7], L = e[8]; - return t * (L * i - a * y) + n * (-L * r + a * c) + s * (y * r - i * c); + return t * (L * a - i * y) + n * (-L * r + i * c) + s * (y * r - a * c); } }, { key: "add", @@ -853,17 +853,17 @@ value: function multiply(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], l = t[8], - b = n[0], + M = n[0], h = n[1], - M = n[2]; - return e[0] = b * s + h * a + M * L, e[1] = b * r + h * c + M * k, e[2] = b * i + h * y + M * l, b = n[3], h = n[4], M = n[5], e[3] = b * s + h * a + M * L, e[4] = b * r + h * c + M * k, e[5] = b * i + h * y + M * l, b = n[6], h = n[7], M = n[8], e[6] = b * s + h * a + M * L, e[7] = b * r + h * c + M * k, e[8] = b * i + h * y + M * l, e; + b = n[2]; + return e[0] = M * s + h * i + b * L, e[1] = M * r + h * c + b * k, e[2] = M * a + h * y + b * l, M = n[3], h = n[4], b = n[5], e[3] = M * s + h * i + b * L, e[4] = M * r + h * c + b * k, e[5] = M * a + h * y + b * l, M = n[6], h = n[7], b = n[8], e[6] = M * s + h * i + b * L, e[7] = M * r + h * c + b * k, e[8] = M * a + h * y + b * l, e; } }, { key: "mul", @@ -875,32 +875,32 @@ value: function translate(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], l = t[8], - b = n[0], + M = n[0], h = n[1]; - return e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = c, e[5] = y, e[6] = b * s + h * a + L, e[7] = b * r + h * c + k, e[8] = b * i + h * y + l, e; + return e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = c, e[5] = y, e[6] = M * s + h * i + L, e[7] = M * r + h * c + k, e[8] = M * a + h * y + l, e; } }, { key: "rotate", value: function rotate(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], l = t[8], - b = Math.sin(n), + M = Math.sin(n), h = Math.cos(n); - return e[0] = h * s + b * a, e[1] = h * r + b * c, e[2] = h * i + b * y, e[3] = h * a - b * s, e[4] = h * c - b * r, e[5] = h * y - b * i, e[6] = L, e[7] = k, e[8] = l, e; + return e[0] = h * s + M * i, e[1] = h * r + M * c, e[2] = h * a + M * y, e[3] = h * i - M * s, e[4] = h * c - M * r, e[5] = h * y - M * a, e[6] = L, e[7] = k, e[8] = l, e; } }, { key: "scale", @@ -937,20 +937,20 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = n + n, + a = t[3], + i = n + n, c = s + s, y = r + r, - L = n * a, - k = s * a, + L = n * i, + k = s * i, l = s * c, - b = r * a, + M = r * i, h = r * c, - M = r * y, - d = i * a, - m = i * c, - x = i * y; - return e[0] = 1 - l - M, e[3] = k - x, e[6] = b + m, e[1] = k + x, e[4] = 1 - L - M, e[7] = h - d, e[2] = b - m, e[5] = h + d, e[8] = 1 - L - l, e; + b = r * y, + d = a * i, + m = a * c, + o = a * y; + return e[0] = 1 - l - b, e[3] = k - o, e[6] = M + m, e[1] = k + o, e[4] = 1 - L - b, e[7] = h - d, e[2] = M - m, e[5] = h + d, e[8] = 1 - L - l, e; } }, { key: "fromMat4", @@ -963,33 +963,33 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], k = t[8], l = t[9], - b = t[10], + M = t[10], h = t[11], - M = t[12], + b = t[12], d = t[13], m = t[14], - x = t[15], - V = n * c - s * a, - o = n * y - r * a, - R = n * L - i * a, + o = t[15], + V = n * c - s * i, + x = n * y - r * i, + R = n * L - a * i, z = s * y - r * c, - g = s * L - i * c, - S = r * L - i * y, - B = k * d - l * M, - N = k * m - b * M, - p = k * x - h * M, - Y = l * m - b * d, - I = l * x - h * d, - P = b * x - h * m, - Q = V * P - o * I + R * Y + z * p - g * N + S * B; - return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - a * P - L * N) * Q, e[2] = (a * I - c * p + L * B) * Q, e[3] = (r * I - s * P - i * Y) * Q, e[4] = (n * P - r * p + i * N) * Q, e[5] = (s * p - n * I - i * B) * Q, e[6] = (d * S - m * g + x * z) * Q, e[7] = (m * R - M * S - x * o) * Q, e[8] = (M * g - d * R + x * V) * Q, e) : null; + g = s * L - a * c, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, + Y = l * m - M * d, + I = l * o - h * d, + P = M * o - h * m, + Q = V * P - x * I + R * Y + z * p - g * F + B * D; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - i * P - L * F) * Q, e[2] = (i * I - c * p + L * D) * Q, e[3] = (r * I - s * P - a * Y) * Q, e[4] = (n * P - r * p + a * F) * Q, e[5] = (s * p - n * I - a * D) * Q, e[6] = (d * B - m * g + o * z) * Q, e[7] = (m * R - b * B - o * x) * Q, e[8] = (b * g - d * R + o * V) * Q, e) : null; } }, { key: "normalFromMat4Fast", @@ -997,13 +997,13 @@ var n = t[0], s = t[1], r = t[2], - i = t[4], - a = t[5], + a = t[4], + i = t[5], c = t[6], y = t[8], L = t[9], k = t[10]; - return e[0] = a * k - k * L, e[1] = c * y - y * k, e[2] = i * L - L * y, e[3] = L * r - k * s, e[4] = k * n - y * r, e[5] = y * s - L * n, e[6] = s * c - r * a, e[7] = r * i - n * c, e[8] = n * a - s * i, e; + return e[0] = i * k - k * L, e[1] = c * y - y * k, e[2] = a * L - L * y, e[3] = L * r - k * s, e[4] = k * n - y * r, e[5] = y * s - L * n, e[6] = s * c - r * i, e[7] = r * a - n * c, e[8] = n * i - s * a, e; } }, { key: "projection", @@ -1036,22 +1036,22 @@ var n = e[0], s = e[1], r = e[2], - i = e[3], - a = e[4], + a = e[3], + i = e[4], c = e[5], y = e[6], L = e[7], k = e[8], l = t[0], - b = t[1], + M = t[1], h = t[2], - M = t[3], + b = t[3], d = t[4], m = t[5], - x = t[6], + o = t[6], V = t[7], - o = t[8]; - return Math.abs(n - l) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(l)) && Math.abs(s - b) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(b)) && Math.abs(r - h) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(h)) && Math.abs(i - M) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(M)) && Math.abs(a - d) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(d)) && Math.abs(c - m) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(y - x) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(x)) && Math.abs(L - V) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(V)) && Math.abs(k - o) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(o)); + x = t[8]; + return Math.abs(n - l) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(l)) && Math.abs(s - M) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(M)) && Math.abs(r - h) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(h)) && Math.abs(a - b) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(i - d) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(d)) && Math.abs(c - m) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(y - o) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(o)) && Math.abs(L - V) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(V)) && Math.abs(k - x) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(x)); } }, { key: "str", @@ -1065,37 +1065,37 @@ u.prototype.mul = u.prototype.multiply; u.mul = u.multiply; u.sub = u.subtract; - var ie, - H, - D = /*#__PURE__*/function (_Float64Array4) { - function D() { + var ae, + $, + S = /*#__PURE__*/function (_Float64Array4) { + function S() { var _this4; - _classCallCheck(this, D); + _classCallCheck(this, S); for (var _len7 = arguments.length, e = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { e[_key7] = arguments[_key7]; } switch (e.length) { case 16: - _this4 = _callSuper(this, D, [e]); + _this4 = _callSuper(this, S, [e]); break; case 2: - _this4 = _callSuper(this, D, [e[0], e[1], 16]); + _this4 = _callSuper(this, S, [e[0], e[1], 16]); break; case 1: var t = e[0]; - typeof t == "number" ? _this4 = _callSuper(this, D, [[t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]]) : _this4 = _callSuper(this, D, [t, 0, 16]); + typeof t == "number" ? _this4 = _callSuper(this, S, [[t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]]) : _this4 = _callSuper(this, S, [t, 0, 16]); break; default: - _this4 = _callSuper(this, D, [E(D, ie)]); + _this4 = _callSuper(this, S, [E(S, ae)]); break; } return _assertThisInitialized(_this4); } - _inherits(D, _Float64Array4); - return _createClass(D, [{ + _inherits(S, _Float64Array4); + return _createClass(S, [{ key: "str", get: function get() { - return D.str(this); + return S.str(this); } }, { key: "copy", @@ -1105,12 +1105,12 @@ }, { key: "identity", value: function identity() { - return this.set(E(D, ie)), this; + return this.set(E(S, ae)), this; } }, { key: "multiply", value: function multiply(e) { - return D.multiply(this, this, e); + return S.multiply(this, this, e); } }, { key: "mul", @@ -1120,62 +1120,62 @@ }, { key: "transpose", value: function transpose() { - return D.transpose(this, this); + return S.transpose(this, this); } }, { key: "invert", value: function invert() { - return D.invert(this, this); + return S.invert(this, this); } }, { key: "translate", value: function translate(e) { - return D.translate(this, this, e); + return S.translate(this, this, e); } }, { key: "rotate", value: function rotate(e, t) { - return D.rotate(this, this, e, t); + return S.rotate(this, this, e, t); } }, { key: "scale", value: function scale(e) { - return D.scale(this, this, e); + return S.scale(this, this, e); } }, { key: "rotateX", value: function rotateX(e) { - return D.rotateX(this, this, e); + return S.rotateX(this, this, e); } }, { key: "rotateY", value: function rotateY(e) { - return D.rotateY(this, this, e); + return S.rotateY(this, this, e); } }, { key: "rotateZ", value: function rotateZ(e) { - return D.rotateZ(this, this, e); + return S.rotateZ(this, this, e); } }, { key: "perspectiveNO", value: function perspectiveNO(e, t, n, s) { - return D.perspectiveNO(this, e, t, n, s); + return S.perspectiveNO(this, e, t, n, s); } }, { key: "perspectiveZO", value: function perspectiveZO(e, t, n, s) { - return D.perspectiveZO(this, e, t, n, s); + return S.perspectiveZO(this, e, t, n, s); } }, { key: "orthoNO", - value: function orthoNO(e, t, n, s, r, i) { - return D.orthoNO(this, e, t, n, s, r, i); + value: function orthoNO(e, t, n, s, r, a) { + return S.orthoNO(this, e, t, n, s, r, a); } }, { key: "orthoZO", - value: function orthoZO(e, t, n, s, r, i) { - return D.orthoZO(this, e, t, n, s, r, i); + value: function orthoZO(e, t, n, s, r, a) { + return S.orthoZO(this, e, t, n, s, r, a); } }], [{ key: "BYTE_LENGTH", @@ -1185,12 +1185,12 @@ }, { key: "create", value: function create() { - return new D(); + return new S(); } }, { key: "clone", value: function clone(e) { - return new D(e); + return new S(e); } }, { key: "copy", @@ -1203,7 +1203,7 @@ for (var _len8 = arguments.length, e = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { e[_key8] = arguments[_key8]; } - return _construct(D, e); + return _construct(S, e); } }, { key: "set", @@ -1222,10 +1222,10 @@ var n = t[1], s = t[2], r = t[3], - i = t[6], - a = t[7], + a = t[6], + i = t[7], c = t[11]; - e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = n, e[6] = t[9], e[7] = t[13], e[8] = s, e[9] = i, e[11] = t[14], e[12] = r, e[13] = a, e[14] = c; + e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = n, e[6] = t[9], e[7] = t[13], e[8] = s, e[9] = a, e[11] = t[14], e[12] = r, e[13] = i, e[14] = c; } else e[0] = t[0], e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = t[1], e[5] = t[5], e[6] = t[9], e[7] = t[13], e[8] = t[2], e[9] = t[6], e[10] = t[10], e[11] = t[14], e[12] = t[3], e[13] = t[7], e[14] = t[11], e[15] = t[15]; return e; } @@ -1235,33 +1235,33 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], k = t[8], l = t[9], - b = t[10], + M = t[10], h = t[11], - M = t[12], + b = t[12], d = t[13], m = t[14], - x = t[15], - V = n * c - s * a, - o = n * y - r * a, - R = n * L - i * a, + o = t[15], + V = n * c - s * i, + x = n * y - r * i, + R = n * L - a * i, z = s * y - r * c, - g = s * L - i * c, - S = r * L - i * y, - B = k * d - l * M, - N = k * m - b * M, - p = k * x - h * M, - Y = l * m - b * d, - I = l * x - h * d, - P = b * x - h * m, - Q = V * P - o * I + R * Y + z * p - g * N + S * B; - return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (r * I - s * P - i * Y) * Q, e[2] = (d * S - m * g + x * z) * Q, e[3] = (b * g - l * S - h * z) * Q, e[4] = (y * p - a * P - L * N) * Q, e[5] = (n * P - r * p + i * N) * Q, e[6] = (m * R - M * S - x * o) * Q, e[7] = (k * S - b * R + h * o) * Q, e[8] = (a * I - c * p + L * B) * Q, e[9] = (s * p - n * I - i * B) * Q, e[10] = (M * g - d * R + x * V) * Q, e[11] = (l * R - k * g - h * V) * Q, e[12] = (c * N - a * Y - y * B) * Q, e[13] = (n * Y - s * N + r * B) * Q, e[14] = (d * o - M * z - m * V) * Q, e[15] = (k * z - l * o + b * V) * Q, e) : null; + g = s * L - a * c, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, + Y = l * m - M * d, + I = l * o - h * d, + P = M * o - h * m, + Q = V * P - x * I + R * Y + z * p - g * F + B * D; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (r * I - s * P - a * Y) * Q, e[2] = (d * B - m * g + o * z) * Q, e[3] = (M * g - l * B - h * z) * Q, e[4] = (y * p - i * P - L * F) * Q, e[5] = (n * P - r * p + a * F) * Q, e[6] = (m * R - b * B - o * x) * Q, e[7] = (k * B - M * R + h * x) * Q, e[8] = (i * I - c * p + L * D) * Q, e[9] = (s * p - n * I - a * D) * Q, e[10] = (b * g - d * R + o * V) * Q, e[11] = (l * R - k * g - h * V) * Q, e[12] = (c * F - i * Y - y * D) * Q, e[13] = (n * Y - s * F + r * D) * Q, e[14] = (d * x - b * z - m * V) * Q, e[15] = (k * z - l * x + M * V) * Q, e) : null; } }, { key: "adjoint", @@ -1269,32 +1269,32 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], k = t[8], l = t[9], - b = t[10], + M = t[10], h = t[11], - M = t[12], + b = t[12], d = t[13], m = t[14], - x = t[15], - V = n * c - s * a, - o = n * y - r * a, - R = n * L - i * a, + o = t[15], + V = n * c - s * i, + x = n * y - r * i, + R = n * L - a * i, z = s * y - r * c, - g = s * L - i * c, - S = r * L - i * y, - B = k * d - l * M, - N = k * m - b * M, - p = k * x - h * M, - Y = l * m - b * d, - I = l * x - h * d, - P = b * x - h * m; - return e[0] = c * P - y * I + L * Y, e[1] = r * I - s * P - i * Y, e[2] = d * S - m * g + x * z, e[3] = b * g - l * S - h * z, e[4] = y * p - a * P - L * N, e[5] = n * P - r * p + i * N, e[6] = m * R - M * S - x * o, e[7] = k * S - b * R + h * o, e[8] = a * I - c * p + L * B, e[9] = s * p - n * I - i * B, e[10] = M * g - d * R + x * V, e[11] = l * R - k * g - h * V, e[12] = c * N - a * Y - y * B, e[13] = n * Y - s * N + r * B, e[14] = d * o - M * z - m * V, e[15] = k * z - l * o + b * V, e; + g = s * L - a * c, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, + Y = l * m - M * d, + I = l * o - h * d, + P = M * o - h * m; + return e[0] = c * P - y * I + L * Y, e[1] = r * I - s * P - a * Y, e[2] = d * B - m * g + o * z, e[3] = M * g - l * B - h * z, e[4] = y * p - i * P - L * F, e[5] = n * P - r * p + a * F, e[6] = m * R - b * B - o * x, e[7] = k * B - M * R + h * x, e[8] = i * I - c * p + L * D, e[9] = s * p - n * I - a * D, e[10] = b * g - d * R + o * V, e[11] = l * R - k * g - h * V, e[12] = c * F - i * Y - y * D, e[13] = n * Y - s * F + r * D, e[14] = d * x - b * z - m * V, e[15] = k * z - l * x + M * V, e; } }, { key: "determinant", @@ -1303,54 +1303,54 @@ n = e[1], s = e[2], r = e[3], - i = e[4], - a = e[5], + a = e[4], + i = e[5], c = e[6], y = e[7], L = e[8], k = e[9], l = e[10], - b = e[11], + M = e[11], h = e[12], - M = e[13], + b = e[13], d = e[14], m = e[15], - x = t * a - n * i, - V = t * c - s * i, - o = n * c - s * a, - R = L * M - k * h, + o = t * i - n * a, + V = t * c - s * a, + x = n * c - s * i, + R = L * b - k * h, z = L * d - l * h, - g = k * d - l * M, - S = t * g - n * z + s * R, - B = i * g - a * z + c * R, - N = L * o - k * V + l * x, - p = h * o - M * V + d * x; - return y * S - r * B + m * N - b * p; + g = k * d - l * b, + B = t * g - n * z + s * R, + D = a * g - i * z + c * R, + F = L * x - k * V + l * o, + p = h * x - b * V + d * o; + return y * B - r * D + m * F - M * p; } }, { key: "multiply", value: function multiply(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], l = t[8], - b = t[9], + M = t[9], h = t[10], - M = t[11], + b = t[11], d = t[12], m = t[13], - x = t[14], + o = t[14], V = t[15], - o = n[0], + x = n[0], R = n[1], z = n[2], g = n[3]; - return e[0] = o * s + R * c + z * l + g * d, e[1] = o * r + R * y + z * b + g * m, e[2] = o * i + R * L + z * h + g * x, e[3] = o * a + R * k + z * M + g * V, o = n[4], R = n[5], z = n[6], g = n[7], e[4] = o * s + R * c + z * l + g * d, e[5] = o * r + R * y + z * b + g * m, e[6] = o * i + R * L + z * h + g * x, e[7] = o * a + R * k + z * M + g * V, o = n[8], R = n[9], z = n[10], g = n[11], e[8] = o * s + R * c + z * l + g * d, e[9] = o * r + R * y + z * b + g * m, e[10] = o * i + R * L + z * h + g * x, e[11] = o * a + R * k + z * M + g * V, o = n[12], R = n[13], z = n[14], g = n[15], e[12] = o * s + R * c + z * l + g * d, e[13] = o * r + R * y + z * b + g * m, e[14] = o * i + R * L + z * h + g * x, e[15] = o * a + R * k + z * M + g * V, e; + return e[0] = x * s + R * c + z * l + g * d, e[1] = x * r + R * y + z * M + g * m, e[2] = x * a + R * L + z * h + g * o, e[3] = x * i + R * k + z * b + g * V, x = n[4], R = n[5], z = n[6], g = n[7], e[4] = x * s + R * c + z * l + g * d, e[5] = x * r + R * y + z * M + g * m, e[6] = x * a + R * L + z * h + g * o, e[7] = x * i + R * k + z * b + g * V, x = n[8], R = n[9], z = n[10], g = n[11], e[8] = x * s + R * c + z * l + g * d, e[9] = x * r + R * y + z * M + g * m, e[10] = x * a + R * L + z * h + g * o, e[11] = x * i + R * k + z * b + g * V, x = n[12], R = n[13], z = n[14], g = n[15], e[12] = x * s + R * c + z * l + g * d, e[13] = x * r + R * y + z * M + g * m, e[14] = x * a + R * L + z * h + g * o, e[15] = x * i + R * k + z * b + g * V, e; } }, { key: "mul", @@ -1362,21 +1362,21 @@ value: function translate(e, t, n) { var s = n[0], r = n[1], - i = n[2]; - if (t === e) e[12] = t[0] * s + t[4] * r + t[8] * i + t[12], e[13] = t[1] * s + t[5] * r + t[9] * i + t[13], e[14] = t[2] * s + t[6] * r + t[10] * i + t[14], e[15] = t[3] * s + t[7] * r + t[11] * i + t[15];else { - var a = t[0], + a = n[2]; + if (t === e) e[12] = t[0] * s + t[4] * r + t[8] * a + t[12], e[13] = t[1] * s + t[5] * r + t[9] * a + t[13], e[14] = t[2] * s + t[6] * r + t[10] * a + t[14], e[15] = t[3] * s + t[7] * r + t[11] * a + t[15];else { + var i = t[0], c = t[1], y = t[2], L = t[3], k = t[4], l = t[5], - b = t[6], + M = t[6], h = t[7], - M = t[8], + b = t[8], d = t[9], m = t[10], - x = t[11]; - e[0] = a, e[1] = c, e[2] = y, e[3] = L, e[4] = k, e[5] = l, e[6] = b, e[7] = h, e[8] = M, e[9] = d, e[10] = m, e[11] = x, e[12] = a * s + k * r + M * i + t[12], e[13] = c * s + l * r + d * i + t[13], e[14] = y * s + b * r + m * i + t[14], e[15] = L * s + h * r + x * i + t[15]; + o = t[11]; + e[0] = i, e[1] = c, e[2] = y, e[3] = L, e[4] = k, e[5] = l, e[6] = M, e[7] = h, e[8] = b, e[9] = d, e[10] = m, e[11] = o, e[12] = i * s + k * r + b * a + t[12], e[13] = c * s + l * r + d * a + t[13], e[14] = y * s + M * r + m * a + t[14], e[15] = L * s + h * r + o * a + t[15]; } return e; } @@ -1385,88 +1385,88 @@ value: function scale(e, t, n) { var s = n[0], r = n[1], - i = n[2]; - return e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s, e[3] = t[3] * s, e[4] = t[4] * r, e[5] = t[5] * r, e[6] = t[6] * r, e[7] = t[7] * r, e[8] = t[8] * i, e[9] = t[9] * i, e[10] = t[10] * i, e[11] = t[11] * i, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; + a = n[2]; + return e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s, e[3] = t[3] * s, e[4] = t[4] * r, e[5] = t[5] * r, e[6] = t[6] * r, e[7] = t[7] * r, e[8] = t[8] * a, e[9] = t[9] * a, e[10] = t[10] * a, e[11] = t[11] * a, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; } }, { key: "rotate", value: function rotate(e, t, n, s) { var r = s[0], - i = s[1], - a = s[2], - c = Math.sqrt(r * r + i * i + a * a); + a = s[1], + i = s[2], + c = Math.sqrt(r * r + a * a + i * i); if (c < 1e-6) return null; - c = 1 / c, r *= c, i *= c, a *= c; + c = 1 / c, r *= c, a *= c, i *= c; var y = Math.sin(n), L = Math.cos(n), k = 1 - L, l = t[0], - b = t[1], + M = t[1], h = t[2], - M = t[3], + b = t[3], d = t[4], m = t[5], - x = t[6], + o = t[6], V = t[7], - o = t[8], + x = t[8], R = t[9], z = t[10], g = t[11], - S = r * r * k + L, - B = i * r * k + a * y, - N = a * r * k - i * y, - p = r * i * k - a * y, - Y = i * i * k + L, - I = a * i * k + r * y, - P = r * a * k + i * y, - Q = i * a * k - r * y, - K = a * a * k + L; - return e[0] = l * S + d * B + o * N, e[1] = b * S + m * B + R * N, e[2] = h * S + x * B + z * N, e[3] = M * S + V * B + g * N, e[4] = l * p + d * Y + o * I, e[5] = b * p + m * Y + R * I, e[6] = h * p + x * Y + z * I, e[7] = M * p + V * Y + g * I, e[8] = l * P + d * Q + o * K, e[9] = b * P + m * Q + R * K, e[10] = h * P + x * Q + z * K, e[11] = M * P + V * Q + g * K, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e; + B = r * r * k + L, + D = a * r * k + i * y, + F = i * r * k - a * y, + p = r * a * k - i * y, + Y = a * a * k + L, + I = i * a * k + r * y, + P = r * i * k + a * y, + Q = a * i * k - r * y, + K = i * i * k + L; + return e[0] = l * B + d * D + x * F, e[1] = M * B + m * D + R * F, e[2] = h * B + o * D + z * F, e[3] = b * B + V * D + g * F, e[4] = l * p + d * Y + x * I, e[5] = M * p + m * Y + R * I, e[6] = h * p + o * Y + z * I, e[7] = b * p + V * Y + g * I, e[8] = l * P + d * Q + x * K, e[9] = M * P + m * Q + R * K, e[10] = h * P + o * Q + z * K, e[11] = b * P + V * Q + g * K, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e; } }, { key: "rotateX", value: function rotateX(e, t, n) { var s = Math.sin(n), r = Math.cos(n), - i = t[4], - a = t[5], + a = t[4], + i = t[5], c = t[6], y = t[7], L = t[8], k = t[9], l = t[10], - b = t[11]; - return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = i * r + L * s, e[5] = a * r + k * s, e[6] = c * r + l * s, e[7] = y * r + b * s, e[8] = L * r - i * s, e[9] = k * r - a * s, e[10] = l * r - c * s, e[11] = b * r - y * s, e; + M = t[11]; + return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = a * r + L * s, e[5] = i * r + k * s, e[6] = c * r + l * s, e[7] = y * r + M * s, e[8] = L * r - a * s, e[9] = k * r - i * s, e[10] = l * r - c * s, e[11] = M * r - y * s, e; } }, { key: "rotateY", value: function rotateY(e, t, n) { var s = Math.sin(n), r = Math.cos(n), - i = t[0], - a = t[1], + a = t[0], + i = t[1], c = t[2], y = t[3], L = t[8], k = t[9], l = t[10], - b = t[11]; - return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = i * r - L * s, e[1] = a * r - k * s, e[2] = c * r - l * s, e[3] = y * r - b * s, e[8] = i * s + L * r, e[9] = a * s + k * r, e[10] = c * s + l * r, e[11] = y * s + b * r, e; + M = t[11]; + return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = a * r - L * s, e[1] = i * r - k * s, e[2] = c * r - l * s, e[3] = y * r - M * s, e[8] = a * s + L * r, e[9] = i * s + k * r, e[10] = c * s + l * r, e[11] = y * s + M * r, e; } }, { key: "rotateZ", value: function rotateZ(e, t, n) { var s = Math.sin(n), r = Math.cos(n), - i = t[0], - a = t[1], + a = t[0], + i = t[1], c = t[2], y = t[3], L = t[4], k = t[5], l = t[6], - b = t[7]; - return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = i * r + L * s, e[1] = a * r + k * s, e[2] = c * r + l * s, e[3] = y * r + b * s, e[4] = L * r - i * s, e[5] = k * r - a * s, e[6] = l * r - c * s, e[7] = b * r - y * s, e; + M = t[7]; + return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = a * r + L * s, e[1] = i * r + k * s, e[2] = c * r + l * s, e[3] = y * r + M * s, e[4] = L * r - a * s, e[5] = k * r - i * s, e[6] = l * r - c * s, e[7] = M * r - y * s, e; } }, { key: "fromTranslation", @@ -1483,14 +1483,14 @@ value: function fromRotation(e, t, n) { var s = n[0], r = n[1], - i = n[2], - a = Math.sqrt(s * s + r * r + i * i); - if (a < 1e-6) return null; - a = 1 / a, s *= a, r *= a, i *= a; + a = n[2], + i = Math.sqrt(s * s + r * r + a * a); + if (i < 1e-6) return null; + i = 1 / i, s *= i, r *= i, a *= i; var c = Math.sin(t), y = Math.cos(t), L = 1 - y; - return e[0] = s * s * L + y, e[1] = r * s * L + i * c, e[2] = i * s * L - r * c, e[3] = 0, e[4] = s * r * L - i * c, e[5] = r * r * L + y, e[6] = i * r * L + s * c, e[7] = 0, e[8] = s * i * L + r * c, e[9] = r * i * L - s * c, e[10] = i * i * L + y, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + return e[0] = s * s * L + y, e[1] = r * s * L + a * c, e[2] = a * s * L - r * c, e[3] = 0, e[4] = s * r * L - a * c, e[5] = r * r * L + y, e[6] = a * r * L + s * c, e[7] = 0, e[8] = s * a * L + r * c, e[9] = r * a * L - s * c, e[10] = a * a * L + y, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } }, { key: "fromXRotation", @@ -1518,21 +1518,21 @@ value: function fromRotationTranslation(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = s + s, y = r + r, - L = i + i, + L = a + a, k = s * c, l = s * y, - b = s * L, + M = s * L, h = r * y, - M = r * L, - d = i * L, - m = a * c, - x = a * y, - V = a * L; - return e[0] = 1 - (h + d), e[1] = l + V, e[2] = b - x, e[3] = 0, e[4] = l - V, e[5] = 1 - (k + d), e[6] = M + m, e[7] = 0, e[8] = b + x, e[9] = M - m, e[10] = 1 - (k + h), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + b = r * L, + d = a * L, + m = i * c, + o = i * y, + V = i * L; + return e[0] = 1 - (h + d), e[1] = l + V, e[2] = M - o, e[3] = 0, e[4] = l - V, e[5] = 1 - (k + d), e[6] = b + m, e[7] = 0, e[8] = M + o, e[9] = b - m, e[10] = 1 - (k + h), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; } }, { key: "fromQuat2", @@ -1540,13 +1540,13 @@ var n = -t[0], s = -t[1], r = -t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], - k = n * n + s * s + r * r + i * i; - return k > 0 ? (E(D, H)[0] = (a * i + L * n + c * r - y * s) * 2 / k, E(D, H)[1] = (c * i + L * s + y * n - a * r) * 2 / k, E(D, H)[2] = (y * i + L * r + a * s - c * n) * 2 / k) : (E(D, H)[0] = (a * i + L * n + c * r - y * s) * 2, E(D, H)[1] = (c * i + L * s + y * n - a * r) * 2, E(D, H)[2] = (y * i + L * r + a * s - c * n) * 2), D.fromRotationTranslation(e, t, E(D, H)), e; + k = n * n + s * s + r * r + a * a; + return k > 0 ? (E(S, $)[0] = (i * a + L * n + c * r - y * s) * 2 / k, E(S, $)[1] = (c * a + L * s + y * n - i * r) * 2 / k, E(S, $)[2] = (y * a + L * r + i * s - c * n) * 2 / k) : (E(S, $)[0] = (i * a + L * n + c * r - y * s) * 2, E(S, $)[1] = (c * a + L * s + y * n - i * r) * 2, E(S, $)[2] = (y * a + L * r + i * s - c * n) * 2), S.fromRotationTranslation(e, t, E(S, $)), e; } }, { key: "normalFromMat4", @@ -1554,33 +1554,33 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = t[4], + a = t[3], + i = t[4], c = t[5], y = t[6], L = t[7], k = t[8], l = t[9], - b = t[10], + M = t[10], h = t[11], - M = t[12], + b = t[12], d = t[13], m = t[14], - x = t[15], - V = n * c - s * a, - o = n * y - r * a, - R = n * L - i * a, + o = t[15], + V = n * c - s * i, + x = n * y - r * i, + R = n * L - a * i, z = s * y - r * c, - g = s * L - i * c, - S = r * L - i * y, - B = k * d - l * M, - N = k * m - b * M, - p = k * x - h * M, - Y = l * m - b * d, - I = l * x - h * d, - P = b * x - h * m, - Q = V * P - o * I + R * Y + z * p - g * N + S * B; - return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - a * P - L * N) * Q, e[2] = (a * I - c * p + L * B) * Q, e[3] = 0, e[4] = (r * I - s * P - i * Y) * Q, e[5] = (n * P - r * p + i * N) * Q, e[6] = (s * p - n * I - i * B) * Q, e[7] = 0, e[8] = (d * S - m * g + x * z) * Q, e[9] = (m * R - M * S - x * o) * Q, e[10] = (M * g - d * R + x * V) * Q, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e) : null; + g = s * L - a * c, + B = r * L - a * y, + D = k * d - l * b, + F = k * m - M * b, + p = k * o - h * b, + Y = l * m - M * d, + I = l * o - h * d, + P = M * o - h * m, + Q = V * P - x * I + R * Y + z * p - g * F + B * D; + return Q ? (Q = 1 / Q, e[0] = (c * P - y * I + L * Y) * Q, e[1] = (y * p - i * P - L * F) * Q, e[2] = (i * I - c * p + L * D) * Q, e[3] = 0, e[4] = (r * I - s * P - a * Y) * Q, e[5] = (n * P - r * p + a * F) * Q, e[6] = (s * p - n * I - a * D) * Q, e[7] = 0, e[8] = (d * B - m * g + o * z) * Q, e[9] = (m * R - b * B - o * x) * Q, e[10] = (b * g - d * R + o * V) * Q, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e) : null; } }, { key: "normalFromMat4Fast", @@ -1588,13 +1588,13 @@ var n = t[0], s = t[1], r = t[2], - i = t[4], - a = t[5], + a = t[4], + i = t[5], c = t[6], y = t[8], L = t[9], k = t[10]; - return e[0] = a * k - k * L, e[1] = c * y - y * k, e[2] = i * L - L * y, e[3] = 0, e[4] = L * r - k * s, e[5] = k * n - y * r, e[6] = y * s - L * n, e[7] = 0, e[8] = s * c - r * a, e[9] = r * i - n * c, e[10] = n * a - s * i, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + return e[0] = i * k - k * L, e[1] = c * y - y * k, e[2] = a * L - L * y, e[3] = 0, e[4] = L * r - k * s, e[5] = k * n - y * r, e[6] = y * s - L * n, e[7] = 0, e[8] = s * c - r * i, e[9] = r * a - n * c, e[10] = n * i - s * a, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } }, { key: "getTranslation", @@ -1607,123 +1607,123 @@ var n = t[0], s = t[1], r = t[2], - i = t[4], - a = t[5], + a = t[4], + i = t[5], c = t[6], y = t[8], L = t[9], k = t[10]; - return e[0] = Math.sqrt(n * n + s * s + r * r), e[1] = Math.sqrt(i * i + a * a + c * c), e[2] = Math.sqrt(y * y + L * L + k * k), e; + return e[0] = Math.sqrt(n * n + s * s + r * r), e[1] = Math.sqrt(a * a + i * i + c * c), e[2] = Math.sqrt(y * y + L * L + k * k), e; } }, { key: "getRotation", value: function getRotation(e, t) { - D.getScaling(E(D, H), t); - var n = 1 / E(D, H)[0], - s = 1 / E(D, H)[1], - r = 1 / E(D, H)[2], - i = t[0] * n, - a = t[1] * s, + S.getScaling(E(S, $), t); + var n = 1 / E(S, $)[0], + s = 1 / E(S, $)[1], + r = 1 / E(S, $)[2], + a = t[0] * n, + i = t[1] * s, c = t[2] * r, y = t[4] * n, L = t[5] * s, k = t[6] * r, l = t[8] * n, - b = t[9] * s, + M = t[9] * s, h = t[10] * r, - M = i + L + h, + b = a + L + h, d = 0; - return M > 0 ? (d = Math.sqrt(M + 1) * 2, e[3] = .25 * d, e[0] = (k - b) / d, e[1] = (l - c) / d, e[2] = (a - y) / d) : i > L && i > h ? (d = Math.sqrt(1 + i - L - h) * 2, e[3] = (k - b) / d, e[0] = .25 * d, e[1] = (a + y) / d, e[2] = (l + c) / d) : L > h ? (d = Math.sqrt(1 + L - i - h) * 2, e[3] = (l - c) / d, e[0] = (a + y) / d, e[1] = .25 * d, e[2] = (k + b) / d) : (d = Math.sqrt(1 + h - i - L) * 2, e[3] = (a - y) / d, e[0] = (l + c) / d, e[1] = (k + b) / d, e[2] = .25 * d), e; + return b > 0 ? (d = Math.sqrt(b + 1) * 2, e[3] = .25 * d, e[0] = (k - M) / d, e[1] = (l - c) / d, e[2] = (i - y) / d) : a > L && a > h ? (d = Math.sqrt(1 + a - L - h) * 2, e[3] = (k - M) / d, e[0] = .25 * d, e[1] = (i + y) / d, e[2] = (l + c) / d) : L > h ? (d = Math.sqrt(1 + L - a - h) * 2, e[3] = (l - c) / d, e[0] = (i + y) / d, e[1] = .25 * d, e[2] = (k + M) / d) : (d = Math.sqrt(1 + h - a - L) * 2, e[3] = (i - y) / d, e[0] = (l + c) / d, e[1] = (k + M) / d, e[2] = .25 * d), e; } }, { key: "decompose", value: function decompose(e, t, n, s) { t[0] = s[12], t[1] = s[13], t[2] = s[14]; var r = s[0], - i = s[1], - a = s[2], + a = s[1], + i = s[2], c = s[4], y = s[5], L = s[6], k = s[8], l = s[9], - b = s[10]; - n[0] = Math.sqrt(r * r + i * i + a * a), n[1] = Math.sqrt(c * c + y * y + L * L), n[2] = Math.sqrt(k * k + l * l + b * b); + M = s[10]; + n[0] = Math.sqrt(r * r + a * a + i * i), n[1] = Math.sqrt(c * c + y * y + L * L), n[2] = Math.sqrt(k * k + l * l + M * M); var h = 1 / n[0], - M = 1 / n[1], + b = 1 / n[1], d = 1 / n[2], m = r * h, - x = i * M, - V = a * d, - o = c * h, - R = y * M, + o = a * b, + V = i * d, + x = c * h, + R = y * b, z = L * d, g = k * h, - S = l * M, - B = b * d, - N = m + R + B, + B = l * b, + D = M * d, + F = m + R + D, p = 0; - return N > 0 ? (p = Math.sqrt(N + 1) * 2, e[3] = .25 * p, e[0] = (z - S) / p, e[1] = (g - V) / p, e[2] = (x - o) / p) : m > R && m > B ? (p = Math.sqrt(1 + m - R - B) * 2, e[3] = (z - S) / p, e[0] = .25 * p, e[1] = (x + o) / p, e[2] = (g + V) / p) : R > B ? (p = Math.sqrt(1 + R - m - B) * 2, e[3] = (g - V) / p, e[0] = (x + o) / p, e[1] = .25 * p, e[2] = (z + S) / p) : (p = Math.sqrt(1 + B - m - R) * 2, e[3] = (x - o) / p, e[0] = (g + V) / p, e[1] = (z + S) / p, e[2] = .25 * p), e; + return F > 0 ? (p = Math.sqrt(F + 1) * 2, e[3] = .25 * p, e[0] = (z - B) / p, e[1] = (g - V) / p, e[2] = (o - x) / p) : m > R && m > D ? (p = Math.sqrt(1 + m - R - D) * 2, e[3] = (z - B) / p, e[0] = .25 * p, e[1] = (o + x) / p, e[2] = (g + V) / p) : R > D ? (p = Math.sqrt(1 + R - m - D) * 2, e[3] = (g - V) / p, e[0] = (o + x) / p, e[1] = .25 * p, e[2] = (z + B) / p) : (p = Math.sqrt(1 + D - m - R) * 2, e[3] = (o - x) / p, e[0] = (g + V) / p, e[1] = (z + B) / p, e[2] = .25 * p), e; } }, { key: "fromRotationTranslationScale", value: function fromRotationTranslationScale(e, t, n, s) { var r = t[0], - i = t[1], - a = t[2], + a = t[1], + i = t[2], c = t[3], y = r + r, - L = i + i, - k = a + a, + L = a + a, + k = i + i, l = r * y, - b = r * L, + M = r * L, h = r * k, - M = i * L, - d = i * k, - m = a * k, - x = c * y, + b = a * L, + d = a * k, + m = i * k, + o = c * y, V = c * L, - o = c * k, + x = c * k, R = s[0], z = s[1], g = s[2]; - return e[0] = (1 - (M + m)) * R, e[1] = (b + o) * R, e[2] = (h - V) * R, e[3] = 0, e[4] = (b - o) * z, e[5] = (1 - (l + m)) * z, e[6] = (d + x) * z, e[7] = 0, e[8] = (h + V) * g, e[9] = (d - x) * g, e[10] = (1 - (l + M)) * g, e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; + return e[0] = (1 - (b + m)) * R, e[1] = (M + x) * R, e[2] = (h - V) * R, e[3] = 0, e[4] = (M - x) * z, e[5] = (1 - (l + m)) * z, e[6] = (d + o) * z, e[7] = 0, e[8] = (h + V) * g, e[9] = (d - o) * g, e[10] = (1 - (l + b)) * g, e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; } }, { key: "fromRotationTranslationScaleOrigin", value: function fromRotationTranslationScaleOrigin(e, t, n, s, r) { - var i = t[0], - a = t[1], + var a = t[0], + i = t[1], c = t[2], y = t[3], - L = i + i, - k = a + a, + L = a + a, + k = i + i, l = c + c, - b = i * L, - h = i * k, - M = i * l, - d = a * k, - m = a * l, - x = c * l, + M = a * L, + h = a * k, + b = a * l, + d = i * k, + m = i * l, + o = c * l, V = y * L, - o = y * k, + x = y * k, R = y * l, z = s[0], g = s[1], - S = s[2], - B = r[0], - N = r[1], + B = s[2], + D = r[0], + F = r[1], p = r[2], - Y = (1 - (d + x)) * z, + Y = (1 - (d + o)) * z, I = (h + R) * z, - P = (M - o) * z, + P = (b - x) * z, Q = (h - R) * g, - K = (1 - (b + x)) * g, + K = (1 - (M + o)) * g, ee = (m + V) * g, - te = (M + o) * S, - be = (m - V) * S, - Me = (1 - (b + d)) * S; - return e[0] = Y, e[1] = I, e[2] = P, e[3] = 0, e[4] = Q, e[5] = K, e[6] = ee, e[7] = 0, e[8] = te, e[9] = be, e[10] = Me, e[11] = 0, e[12] = n[0] + B - (Y * B + Q * N + te * p), e[13] = n[1] + N - (I * B + K * N + be * p), e[14] = n[2] + p - (P * B + ee * N + Me * p), e[15] = 1, e; + te = (b + x) * B, + Me = (m - V) * B, + be = (1 - (M + d)) * B; + return e[0] = Y, e[1] = I, e[2] = P, e[3] = 0, e[4] = Q, e[5] = K, e[6] = ee, e[7] = 0, e[8] = te, e[9] = Me, e[10] = be, e[11] = 0, e[12] = n[0] + D - (Y * D + Q * F + te * p), e[13] = n[1] + F - (I * D + K * F + Me * p), e[14] = n[2] + p - (P * D + ee * F + be * p), e[15] = 1, e; } }, { key: "fromQuat", @@ -1731,58 +1731,58 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = n + n, + a = t[3], + i = n + n, c = s + s, y = r + r, - L = n * a, - k = s * a, + L = n * i, + k = s * i, l = s * c, - b = r * a, + M = r * i, h = r * c, - M = r * y, - d = i * a, - m = i * c, - x = i * y; - return e[0] = 1 - l - M, e[1] = k + x, e[2] = b - m, e[3] = 0, e[4] = k - x, e[5] = 1 - L - M, e[6] = h + d, e[7] = 0, e[8] = b + m, e[9] = h - d, e[10] = 1 - L - l, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; + b = r * y, + d = a * i, + m = a * c, + o = a * y; + return e[0] = 1 - l - b, e[1] = k + o, e[2] = M - m, e[3] = 0, e[4] = k - o, e[5] = 1 - L - b, e[6] = h + d, e[7] = 0, e[8] = M + m, e[9] = h - d, e[10] = 1 - L - l, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } }, { key: "frustumNO", - value: function frustumNO(e, t, n, s, r, i) { - var a = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; + value: function frustumNO(e, t, n, s, r, a) { + var i = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; var c = 1 / (n - t), y = 1 / (r - s); - if (e[0] = i * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, a != null && a !== 1 / 0) { - var L = 1 / (i - a); - e[10] = (a + i) * L, e[14] = 2 * a * i * L; - } else e[10] = -1, e[14] = -2 * i; + if (e[0] = a * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, i != null && i !== 1 / 0) { + var L = 1 / (a - i); + e[10] = (i + a) * L, e[14] = 2 * i * a * L; + } else e[10] = -1, e[14] = -2 * a; return e; } }, { key: "frustum", - value: function frustum(e, t, n, s, r, i) { + value: function frustum(e, t, n, s, r, a) { return e; } }, { key: "frustumZO", - value: function frustumZO(e, t, n, s, r, i) { - var a = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; + value: function frustumZO(e, t, n, s, r, a) { + var i = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1 / 0; var c = 1 / (n - t), y = 1 / (r - s); - if (e[0] = i * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, a != null && a !== 1 / 0) { - var L = 1 / (i - a); - e[10] = a * L, e[14] = a * i * L; - } else e[10] = -1, e[14] = -i; + if (e[0] = a * 2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a * 2 * y, e[6] = 0, e[7] = 0, e[8] = (n + t) * c, e[9] = (r + s) * y, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, i != null && i !== 1 / 0) { + var L = 1 / (a - i); + e[10] = i * L, e[14] = i * a * L; + } else e[10] = -1, e[14] = -a; return e; } }, { key: "perspectiveNO", value: function perspectiveNO(e, t, n, s) { var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1 / 0; - var i = 1 / Math.tan(t / 2); - if (e[0] = i / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { - var a = 1 / (s - r); - e[10] = (r + s) * a, e[14] = 2 * r * s * a; + var a = 1 / Math.tan(t / 2); + if (e[0] = a / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { + var i = 1 / (s - r); + e[10] = (r + s) * i, e[14] = 2 * r * s * i; } else e[10] = -1, e[14] = -2 * s; return e; } @@ -1795,10 +1795,10 @@ key: "perspectiveZO", value: function perspectiveZO(e, t, n, s) { var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1 / 0; - var i = 1 / Math.tan(t / 2); - if (e[0] = i / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { - var a = 1 / (s - r); - e[10] = r * a, e[14] = r * s * a; + var a = 1 / Math.tan(t / 2); + if (e[0] = a / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0) { + var i = 1 / (s - r); + e[10] = r * i, e[14] = r * s * i; } else e[10] = -1, e[14] = -s; return e; } @@ -1806,79 +1806,79 @@ key: "perspectiveFromFieldOfView", value: function perspectiveFromFieldOfView(e, t, n, s) { var r = Math.tan(t.upDegrees * Math.PI / 180), - i = Math.tan(t.downDegrees * Math.PI / 180), - a = Math.tan(t.leftDegrees * Math.PI / 180), + a = Math.tan(t.downDegrees * Math.PI / 180), + i = Math.tan(t.leftDegrees * Math.PI / 180), c = Math.tan(t.rightDegrees * Math.PI / 180), - y = 2 / (a + c), - L = 2 / (r + i); - return e[0] = y, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = L, e[6] = 0, e[7] = 0, e[8] = -((a - c) * y * .5), e[9] = (r - i) * L * .5, e[10] = s / (n - s), e[11] = -1, e[12] = 0, e[13] = 0, e[14] = s * n / (n - s), e[15] = 0, e; + y = 2 / (i + c), + L = 2 / (r + a); + return e[0] = y, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = L, e[6] = 0, e[7] = 0, e[8] = -((i - c) * y * .5), e[9] = (r - a) * L * .5, e[10] = s / (n - s), e[11] = -1, e[12] = 0, e[13] = 0, e[14] = s * n / (n - s), e[15] = 0, e; } }, { key: "orthoNO", - value: function orthoNO(e, t, n, s, r, i, a) { + value: function orthoNO(e, t, n, s, r, a, i) { var c = 1 / (t - n), y = 1 / (s - r), - L = 1 / (i - a); - return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 2 * L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = (a + i) * L, e[15] = 1, e; + L = 1 / (a - i); + return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 2 * L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = (i + a) * L, e[15] = 1, e; } }, { key: "ortho", - value: function ortho(e, t, n, s, r, i, a) { + value: function ortho(e, t, n, s, r, a, i) { return e; } }, { key: "orthoZO", - value: function orthoZO(e, t, n, s, r, i, a) { + value: function orthoZO(e, t, n, s, r, a, i) { var c = 1 / (t - n), y = 1 / (s - r), - L = 1 / (i - a); - return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = i * L, e[15] = 1, e; + L = 1 / (a - i); + return e[0] = -2 * c, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * y, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = L, e[11] = 0, e[12] = (t + n) * c, e[13] = (r + s) * y, e[14] = a * L, e[15] = 1, e; } }, { key: "lookAt", value: function lookAt(e, t, n, s) { var r = t[0], - i = t[1], - a = t[2], + a = t[1], + i = t[2], c = s[0], y = s[1], L = s[2], k = n[0], l = n[1], - b = n[2]; - if (Math.abs(r - k) < 1e-6 && Math.abs(i - l) < 1e-6 && Math.abs(a - b) < 1e-6) return D.identity(e); + M = n[2]; + if (Math.abs(r - k) < 1e-6 && Math.abs(a - l) < 1e-6 && Math.abs(i - M) < 1e-6) return S.identity(e); var h = r - k, - M = i - l, - d = a - b, - m = 1 / Math.sqrt(h * h + M * M + d * d); - h *= m, M *= m, d *= m; - var x = y * d - L * M, + b = a - l, + d = i - M, + m = 1 / Math.sqrt(h * h + b * b + d * d); + h *= m, b *= m, d *= m; + var o = y * d - L * b, V = L * h - c * d, - o = c * M - y * h; - m = Math.sqrt(x * x + V * V + o * o), m ? (m = 1 / m, x *= m, V *= m, o *= m) : (x = 0, V = 0, o = 0); - var R = M * o - d * V, - z = d * x - h * o, - g = h * V - M * x; - return m = Math.sqrt(R * R + z * z + g * g), m ? (m = 1 / m, R *= m, z *= m, g *= m) : (R = 0, z = 0, g = 0), e[0] = x, e[1] = R, e[2] = h, e[3] = 0, e[4] = V, e[5] = z, e[6] = M, e[7] = 0, e[8] = o, e[9] = g, e[10] = d, e[11] = 0, e[12] = -(x * r + V * i + o * a), e[13] = -(R * r + z * i + g * a), e[14] = -(h * r + M * i + d * a), e[15] = 1, e; + x = c * b - y * h; + m = Math.sqrt(o * o + V * V + x * x), m ? (m = 1 / m, o *= m, V *= m, x *= m) : (o = 0, V = 0, x = 0); + var R = b * x - d * V, + z = d * o - h * x, + g = h * V - b * o; + return m = Math.sqrt(R * R + z * z + g * g), m ? (m = 1 / m, R *= m, z *= m, g *= m) : (R = 0, z = 0, g = 0), e[0] = o, e[1] = R, e[2] = h, e[3] = 0, e[4] = V, e[5] = z, e[6] = b, e[7] = 0, e[8] = x, e[9] = g, e[10] = d, e[11] = 0, e[12] = -(o * r + V * a + x * i), e[13] = -(R * r + z * a + g * i), e[14] = -(h * r + b * a + d * i), e[15] = 1, e; } }, { key: "targetTo", value: function targetTo(e, t, n, s) { var r = t[0], - i = t[1], - a = t[2], + a = t[1], + i = t[2], c = s[0], y = s[1], L = s[2], k = r - n[0], - l = i - n[1], - b = a - n[2], - h = k * k + l * l + b * b; - h > 0 && (h = 1 / Math.sqrt(h), k *= h, l *= h, b *= h); - var M = y * b - L * l, - d = L * k - c * b, + l = a - n[1], + M = i - n[2], + h = k * k + l * l + M * M; + h > 0 && (h = 1 / Math.sqrt(h), k *= h, l *= h, M *= h); + var b = y * M - L * l, + d = L * k - c * M, m = c * l - y * k; - return h = M * M + d * d + m * m, h > 0 && (h = 1 / Math.sqrt(h), M *= h, d *= h, m *= h), e[0] = M, e[1] = d, e[2] = m, e[3] = 0, e[4] = l * m - b * d, e[5] = b * M - k * m, e[6] = k * d - l * M, e[7] = 0, e[8] = k, e[9] = l, e[10] = b, e[11] = 0, e[12] = r, e[13] = i, e[14] = a, e[15] = 1, e; + return h = b * b + d * d + m * m, h > 0 && (h = 1 / Math.sqrt(h), b *= h, d *= h, m *= h), e[0] = b, e[1] = d, e[2] = m, e[3] = 0, e[4] = l * m - M * d, e[5] = M * b - k * m, e[6] = k * d - l * b, e[7] = 0, e[8] = k, e[9] = l, e[10] = M, e[11] = 0, e[12] = r, e[13] = a, e[14] = i, e[15] = 1, e; } }, { key: "frob", @@ -1921,27 +1921,27 @@ var n = e[0], s = e[1], r = e[2], - i = e[3], - a = e[4], + a = e[3], + i = e[4], c = e[5], y = e[6], L = e[7], k = e[8], l = e[9], - b = e[10], + M = e[10], h = e[11], - M = e[12], + b = e[12], d = e[13], m = e[14], - x = e[15], + o = e[15], V = t[0], - o = t[1], + x = t[1], R = t[2], z = t[3], g = t[4], - S = t[5], - B = t[6], - N = t[7], + B = t[5], + D = t[6], + F = t[7], p = t[8], Y = t[9], I = t[10], @@ -1950,7 +1950,7 @@ K = t[13], ee = t[14], te = t[15]; - return Math.abs(n - V) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(V)) && Math.abs(s - o) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(o)) && Math.abs(r - R) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(R)) && Math.abs(i - z) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(z)) && Math.abs(a - g) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(g)) && Math.abs(c - S) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(S)) && Math.abs(y - B) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(B)) && Math.abs(L - N) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(N)) && Math.abs(k - p) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(p)) && Math.abs(l - Y) <= 1e-6 * Math.max(1, Math.abs(l), Math.abs(Y)) && Math.abs(b - I) <= 1e-6 * Math.max(1, Math.abs(b), Math.abs(I)) && Math.abs(h - P) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(P)) && Math.abs(M - Q) <= 1e-6 * Math.max(1, Math.abs(M), Math.abs(Q)) && Math.abs(d - K) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(K)) && Math.abs(m - ee) <= 1e-6 * Math.max(1, Math.abs(m), Math.abs(ee)) && Math.abs(x - te) <= 1e-6 * Math.max(1, Math.abs(x), Math.abs(te)); + return Math.abs(n - V) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(V)) && Math.abs(s - x) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(x)) && Math.abs(r - R) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(R)) && Math.abs(a - z) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(z)) && Math.abs(i - g) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(g)) && Math.abs(c - B) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(B)) && Math.abs(y - D) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(D)) && Math.abs(L - F) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(F)) && Math.abs(k - p) <= 1e-6 * Math.max(1, Math.abs(k), Math.abs(p)) && Math.abs(l - Y) <= 1e-6 * Math.max(1, Math.abs(l), Math.abs(Y)) && Math.abs(M - I) <= 1e-6 * Math.max(1, Math.abs(M), Math.abs(I)) && Math.abs(h - P) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(P)) && Math.abs(b - Q) <= 1e-6 * Math.max(1, Math.abs(b), Math.abs(Q)) && Math.abs(d - K) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(K)) && Math.abs(m - ee) <= 1e-6 * Math.max(1, Math.abs(m), Math.abs(ee)) && Math.abs(o - te) <= 1e-6 * Math.max(1, Math.abs(o), Math.abs(te)); } }, { key: "str", @@ -1959,8 +1959,8 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); - ie = new WeakMap(), H = new WeakMap(), Z(D, ie, new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(D, H, new Float64Array(3)); - var G = D; + ae = new WeakMap(), $ = new WeakMap(), Z(S, ae, new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(S, $, new Float64Array(3)); + var G = S; G.prototype.mul = G.prototype.multiply; G.sub = G.subtract; G.mul = G.multiply; @@ -2346,8 +2346,8 @@ var n = t[0], s = t[1], r = t[2], - i = n * n + s * s + r * r; - return i > 0 && (i = 1 / Math.sqrt(i)), e[0] = t[0] * i, e[1] = t[1] * i, e[2] = t[2] * i, e; + a = n * n + s * s + r * r; + return a > 0 && (a = 1 / Math.sqrt(a)), e[0] = t[0] * a, e[1] = t[1] * a, e[2] = t[2] * a, e; } }, { key: "dot", @@ -2359,112 +2359,112 @@ value: function cross(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = n[0], + a = t[2], + i = n[0], c = n[1], y = n[2]; - return e[0] = r * y - i * c, e[1] = i * a - s * y, e[2] = s * c - r * a, e; + return e[0] = r * y - a * c, e[1] = a * i - s * y, e[2] = s * c - r * i, e; } }, { key: "lerp", value: function lerp(e, t, n, s) { var r = t[0], - i = t[1], - a = t[2]; - return e[0] = r + s * (n[0] - r), e[1] = i + s * (n[1] - i), e[2] = a + s * (n[2] - a), e; + a = t[1], + i = t[2]; + return e[0] = r + s * (n[0] - r), e[1] = a + s * (n[1] - a), e[2] = i + s * (n[2] - i), e; } }, { key: "slerp", value: function slerp(e, t, n, s) { var r = Math.acos(Math.min(Math.max(A.dot(t, n), -1), 1)), - i = Math.sin(r), - a = Math.sin((1 - s) * r) / i, - c = Math.sin(s * r) / i; - return e[0] = a * t[0] + c * n[0], e[1] = a * t[1] + c * n[1], e[2] = a * t[2] + c * n[2], e; + a = Math.sin(r), + i = Math.sin((1 - s) * r) / a, + c = Math.sin(s * r) / a; + return e[0] = i * t[0] + c * n[0], e[1] = i * t[1] + c * n[1], e[2] = i * t[2] + c * n[2], e; } }, { key: "hermite", - value: function hermite(e, t, n, s, r, i) { - var a = i * i, - c = a * (2 * i - 3) + 1, - y = a * (i - 2) + i, - L = a * (i - 1), - k = a * (3 - 2 * i); + value: function hermite(e, t, n, s, r, a) { + var i = a * a, + c = i * (2 * a - 3) + 1, + y = i * (a - 2) + a, + L = i * (a - 1), + k = i * (3 - 2 * a); return e[0] = t[0] * c + n[0] * y + s[0] * L + r[0] * k, e[1] = t[1] * c + n[1] * y + s[1] * L + r[1] * k, e[2] = t[2] * c + n[2] * y + s[2] * L + r[2] * k, e; } }, { key: "bezier", - value: function bezier(e, t, n, s, r, i) { - var a = 1 - i, - c = a * a, - y = i * i, - L = c * a, - k = 3 * i * c, - l = 3 * y * a, - b = y * i; - return e[0] = t[0] * L + n[0] * k + s[0] * l + r[0] * b, e[1] = t[1] * L + n[1] * k + s[1] * l + r[1] * b, e[2] = t[2] * L + n[2] * k + s[2] * l + r[2] * b, e; + value: function bezier(e, t, n, s, r, a) { + var i = 1 - a, + c = i * i, + y = a * a, + L = c * i, + k = 3 * a * c, + l = 3 * y * i, + M = y * a; + return e[0] = t[0] * L + n[0] * k + s[0] * l + r[0] * M, e[1] = t[1] * L + n[1] * k + s[1] * l + r[1] * M, e[2] = t[2] * L + n[2] * k + s[2] * l + r[2] * M, e; } }, { key: "transformMat4", value: function transformMat4(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = n[3] * s + n[7] * r + n[11] * i + n[15] || 1; - return e[0] = (n[0] * s + n[4] * r + n[8] * i + n[12]) / a, e[1] = (n[1] * s + n[5] * r + n[9] * i + n[13]) / a, e[2] = (n[2] * s + n[6] * r + n[10] * i + n[14]) / a, e; + a = t[2], + i = n[3] * s + n[7] * r + n[11] * a + n[15] || 1; + return e[0] = (n[0] * s + n[4] * r + n[8] * a + n[12]) / i, e[1] = (n[1] * s + n[5] * r + n[9] * a + n[13]) / i, e[2] = (n[2] * s + n[6] * r + n[10] * a + n[14]) / i, e; } }, { key: "transformMat3", value: function transformMat3(e, t, n) { var s = t[0], r = t[1], - i = t[2]; - return e[0] = s * n[0] + r * n[3] + i * n[6], e[1] = s * n[1] + r * n[4] + i * n[7], e[2] = s * n[2] + r * n[5] + i * n[8], e; + a = t[2]; + return e[0] = s * n[0] + r * n[3] + a * n[6], e[1] = s * n[1] + r * n[4] + a * n[7], e[2] = s * n[2] + r * n[5] + a * n[8], e; } }, { key: "transformQuat", value: function transformQuat(e, t, n) { var s = n[0], r = n[1], - i = n[2], - a = n[3] * 2, + a = n[2], + i = n[3] * 2, c = t[0], y = t[1], L = t[2], - k = r * L - i * y, - l = i * c - s * L, - b = s * y - r * c, - h = (r * b - i * l) * 2, - M = (i * k - s * b) * 2, + k = r * L - a * y, + l = a * c - s * L, + M = s * y - r * c, + h = (r * M - a * l) * 2, + b = (a * k - s * M) * 2, d = (s * l - r * k) * 2; - return e[0] = c + k * a + h, e[1] = y + l * a + M, e[2] = L + b * a + d, e; + return e[0] = c + k * i + h, e[1] = y + l * i + b, e[2] = L + M * i + d, e; } }, { key: "rotateX", value: function rotateX(e, t, n, s) { var r = n[1], - i = n[2], - a = t[1] - r, - c = t[2] - i; - return e[0] = t[0], e[1] = a * Math.cos(s) - c * Math.sin(s) + r, e[2] = a * Math.sin(s) + c * Math.cos(s) + i, e; + a = n[2], + i = t[1] - r, + c = t[2] - a; + return e[0] = t[0], e[1] = i * Math.cos(s) - c * Math.sin(s) + r, e[2] = i * Math.sin(s) + c * Math.cos(s) + a, e; } }, { key: "rotateY", value: function rotateY(e, t, n, s) { var r = n[0], - i = n[2], - a = t[0] - r, - c = t[2] - i; - return e[0] = c * Math.sin(s) + a * Math.cos(s) + r, e[1] = t[1], e[2] = c * Math.cos(s) - a * Math.sin(s) + i, e; + a = n[2], + i = t[0] - r, + c = t[2] - a; + return e[0] = c * Math.sin(s) + i * Math.cos(s) + r, e[1] = t[1], e[2] = c * Math.cos(s) - i * Math.sin(s) + a, e; } }, { key: "rotateZ", value: function rotateZ(e, t, n, s) { var r = n[0], - i = n[1], - a = t[0] - r, - c = t[1] - i; - return e[0] = a * Math.cos(s) - c * Math.sin(s) + r, e[1] = a * Math.sin(s) + c * Math.cos(s) + i, e[2] = n[2], e; + a = n[1], + i = t[0] - r, + c = t[1] - a; + return e[0] = i * Math.cos(s) - c * Math.sin(s) + r, e[1] = i * Math.sin(s) + c * Math.cos(s) + a, e[2] = n[2], e; } }, { key: "angle", @@ -2472,10 +2472,10 @@ var n = e[0], s = e[1], r = e[2], - i = t[0], - a = t[1], + a = t[0], + i = t[1], c = t[2], - y = Math.sqrt((n * n + s * s + r * r) * (i * i + a * a + c * c)), + y = Math.sqrt((n * n + s * s + r * r) * (a * a + i * i + c * c)), L = y && A.dot(e, t) / y; return Math.acos(Math.min(Math.max(L, -1), 1)); } @@ -2500,10 +2500,10 @@ var n = e[0], s = e[1], r = e[2], - i = t[0], - a = t[1], + a = t[0], + i = t[1], c = t[2]; - return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - a) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(a)) && Math.abs(r - c) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(c)); + return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - i) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(i)) && Math.abs(r - c) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(c)); } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); @@ -2832,8 +2832,8 @@ var n = t[0] - e[0], s = t[1] - e[1], r = t[2] - e[2], - i = t[3] - e[3]; - return Math.hypot(n, s, r, i); + a = t[3] - e[3]; + return Math.hypot(n, s, r, a); } }, { key: "dist", @@ -2846,8 +2846,8 @@ var n = t[0] - e[0], s = t[1] - e[1], r = t[2] - e[2], - i = t[3] - e[3]; - return n * n + s * s + r * r + i * i; + a = t[3] - e[3]; + return n * n + s * s + r * r + a * a; } }, { key: "sqrDist", @@ -2913,9 +2913,9 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = n * n + s * s + r * r + i * i; - return a > 0 && (a = 1 / Math.sqrt(a)), e[0] = n * a, e[1] = s * a, e[2] = r * a, e[3] = i * a, e; + a = t[3], + i = n * n + s * s + r * r + a * a; + return i > 0 && (i = 1 / Math.sqrt(i)), e[0] = n * i, e[1] = s * i, e[2] = r * i, e[3] = a * i, e; } }, { key: "dot", @@ -2926,50 +2926,50 @@ key: "cross", value: function cross(e, t, n, s) { var r = n[0] * s[1] - n[1] * s[0], - i = n[0] * s[2] - n[2] * s[0], - a = n[0] * s[3] - n[3] * s[0], + a = n[0] * s[2] - n[2] * s[0], + i = n[0] * s[3] - n[3] * s[0], c = n[1] * s[2] - n[2] * s[1], y = n[1] * s[3] - n[3] * s[1], L = n[2] * s[3] - n[3] * s[2], k = t[0], l = t[1], - b = t[2], + M = t[2], h = t[3]; - return e[0] = l * L - b * y + h * c, e[1] = -(k * L) + b * a - h * i, e[2] = k * y - l * a + h * r, e[3] = -(k * c) + l * i - b * r, e; + return e[0] = l * L - M * y + h * c, e[1] = -(k * L) + M * i - h * a, e[2] = k * y - l * i + h * r, e[3] = -(k * c) + l * a - M * r, e; } }, { key: "lerp", value: function lerp(e, t, n, s) { var r = t[0], - i = t[1], - a = t[2], + a = t[1], + i = t[2], c = t[3]; - return e[0] = r + s * (n[0] - r), e[1] = i + s * (n[1] - i), e[2] = a + s * (n[2] - a), e[3] = c + s * (n[3] - c), e; + return e[0] = r + s * (n[0] - r), e[1] = a + s * (n[1] - a), e[2] = i + s * (n[2] - i), e[3] = c + s * (n[3] - c), e; } }, { key: "transformMat4", value: function transformMat4(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3]; - return e[0] = n[0] * s + n[4] * r + n[8] * i + n[12] * a, e[1] = n[1] * s + n[5] * r + n[9] * i + n[13] * a, e[2] = n[2] * s + n[6] * r + n[10] * i + n[14] * a, e[3] = n[3] * s + n[7] * r + n[11] * i + n[15] * a, e; + a = t[2], + i = t[3]; + return e[0] = n[0] * s + n[4] * r + n[8] * a + n[12] * i, e[1] = n[1] * s + n[5] * r + n[9] * a + n[13] * i, e[2] = n[2] * s + n[6] * r + n[10] * a + n[14] * i, e[3] = n[3] * s + n[7] * r + n[11] * a + n[15] * i, e; } }, { key: "transformQuat", value: function transformQuat(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = n[0], + a = t[2], + i = n[0], c = n[1], y = n[2], L = n[3], - k = L * s + c * i - y * r, - l = L * r + y * s - a * i, - b = L * i + a * r - c * s, - h = -a * s - c * r - y * i; - return e[0] = k * L + h * -a + l * -y - b * -c, e[1] = l * L + h * -c + b * -a - k * -y, e[2] = b * L + h * -y + k * -c - l * -a, e[3] = t[3], e; + k = L * s + c * a - y * r, + l = L * r + y * s - i * a, + M = L * a + i * r - c * s, + h = -i * s - c * r - y * a; + return e[0] = k * L + h * -i + l * -y - M * -c, e[1] = l * L + h * -c + M * -i - k * -y, e[2] = M * L + h * -y + k * -c - l * -i, e[3] = t[3], e; } }, { key: "zero", @@ -2992,12 +2992,12 @@ var n = e[0], s = e[1], r = e[2], - i = e[3], - a = t[0], + a = e[3], + i = t[0], c = t[1], y = t[2], L = t[3]; - return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(i - L) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(L)); + return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(a - L) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(L)); } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); @@ -3016,7 +3016,7 @@ q.length = q.magnitude; q.len = q.magnitude; var ke, - ae, + ie, ce, W, U, @@ -3168,7 +3168,7 @@ }, { key: "setAxisAngle", value: function setAxisAngle(e, t, n) { - n = n * .5; + n *= .5; var s = Math.sin(n); return e[0] = s * t[0], e[1] = s * t[1], e[2] = s * t[2], e[3] = Math.cos(n), e; } @@ -3190,13 +3190,13 @@ value: function multiply(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = n[0], y = n[1], L = n[2], k = n[3]; - return e[0] = s * k + a * c + r * L - i * y, e[1] = r * k + a * y + i * c - s * L, e[2] = i * k + a * L + s * y - r * c, e[3] = a * k - s * c - r * y - i * L, e; + return e[0] = s * k + i * c + r * L - a * y, e[1] = r * k + i * y + a * c - s * L, e[2] = a * k + i * L + s * y - r * c, e[3] = i * k - s * c - r * y - a * L, e; } }, { key: "rotateX", @@ -3204,11 +3204,11 @@ n *= .5; var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = Math.sin(n), y = Math.cos(n); - return e[0] = s * y + a * c, e[1] = r * y + i * c, e[2] = i * y - r * c, e[3] = a * y - s * c, e; + return e[0] = s * y + i * c, e[1] = r * y + a * c, e[2] = a * y - r * c, e[3] = i * y - s * c, e; } }, { key: "rotateY", @@ -3216,11 +3216,11 @@ n *= .5; var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = Math.sin(n), y = Math.cos(n); - return e[0] = s * y - i * c, e[1] = r * y + a * c, e[2] = i * y + s * c, e[3] = a * y - r * c, e; + return e[0] = s * y - a * c, e[1] = r * y + i * c, e[2] = a * y + s * c, e[3] = i * y - r * c, e; } }, { key: "rotateZ", @@ -3228,11 +3228,11 @@ n *= .5; var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = Math.sin(n), y = Math.cos(n); - return e[0] = s * y + r * c, e[1] = r * y - s * c, e[2] = i * y + a * c, e[3] = a * y - i * c, e; + return e[0] = s * y + r * c, e[1] = r * y - s * c, e[2] = a * y + i * c, e[3] = i * y - a * c, e; } }, { key: "calculateW", @@ -3248,11 +3248,11 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = Math.sqrt(n * n + s * s + r * r), - c = Math.exp(i), - y = a > 0 ? c * Math.sin(a) / a : 0; - return e[0] = n * y, e[1] = s * y, e[2] = r * y, e[3] = c * Math.cos(a), e; + a = t[3], + i = Math.sqrt(n * n + s * s + r * r), + c = Math.exp(a), + y = i > 0 ? c * Math.sin(i) / i : 0; + return e[0] = n * y, e[1] = s * y, e[2] = r * y, e[3] = c * Math.cos(i), e; } }, { key: "ln", @@ -3260,10 +3260,10 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = Math.sqrt(n * n + s * s + r * r), - c = a > 0 ? Math.atan2(a, i) / a : 0; - return e[0] = n * c, e[1] = s * c, e[2] = r * c, e[3] = .5 * Math.log(n * n + s * s + r * r + i * i), e; + a = t[3], + i = Math.sqrt(n * n + s * s + r * r), + c = i > 0 ? Math.atan2(i, a) / i : 0; + return e[0] = n * c, e[1] = s * c, e[2] = r * c, e[3] = .5 * Math.log(n * n + s * s + r * r + a * a), e; } }, { key: "pow", @@ -3274,22 +3274,22 @@ key: "slerp", value: function slerp(e, t, n, s) { var r = t[0], - i = t[1], - a = t[2], + a = t[1], + i = t[2], c = t[3], y = n[0], L = n[1], k = n[2], l = n[3], - b, + M, h, - M = r * y + i * L + a * k + c * l; - if (M < 0 && (M = -M, y = -y, L = -L, k = -k, l = -l), 1 - M > 1e-6) { - var d = Math.acos(M), + b = r * y + a * L + i * k + c * l; + if (b < 0 && (b = -b, y = -y, L = -L, k = -k, l = -l), 1 - b > 1e-6) { + var d = Math.acos(b), m = Math.sin(d); - b = Math.sin((1 - s) * d) / m, h = Math.sin(s * d) / m; - } else b = 1 - s, h = s; - return e[0] = b * r + h * y, e[1] = b * i + h * L, e[2] = b * a + h * k, e[3] = b * c + h * l, e; + M = Math.sin((1 - s) * d) / m, h = Math.sin(s * d) / m; + } else M = 1 - s, h = s; + return e[0] = M * r + h * y, e[1] = M * a + h * L, e[2] = M * i + h * k, e[3] = M * c + h * l, e; } }, { key: "invert", @@ -3297,10 +3297,10 @@ var n = t[0], s = t[1], r = t[2], - i = t[3], - a = n * n + s * s + r * r + i * i, - c = a ? 1 / a : 0; - return e[0] = -n * c, e[1] = -s * c, e[2] = -r * c, e[3] = i * c, e; + a = t[3], + i = n * n + s * s + r * r + a * a, + c = i ? 1 / i : 0; + return e[0] = -n * c, e[1] = -s * c, e[2] = -r * c, e[3] = a * c, e; } }, { key: "conjugate", @@ -3315,9 +3315,9 @@ if (n > 0) s = Math.sqrt(n + 1), e[3] = .5 * s, s = .5 / s, e[0] = (t[5] - t[7]) * s, e[1] = (t[6] - t[2]) * s, e[2] = (t[1] - t[3]) * s;else { var r = 0; t[4] > t[0] && (r = 1), t[8] > t[r * 3 + r] && (r = 2); - var i = (r + 1) % 3, - a = (r + 2) % 3; - s = Math.sqrt(t[r * 3 + r] - t[i * 3 + i] - t[a * 3 + a] + 1), e[r] = .5 * s, s = .5 / s, e[3] = (t[i * 3 + a] - t[a * 3 + i]) * s, e[i] = (t[i * 3 + r] + t[r * 3 + i]) * s, e[a] = (t[a * 3 + r] + t[r * 3 + a]) * s; + var a = (r + 1) % 3, + i = (r + 2) % 3; + s = Math.sqrt(t[r * 3 + r] - t[a * 3 + a] - t[i * 3 + i] + 1), e[r] = .5 * s, s = .5 / s, e[3] = (t[a * 3 + i] - t[i * 3 + a]) * s, e[a] = (t[a * 3 + r] + t[r * 3 + a]) * s, e[i] = (t[i * 3 + r] + t[r * 3 + i]) * s; } return e; } @@ -3325,9 +3325,9 @@ key: "fromEuler", value: function fromEuler(e, t, n, s) { var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : E(f, ke); - var i = .5 * Math.PI / 180; - t *= i, n *= i, s *= i; - var a = Math.sin(t), + var a = .5 * Math.PI / 180; + t *= a, n *= a, s *= a; + var i = Math.sin(t), c = Math.cos(t), y = Math.sin(n), L = Math.cos(n), @@ -3335,25 +3335,25 @@ l = Math.cos(s); switch (r) { case "xyz": - e[0] = a * L * l + c * y * k, e[1] = c * y * l - a * L * k, e[2] = c * L * k + a * y * l, e[3] = c * L * l - a * y * k; + e[0] = i * L * l + c * y * k, e[1] = c * y * l - i * L * k, e[2] = c * L * k + i * y * l, e[3] = c * L * l - i * y * k; break; case "xzy": - e[0] = a * L * l - c * y * k, e[1] = c * y * l - a * L * k, e[2] = c * L * k + a * y * l, e[3] = c * L * l + a * y * k; + e[0] = i * L * l - c * y * k, e[1] = c * y * l - i * L * k, e[2] = c * L * k + i * y * l, e[3] = c * L * l + i * y * k; break; case "yxz": - e[0] = a * L * l + c * y * k, e[1] = c * y * l - a * L * k, e[2] = c * L * k - a * y * l, e[3] = c * L * l + a * y * k; + e[0] = i * L * l + c * y * k, e[1] = c * y * l - i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l + i * y * k; break; case "yzx": - e[0] = a * L * l + c * y * k, e[1] = c * y * l + a * L * k, e[2] = c * L * k - a * y * l, e[3] = c * L * l - a * y * k; + e[0] = i * L * l + c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l - i * y * k; break; case "zxy": - e[0] = a * L * l - c * y * k, e[1] = c * y * l + a * L * k, e[2] = c * L * k + a * y * l, e[3] = c * L * l - a * y * k; + e[0] = i * L * l - c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k + i * y * l, e[3] = c * L * l - i * y * k; break; case "zyx": - e[0] = a * L * l - c * y * k, e[1] = c * y * l + a * L * k, e[2] = c * L * k - a * y * l, e[3] = c * L * l + a * y * k; + e[0] = i * L * l - c * y * k, e[1] = c * y * l + i * L * k, e[2] = c * L * k - i * y * l, e[3] = c * L * l + i * y * k; break; default: - throw new Error("Unknown angle order " + r); + throw new Error("Unknown angle order ".concat(r)); } return e; } @@ -3460,8 +3460,8 @@ } }, { key: "sqlerp", - value: function sqlerp(e, t, n, s, r, i) { - return f.slerp(E(f, ae), t, r, i), f.slerp(E(f, ce), n, s, i), f.slerp(e, E(f, ae), E(f, ce), 2 * i * (1 - i)), e; + value: function sqlerp(e, t, n, s, r, a) { + return f.slerp(E(f, ie), t, r, a), f.slerp(E(f, ce), n, s, a), f.slerp(e, E(f, ie), E(f, ce), 2 * a * (1 - a)), e; } }, { key: "setAxes", @@ -3470,7 +3470,7 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); - ke = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), U = new WeakMap(), le = new WeakMap(), he = new WeakMap(), Z(f, ke, "zyx"), Z(f, ae, new Float64Array(4)), Z(f, ce, new Float64Array(4)), Z(f, W, new Float64Array(9)), Z(f, U, new Float64Array(3)), Z(f, le, new Float64Array([1, 0, 0])), Z(f, he, new Float64Array([0, 1, 0])); + ke = new WeakMap(), ie = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), U = new WeakMap(), le = new WeakMap(), he = new WeakMap(), Z(f, ke, "zyx"), Z(f, ie, new Float64Array(4)), Z(f, ce, new Float64Array(4)), Z(f, W, new Float64Array(9)), Z(f, U, new Float64Array(3)), Z(f, le, new Float64Array([1, 0, 0])), Z(f, he, new Float64Array([0, 1, 0])); var O = f; O.set = q.set; O.add = q.add; @@ -3542,15 +3542,15 @@ } }, { key: "fromValues", - value: function fromValues(e, t, n, s, r, i, a, c) { - return new j(e, t, n, s, r, i, a, c); + value: function fromValues(e, t, n, s, r, a, i, c) { + return new j(e, t, n, s, r, a, i, c); } }, { key: "fromRotationTranslationValues", - value: function fromRotationTranslationValues(e, t, n, s, r, i, a) { + value: function fromRotationTranslationValues(e, t, n, s, r, a, i) { var c = r * .5, - y = i * .5, - L = a * .5; + y = a * .5, + L = i * .5; return new j(e, t, n, s, c * s + y * n - L * t, y * s + L * e - c * n, L * s + c * t - y * e, -c * e - y * t - L * n); } }, { @@ -3558,12 +3558,12 @@ value: function fromRotationTranslation(e, t, n) { var s = n[0] * .5, r = n[1] * .5, - i = n[2] * .5, - a = t[0], + a = n[2] * .5, + i = t[0], c = t[1], y = t[2], L = t[3]; - return e[0] = a, e[1] = c, e[2] = y, e[3] = L, e[4] = s * L + r * y - i * c, e[5] = r * L + i * a - s * y, e[6] = i * L + s * c - r * a, e[7] = -s * a - r * c - i * y, e; + return e[0] = i, e[1] = c, e[2] = y, e[3] = L, e[4] = s * L + r * y - a * c, e[5] = r * L + a * i - s * y, e[6] = a * L + s * c - r * i, e[7] = -s * i - r * c - a * y, e; } }, { key: "fromTranslation", @@ -3592,8 +3592,8 @@ } }, { key: "set", - value: function set(e, t, n, s, r, i, a, c, y) { - return e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = i, e[5] = a, e[6] = c, e[7] = y, e; + value: function set(e, t, n, s, r, a, i, c, y) { + return e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = a, e[5] = i, e[6] = c, e[7] = y, e; } }, { key: "getReal", @@ -3621,127 +3621,127 @@ var n = t[4], s = t[5], r = t[6], - i = t[7], - a = -t[0], + a = t[7], + i = -t[0], c = -t[1], y = -t[2], L = t[3]; - return e[0] = (n * L + i * a + s * y - r * c) * 2, e[1] = (s * L + i * c + r * a - n * y) * 2, e[2] = (r * L + i * y + n * c - s * a) * 2, e; + return e[0] = (n * L + a * i + s * y - r * c) * 2, e[1] = (s * L + a * c + r * i - n * y) * 2, e[2] = (r * L + a * y + n * c - s * i) * 2, e; } }, { key: "translate", value: function translate(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = n[0] * .5, y = n[1] * .5, L = n[2] * .5, k = t[4], l = t[5], - b = t[6], + M = t[6], h = t[7]; - return e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = a * c + r * L - i * y + k, e[5] = a * y + i * c - s * L + l, e[6] = a * L + s * y - r * c + b, e[7] = -s * c - r * y - i * L + h, e; + return e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = i * c + r * L - a * y + k, e[5] = i * y + a * c - s * L + l, e[6] = i * L + s * y - r * c + M, e[7] = -s * c - r * y - a * L + h, e; } }, { key: "rotateX", value: function rotateX(e, t, n) { var s = -t[0], r = -t[1], - i = -t[2], - a = t[3], + a = -t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], - l = c * a + k * s + y * i - L * r, - b = y * a + k * r + L * s - c * i, - h = L * a + k * i + c * r - y * s, - M = k * a - c * s - y * r - L * i; - return O.rotateX(e, t, n), s = e[0], r = e[1], i = e[2], a = e[3], e[4] = l * a + M * s + b * i - h * r, e[5] = b * a + M * r + h * s - l * i, e[6] = h * a + M * i + l * r - b * s, e[7] = M * a - l * s - b * r - h * i, e; + l = c * i + k * s + y * a - L * r, + M = y * i + k * r + L * s - c * a, + h = L * i + k * a + c * r - y * s, + b = k * i - c * s - y * r - L * a; + return O.rotateX(e, t, n), s = e[0], r = e[1], a = e[2], i = e[3], e[4] = l * i + b * s + M * a - h * r, e[5] = M * i + b * r + h * s - l * a, e[6] = h * i + b * a + l * r - M * s, e[7] = b * i - l * s - M * r - h * a, e; } }, { key: "rotateY", value: function rotateY(e, t, n) { var s = -t[0], r = -t[1], - i = -t[2], - a = t[3], + a = -t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], - l = c * a + k * s + y * i - L * r, - b = y * a + k * r + L * s - c * i, - h = L * a + k * i + c * r - y * s, - M = k * a - c * s - y * r - L * i; - return O.rotateY(e, t, n), s = e[0], r = e[1], i = e[2], a = e[3], e[4] = l * a + M * s + b * i - h * r, e[5] = b * a + M * r + h * s - l * i, e[6] = h * a + M * i + l * r - b * s, e[7] = M * a - l * s - b * r - h * i, e; + l = c * i + k * s + y * a - L * r, + M = y * i + k * r + L * s - c * a, + h = L * i + k * a + c * r - y * s, + b = k * i - c * s - y * r - L * a; + return O.rotateY(e, t, n), s = e[0], r = e[1], a = e[2], i = e[3], e[4] = l * i + b * s + M * a - h * r, e[5] = M * i + b * r + h * s - l * a, e[6] = h * i + b * a + l * r - M * s, e[7] = b * i - l * s - M * r - h * a, e; } }, { key: "rotateZ", value: function rotateZ(e, t, n) { var s = -t[0], r = -t[1], - i = -t[2], - a = t[3], + a = -t[2], + i = t[3], c = t[4], y = t[5], L = t[6], k = t[7], - l = c * a + k * s + y * i - L * r, - b = y * a + k * r + L * s - c * i, - h = L * a + k * i + c * r - y * s, - M = k * a - c * s - y * r - L * i; - return O.rotateZ(e, t, n), s = e[0], r = e[1], i = e[2], a = e[3], e[4] = l * a + M * s + b * i - h * r, e[5] = b * a + M * r + h * s - l * i, e[6] = h * a + M * i + l * r - b * s, e[7] = M * a - l * s - b * r - h * i, e; + l = c * i + k * s + y * a - L * r, + M = y * i + k * r + L * s - c * a, + h = L * i + k * a + c * r - y * s, + b = k * i - c * s - y * r - L * a; + return O.rotateZ(e, t, n), s = e[0], r = e[1], a = e[2], i = e[3], e[4] = l * i + b * s + M * a - h * r, e[5] = M * i + b * r + h * s - l * a, e[6] = h * i + b * a + l * r - M * s, e[7] = b * i - l * s - M * r - h * a, e; } }, { key: "rotateByQuatAppend", value: function rotateByQuatAppend(e, t, n) { var s = n[0], r = n[1], - i = n[2], - a = n[3], + a = n[2], + i = n[3], c = t[0], y = t[1], L = t[2], k = t[3]; - return e[0] = c * a + k * s + y * i - L * r, e[1] = y * a + k * r + L * s - c * i, e[2] = L * a + k * i + c * r - y * s, e[3] = k * a - c * s - y * r - L * i, c = t[4], y = t[5], L = t[6], k = t[7], e[4] = c * a + k * s + y * i - L * r, e[5] = y * a + k * r + L * s - c * i, e[6] = L * a + k * i + c * r - y * s, e[7] = k * a - c * s - y * r - L * i, e; + return e[0] = c * i + k * s + y * a - L * r, e[1] = y * i + k * r + L * s - c * a, e[2] = L * i + k * a + c * r - y * s, e[3] = k * i - c * s - y * r - L * a, c = t[4], y = t[5], L = t[6], k = t[7], e[4] = c * i + k * s + y * a - L * r, e[5] = y * i + k * r + L * s - c * a, e[6] = L * i + k * a + c * r - y * s, e[7] = k * i - c * s - y * r - L * a, e; } }, { key: "rotateByQuatPrepend", value: function rotateByQuatPrepend(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = n[0], y = n[1], L = n[2], k = n[3]; - return e[0] = s * k + a * c + r * L - i * y, e[1] = r * k + a * y + i * c - s * L, e[2] = i * k + a * L + s * y - r * c, e[3] = a * k - s * c - r * y - i * L, c = n[4], y = n[5], L = n[6], k = n[7], e[4] = s * k + a * c + r * L - i * y, e[5] = r * k + a * y + i * c - s * L, e[6] = i * k + a * L + s * y - r * c, e[7] = a * k - s * c - r * y - i * L, e; + return e[0] = s * k + i * c + r * L - a * y, e[1] = r * k + i * y + a * c - s * L, e[2] = a * k + i * L + s * y - r * c, e[3] = i * k - s * c - r * y - a * L, c = n[4], y = n[5], L = n[6], k = n[7], e[4] = s * k + i * c + r * L - a * y, e[5] = r * k + i * y + a * c - s * L, e[6] = a * k + i * L + s * y - r * c, e[7] = i * k - s * c - r * y - a * L, e; } }, { key: "rotateAroundAxis", value: function rotateAroundAxis(e, t, n, s) { if (Math.abs(s) < 1e-6) return j.copy(e, t); var r = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); - s = s * .5; - var i = Math.sin(s), - a = i * n[0] / r, - c = i * n[1] / r, - y = i * n[2] / r, + s *= .5; + var a = Math.sin(s), + i = a * n[0] / r, + c = a * n[1] / r, + y = a * n[2] / r, L = Math.cos(s), k = t[0], l = t[1], - b = t[2], + M = t[2], h = t[3]; - e[0] = k * L + h * a + l * y - b * c, e[1] = l * L + h * c + b * a - k * y, e[2] = b * L + h * y + k * c - l * a, e[3] = h * L - k * a - l * c - b * y; - var M = t[4], + e[0] = k * L + h * i + l * y - M * c, e[1] = l * L + h * c + M * i - k * y, e[2] = M * L + h * y + k * c - l * i, e[3] = h * L - k * i - l * c - M * y; + var b = t[4], d = t[5], m = t[6], - x = t[7]; - return e[4] = M * L + x * a + d * y - m * c, e[5] = d * L + x * c + m * a - M * y, e[6] = m * L + x * y + M * c - d * a, e[7] = x * L - M * a - d * c - m * y, e; + o = t[7]; + return e[4] = b * L + o * i + d * y - m * c, e[5] = d * L + o * c + m * i - b * y, e[6] = m * L + o * y + b * c - d * i, e[7] = o * L - b * i - d * c - m * y, e; } }, { key: "add", @@ -3753,21 +3753,21 @@ value: function multiply(e, t, n) { var s = t[0], r = t[1], - i = t[2], - a = t[3], + a = t[2], + i = t[3], c = n[4], y = n[5], L = n[6], k = n[7], l = t[4], - b = t[5], + M = t[5], h = t[6], - M = t[7], + b = t[7], d = n[0], m = n[1], - x = n[2], + o = n[2], V = n[3]; - return e[0] = s * V + a * d + r * x - i * m, e[1] = r * V + a * m + i * d - s * x, e[2] = i * V + a * x + s * m - r * d, e[3] = a * V - s * d - r * m - i * x, e[4] = s * k + a * c + r * L - i * y + l * V + M * d + b * x - h * m, e[5] = r * k + a * y + i * c - s * L + b * V + M * m + h * d - l * x, e[6] = i * k + a * L + s * y - r * c + h * V + M * x + l * m - b * d, e[7] = a * k - s * c - r * y - i * L + M * V - l * d - b * m - h * x, e; + return e[0] = s * V + i * d + r * o - a * m, e[1] = r * V + i * m + a * d - s * o, e[2] = a * V + i * o + s * m - r * d, e[3] = i * V - s * d - r * m - a * o, e[4] = s * k + i * c + r * L - a * y + l * V + b * d + M * o - h * m, e[5] = r * k + i * y + a * c - s * L + M * V + b * m + h * d - l * o, e[6] = a * k + i * L + s * y - r * c + h * V + b * o + l * m - M * d, e[7] = i * k - s * c - r * y - a * L + b * V - l * d - M * m - h * o, e; } }, { key: "mul", @@ -3839,14 +3839,14 @@ n = Math.sqrt(n); var s = t[0] / n, r = t[1] / n, - i = t[2] / n, - a = t[3] / n, + a = t[2] / n, + i = t[3] / n, c = t[4], y = t[5], L = t[6], k = t[7], - l = s * c + r * y + i * L + a * k; - e[0] = s, e[1] = r, e[2] = i, e[3] = a, e[4] = (c - s * l) / n, e[5] = (y - r * l) / n, e[6] = (L - i * l) / n, e[7] = (k - a * l) / n; + l = s * c + r * y + a * L + i * k; + e[0] = s, e[1] = r, e[2] = a, e[3] = i, e[4] = (c - s * l) / n, e[5] = (y - r * l) / n, e[6] = (L - a * l) / n, e[7] = (k - i * l) / n; } return e; } @@ -3866,20 +3866,20 @@ var n = e[0], s = e[1], r = e[2], - i = e[3], - a = e[4], + a = e[3], + i = e[4], c = e[5], y = e[6], L = e[7], k = t[0], l = t[1], - b = t[2], + M = t[2], h = t[3], - M = t[4], + b = t[4], d = t[5], m = t[6], - x = t[7]; - return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - b) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(b)) && Math.abs(i - h) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(h)) && Math.abs(a - M) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(M)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - x) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(x)); + o = t[7]; + return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - M) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(M)) && Math.abs(a - h) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(h)) && Math.abs(i - b) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(b)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - o) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(o)); } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); @@ -3892,7 +3892,7 @@ J.length = O.magnitude; J.len = O.magnitude; J.mul = J.multiply; - var F = /*#__PURE__*/function (_Float64Array9) { + var N = /*#__PURE__*/function (_Float64Array9) { function A() { var _this9; _classCallCheck(this, A); @@ -4264,8 +4264,8 @@ key: "lerp", value: function lerp(e, t, n, s) { var r = t[0], - i = t[1]; - return e[0] = r + s * (n[0] - r), e[1] = i + s * (n[1] - i), e; + a = t[1]; + return e[0] = r + s * (n[0] - r), e[1] = a + s * (n[1] - a), e; } }, { key: "transformMat2", @@ -4299,10 +4299,10 @@ key: "rotate", value: function rotate(e, t, n, s) { var r = t[0] - n[0], - i = t[1] - n[1], - a = Math.sin(s), + a = t[1] - n[1], + i = Math.sin(s), c = Math.cos(s); - return e[0] = r * c - i * a + n[0], e[1] = r * a + i * c + n[1], e; + return e[0] = r * c - a * i + n[0], e[1] = r * i + a * c + n[1], e; } }, { key: "angle", @@ -4310,9 +4310,9 @@ var n = e[0], s = e[1], r = t[0], - i = t[1], - a = Math.sqrt(n * n + s * s) * Math.sqrt(r * r + i * i), - c = a && (n * r + s * i) / a; + a = t[1], + i = Math.sqrt(n * n + s * s) * Math.sqrt(r * r + a * a), + c = i && (n * r + s * a) / i; return Math.acos(Math.min(Math.max(c, -1), 1)); } }, { @@ -4331,8 +4331,8 @@ var n = e[0], s = e[1], r = t[0], - i = t[1]; - return Math.abs(n - r) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(r)) && Math.abs(s - i) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(i)); + a = t[1]; + return Math.abs(n - r) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(r)) && Math.abs(s - a) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(a)); } }, { key: "str", @@ -4341,20 +4341,20 @@ } }]); }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); - F.prototype.sub = F.prototype.subtract; - F.prototype.mul = F.prototype.multiply; - F.prototype.div = F.prototype.divide; - F.prototype.dist = F.prototype.distance; - F.prototype.sqrDist = F.prototype.squaredDistance; - F.sub = F.subtract; - F.mul = F.multiply; - F.div = F.divide; - F.dist = F.distance; - F.sqrDist = F.squaredDistance; - F.sqrLen = F.squaredLength; - F.mag = F.magnitude; - F.length = F.magnitude; - F.len = F.magnitude; + N.prototype.sub = N.prototype.subtract; + N.prototype.mul = N.prototype.multiply; + N.prototype.div = N.prototype.divide; + N.prototype.dist = N.prototype.distance; + N.prototype.sqrDist = N.prototype.squaredDistance; + N.sub = N.subtract; + N.mul = N.multiply; + N.div = N.divide; + N.dist = N.distance; + N.sqrDist = N.squaredDistance; + N.sqrLen = N.squaredLength; + N.mag = N.magnitude; + N.length = N.magnitude; + N.len = N.magnitude; var me = !1; function ve() { if (me) return; @@ -4375,7 +4375,7 @@ switch (r.length) { case 2: return function () { - return new F(this[n[r[0]]], this[n[r[1]]]); + return new N(this[n[r[0]]], this[n[r[1]]]); }; case 3: return function () { @@ -4386,43 +4386,44 @@ return new q(this[n[r[0]]], this[n[r[1]]], this[n[r[2]]], this[n[r[3]]]); }; } + throw new Error("Illegal swizzle length"); } for (var _i = 0, _A = A; _i < _A.length; _i++) { var r = _A[_i]; - var i = s(r); - Object.defineProperty(F.prototype, r, { - get: i + var a = s(r); + Object.defineProperty(N.prototype, r, { + get: a }), Object.defineProperty(T.prototype, r, { - get: i + get: a }), Object.defineProperty(q.prototype, r, { - get: i + get: a }); } for (var _i2 = 0, _e2 = e; _i2 < _e2.length; _i2++) { var _r = _e2[_i2]; - var _i3 = s(_r); + var _a = s(_r); Object.defineProperty(T.prototype, _r, { - get: _i3 + get: _a }), Object.defineProperty(q.prototype, _r, { - get: _i3 + get: _a }); } - for (var _i4 = 0, _t2 = t; _i4 < _t2.length; _i4++) { - var _r2 = _t2[_i4]; - var _i5 = s(_r2); + for (var _i3 = 0, _t2 = t; _i3 < _t2.length; _i3++) { + var _r2 = _t2[_i3]; + var _a2 = s(_r2); Object.defineProperty(q.prototype, _r2, { - get: _i5 + get: _a2 }); } me = !0; } - var oe = Math.PI / 180, + var xe = Math.PI / 180, Re = 180 / Math.PI; function _e(A) { return A * Re; } function et(A) { - return A * oe; + return A * xe; } exports.EnableSwizzlesF64 = ve; @@ -4432,7 +4433,7 @@ exports.Mat4 = G; exports.Quat = O; exports.Quat2 = J; - exports.Vec2 = F; + exports.Vec2 = N; exports.Vec3 = T; exports.Vec4 = q; exports.toDegree = _e; diff --git a/dist-cdn/umd/gl-matrix-f64.min.js.map b/dist-cdn/umd/gl-matrix-f64.min.js.map index adf169fe..3284a010 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.js.map +++ b/dist-cdn/umd/gl-matrix-f64.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var xe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(xe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*i-r*s;return a?(a=1/a,e[0]=i*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+i*y,e[1]=r*c+a*y,e[2]=s*L+i*k,e[3]=r*L+a*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=s*-c+i*y,e[3]=r*-c+a*y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=i*y,e[3]=a*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,$=class $ extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E($,se));break}}get str(){return $.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E($,se)),this}multiply(e){return $.multiply(this,this,e)}mul(e){return this}translate(e){return $.translate(this,this,e)}rotate(e){return $.rotate(this,this,e)}scale(e){return $.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new $}static clone(e){return new $(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new $(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=n*i-s*r;return y?(y=1/y,e[0]=i*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-i*a)*y,e[5]=(s*a-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],h=n[4],M=n[5];return e[0]=s*L+i*k,e[1]=r*L+a*k,e[2]=s*l+i*b,e[3]=r*l+a*b,e[4]=s*h+i*M+c,e[5]=r*h+a*M+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=s*L+i*k+c,e[5]=r*L+a*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+i*L,e[1]=r*k+a*L,e[2]=s*-L+i*k,e[3]=r*-L+a*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=i*k,e[3]=a*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(i-l)<=1e-6*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z($,se,new Float64Array([1,0,0,1,0,0]));var _=$;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*a-c*L,b=-k*i+c*y,h=L*i-a*y,M=n*l+s*b+r*h;return M?(M=1/M,e[0]=l*M,e[1]=(-k*s+r*L)*M,e[2]=(c*s-r*a)*M,e[3]=b*M,e[4]=(k*n-r*y)*M,e[5]=(-c*n+r*i)*M,e[6]=h*M,e[7]=(-L*n+s*y)*M,e[8]=(a*n-s*i)*M,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=a*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*a,e[3]=c*y-i*k,e[4]=n*k-r*y,e[5]=r*i-n*c,e[6]=i*L-a*y,e[7]=s*y-n*L,e[8]=n*a-s*i,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8];return t*(L*i-a*y)+n*(-L*r+a*c)+s*(y*r-i*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1],M=n[2];return e[0]=b*s+h*a+M*L,e[1]=b*r+h*c+M*k,e[2]=b*i+h*y+M*l,b=n[3],h=n[4],M=n[5],e[3]=b*s+h*a+M*L,e[4]=b*r+h*c+M*k,e[5]=b*i+h*y+M*l,b=n[6],h=n[7],M=n[8],e[6]=b*s+h*a+M*L,e[7]=b*r+h*c+M*k,e[8]=b*i+h*y+M*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=c,e[5]=y,e[6]=b*s+h*a+L,e[7]=b*r+h*c+k,e[8]=b*i+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),h=Math.cos(n);return e[0]=h*s+b*a,e[1]=h*r+b*c,e[2]=h*i+b*y,e[3]=h*a-b*s,e[4]=h*c-b*r,e[5]=h*y-b*i,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[3]=k-x,e[6]=b+m,e[1]=k+x,e[4]=1-L-M,e[7]=h-d,e[2]=b-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=(r*I-s*P-i*Y)*Q,e[4]=(n*P-r*p+i*N)*Q,e[5]=(s*p-n*I-i*B)*Q,e[6]=(d*S-m*g+x*z)*Q,e[7]=(m*R-M*S-x*o)*Q,e[8]=(M*g-d*R+x*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*a,e[7]=r*i-n*c,e[8]=n*a-s*i,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-o)<=1e-6*Math.max(1,Math.abs(k),Math.abs(o))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ie,H,D=class D extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(D,ie));break}}get str(){return D.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(D,ie)),this}multiply(e){return D.multiply(this,this,e)}mul(e){return this}transpose(){return D.transpose(this,this)}invert(){return D.invert(this,this)}translate(e){return D.translate(this,this,e)}rotate(e,t){return D.rotate(this,this,e,t)}scale(e){return D.scale(this,this,e)}rotateX(e){return D.rotateX(this,this,e)}rotateY(e){return D.rotateY(this,this,e)}rotateZ(e){return D.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return D.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return D.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,i){return D.orthoNO(this,e,t,n,s,r,i)}orthoZO(e,t,n,s,r,i){return D.orthoZO(this,e,t,n,s,r,i)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new D}static clone(e){return new D(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new D(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],i=t[6],a=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=i,e[11]=t[14],e[12]=r,e[13]=a,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L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s=e[2],r=e[3],i=e[4],a=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],b=e[11],h=e[12],M=e[13],d=e[14],m=e[15],x=t*a-n*i,V=t*c-s*i,o=n*c-s*a,R=L*M-k*h,z=L*d-l*h,g=k*d-l*M,S=t*g-n*z+s*R,B=i*g-a*z+c*R,N=L*o-k*V+l*x,p=h*o-M*V+d*x;return y*S-r*B+m*N-b*p}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],h=t[10],M=t[11],d=t[12],m=t[13],x=t[14],V=t[15],o=n[0],R=n[1],z=n[2],g=n[3];return e[0]=o*s+R*c+z*l+g*d,e[1]=o*r+R*y+z*b+g*m,e[2]=o*i+R*L+z*h+g*x,e[3]=o*a+R*k+z*M+g*V,o=n[4],R=n[5],z=n[6],g=n[7],e[4]=o*s+R*c+z*l+g*d,e[5]=o*r+R*y+z*b+g*m,e[6]=o*i+R*L+z*h+g*x,e[7]=o*a+R*k+z*M+g*V,o=n[8],R=n[9],z=n[10],g=n[11],e[8]=o*s+R*c+z*l+g*d,e[9]=o*r+R*y+z*b+g*m,e[10]=o*i+R*L+z*h+g*x,e[11]=o*a+R*k+z*M+g*V,o=n[12],R=n[13],z=n[14],g=n[15],e[12]=o*s+R*c+z*l+g*d,e[13]=o*r+R*y+z*b+g*m,e[14]=o*i+R*L+z*h+g*x,e[15]=o*a+R*k+z*M+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],i=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*i+t[12],e[13]=t[1]*s+t[5]*r+t[9]*i+t[13],e[14]=t[2]*s+t[6]*r+t[10]*i+t[14],e[15]=t[3]*s+t[7]*r+t[11]*i+t[15];else{let a=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],h=t[7],M=t[8],d=t[9],m=t[10],x=t[11];e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=h,e[8]=M,e[9]=d,e[10]=m,e[11]=x,e[12]=a*s+k*r+M*i+t[12],e[13]=c*s+l*r+d*i+t[13],e[14]=y*s+b*r+m*i+t[14],e[15]=L*s+h*r+x*i+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],i=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],i=s[1],a=s[2],c=Math.sqrt(r*r+i*i+a*a);if(c<1e-6)return null;c=1/c,r*=c,i*=c,a*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],h=t[2],M=t[3],d=t[4],m=t[5],x=t[6],V=t[7],o=t[8],R=t[9],z=t[10],g=t[11],S=r*r*k+L,B=i*r*k+a*y,N=a*r*k-i*y,p=r*i*k-a*y,Y=i*i*k+L,I=a*i*k+r*y,P=r*a*k+i*y,Q=i*a*k-r*y,K=a*a*k+L;return e[0]=l*S+d*B+o*N,e[1]=b*S+m*B+R*N,e[2]=h*S+x*B+z*N,e[3]=M*S+V*B+g*N,e[4]=l*p+d*Y+o*I,e[5]=b*p+m*Y+R*I,e[6]=h*p+x*Y+z*I,e[7]=M*p+V*Y+g*I,e[8]=l*P+d*Q+o*K,e[9]=b*P+m*Q+R*K,e[10]=h*P+x*Q+z*K,e[11]=M*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[4],a=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*r+L*s,e[5]=a*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-i*s,e[9]=k*r-a*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r-L*s,e[1]=a*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=i*s+L*r,e[9]=a*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),i=t[0],a=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*r+L*s,e[1]=a*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-i*s,e[5]=k*r-a*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],i=n[2],a=Math.sqrt(s*s+r*r+i*i);if(a<1e-6)return null;a=1/a,s*=a,r*=a,i*=a;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+i*c,e[2]=i*s*L-r*c,e[3]=0,e[4]=s*r*L-i*c,e[5]=r*r*L+y,e[6]=i*r*L+s*c,e[7]=0,e[8]=s*i*L+r*c,e[9]=r*i*L-s*c,e[10]=i*i*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=s+s,y=r+r,L=i+i,k=s*c,l=s*y,b=s*L,h=r*y,M=r*L,d=i*L,m=a*c,x=a*y,V=a*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=b-x,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=M+m,e[7]=0,e[8]=b+x,e[9]=M-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+i*i;return k>0?(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2/k,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2/k,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2/k):(E(D,H)[0]=(a*i+L*n+c*r-y*s)*2,E(D,H)[1]=(c*i+L*s+y*n-a*r)*2,E(D,H)[2]=(y*i+L*r+a*s-c*n)*2),D.fromRotationTranslation(e,t,E(D,H)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],h=t[11],M=t[12],d=t[13],m=t[14],x=t[15],V=n*c-s*a,o=n*y-r*a,R=n*L-i*a,z=s*y-r*c,g=s*L-i*c,S=r*L-i*y,B=k*d-l*M,N=k*m-b*M,p=k*x-h*M,Y=l*m-b*d,I=l*x-h*d,P=b*x-h*m,Q=V*P-o*I+R*Y+z*p-g*N+S*B;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-a*P-L*N)*Q,e[2]=(a*I-c*p+L*B)*Q,e[3]=0,e[4]=(r*I-s*P-i*Y)*Q,e[5]=(n*P-r*p+i*N)*Q,e[6]=(s*p-n*I-i*B)*Q,e[7]=0,e[8]=(d*S-m*g+x*z)*Q,e[9]=(m*R-M*S-x*o)*Q,e[10]=(M*g-d*R+x*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=a*k-k*L,e[1]=c*y-y*k,e[2]=i*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*a,e[9]=r*i-n*c,e[10]=n*a-s*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],i=t[4],a=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(i*i+a*a+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){D.getScaling(E(D,H),t);let n=1/E(D,H)[0],s=1/E(D,H)[1],r=1/E(D,H)[2],i=t[0]*n,a=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,h=t[10]*r,M=i+L+h,d=0;return M>0?(d=Math.sqrt(M+1)*2,e[3]=.25*d,e[0]=(k-b)/d,e[1]=(l-c)/d,e[2]=(a-y)/d):i>L&&i>h?(d=Math.sqrt(1+i-L-h)*2,e[3]=(k-b)/d,e[0]=.25*d,e[1]=(a+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-i-h)*2,e[3]=(l-c)/d,e[0]=(a+y)/d,e[1]=.25*d,e[2]=(k+b)/d):(d=Math.sqrt(1+h-i-L)*2,e[3]=(a-y)/d,e[0]=(l+c)/d,e[1]=(k+b)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],i=s[1],a=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+i*i+a*a),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let h=1/n[0],M=1/n[1],d=1/n[2],m=r*h,x=i*M,V=a*d,o=c*h,R=y*M,z=L*d,g=k*h,S=l*M,B=b*d,N=m+R+B,p=0;return N>0?(p=Math.sqrt(N+1)*2,e[3]=.25*p,e[0]=(z-S)/p,e[1]=(g-V)/p,e[2]=(x-o)/p):m>R&&m>B?(p=Math.sqrt(1+m-R-B)*2,e[3]=(z-S)/p,e[0]=.25*p,e[1]=(x+o)/p,e[2]=(g+V)/p):R>B?(p=Math.sqrt(1+R-m-B)*2,e[3]=(g-V)/p,e[0]=(x+o)/p,e[1]=.25*p,e[2]=(z+S)/p):(p=Math.sqrt(1+B-m-R)*2,e[3]=(x-o)/p,e[0]=(g+V)/p,e[1]=(z+S)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=r+r,L=i+i,k=a+a,l=r*y,b=r*L,h=r*k,M=i*L,d=i*k,m=a*k,x=c*y,V=c*L,o=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(M+m))*R,e[1]=(b+o)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(b-o)*z,e[5]=(1-(l+m))*z,e[6]=(d+x)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-x)*g,e[10]=(1-(l+M))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let i=t[0],a=t[1],c=t[2],y=t[3],L=i+i,k=a+a,l=c+c,b=i*L,h=i*k,M=i*l,d=a*k,m=a*l,x=c*l,V=y*L,o=y*k,R=y*l,z=s[0],g=s[1],S=s[2],B=r[0],N=r[1],p=r[2],Y=(1-(d+x))*z,I=(h+R)*z,P=(M-o)*z,Q=(h-R)*g,K=(1-(b+x))*g,ee=(m+V)*g,te=(M+o)*S,be=(m-V)*S,Me=(1-(b+d))*S;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=be,e[10]=Me,e[11]=0,e[12]=n[0]+B-(Y*B+Q*N+te*p),e[13]=n[1]+N-(I*B+K*N+be*p),e[14]=n[2]+p-(P*B+ee*N+Me*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n+n,c=s+s,y=r+r,L=n*a,k=s*a,l=s*c,b=r*a,h=r*c,M=r*y,d=i*a,m=i*c,x=i*y;return e[0]=1-l-M,e[1]=k+x,e[2]=b-m,e[3]=0,e[4]=k-x,e[5]=1-L-M,e[6]=h+d,e[7]=0,e[8]=b+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=(a+i)*L,e[14]=2*a*i*L}else e[10]=-1,e[14]=-2*i;return e}static frustum(e,t,n,s,r,i,a=1/0){return e}static frustumZO(e,t,n,s,r,i,a=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=i*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let L=1/(i-a);e[10]=a*L,e[14]=a*i*L}else e[10]=-1,e[14]=-i;return e}static perspectiveNO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=(r+s)*a,e[14]=2*r*s*a}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let i=1/Math.tan(t/2);if(e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let a=1/(s-r);e[10]=r*a,e[14]=r*s*a}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(a+c),L=2/(r+i);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((a-c)*y*.5),e[9]=(r-i)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(a+i)*L,e[15]=1,e}static ortho(e,t,n,s,r,i,a){return e}static orthoZO(e,t,n,s,r,i,a){let c=1/(t-n),y=1/(s-r),L=1/(i-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=i*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(i-l)<1e-6&&Math.abs(a-b)<1e-6)return D.identity(e);let h=r-k,M=i-l,d=a-b,m=1/Math.sqrt(h*h+M*M+d*d);h*=m,M*=m,d*=m;let x=y*d-L*M,V=L*h-c*d,o=c*M-y*h;m=Math.sqrt(x*x+V*V+o*o),m?(m=1/m,x*=m,V*=m,o*=m):(x=0,V=0,o=0);let R=M*o-d*V,z=d*x-h*o,g=h*V-M*x;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=x,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=M,e[7]=0,e[8]=o,e[9]=g,e[10]=d,e[11]=0,e[12]=-(x*r+V*i+o*a),e[13]=-(R*r+z*i+g*a),e[14]=-(h*r+M*i+d*a),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=i-n[1],b=a-n[2],h=k*k+l*l+b*b;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,b*=h);let M=y*b-L*l,d=L*k-c*b,m=c*l-y*k;return h=M*M+d*d+m*m,h>0&&(h=1/Math.sqrt(h),M*=h,d*=h,m*=h),e[0]=M,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-b*d,e[5]=b*M-k*m,e[6]=k*d-l*M,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=i,e[14]=a,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],h=e[11],M=e[12],d=e[13],m=e[14],x=e[15],V=t[0],o=t[1],R=t[2],z=t[3],g=t[4],S=t[5],B=t[6],N=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-o)<=1e-6*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(i-z)<=1e-6*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(c-S)<=1e-6*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(y-B)<=1e-6*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(L-N)<=1e-6*Math.max(1,Math.abs(L),Math.abs(N))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(b-I)<=1e-6*Math.max(1,Math.abs(b),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(M-Q)<=1e-6*Math.max(1,Math.abs(M),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(x-te)<=1e-6*Math.max(1,Math.abs(x),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ie=new WeakMap,H=new WeakMap,Z(D,ie,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(D,H,new Float64Array(3));var G=D;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=n*n+s*s+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2];return e[0]=r*y-i*c,e[1]=i*a-s*y,e[2]=s*c-r*a,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),i=Math.sin(r),a=Math.sin((1-s)*r)/i,c=Math.sin(s*r)/i;return e[0]=a*t[0]+c*n[0],e[1]=a*t[1]+c*n[1],e[2]=a*t[2]+c*n[2],e}static hermite(e,t,n,s,r,i){let a=i*i,c=a*(2*i-3)+1,y=a*(i-2)+i,L=a*(i-1),k=a*(3-2*i);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,i){let a=1-i,c=a*a,y=i*i,L=c*a,k=3*i*c,l=3*y*a,b=y*i;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[3]*s+n[7]*r+n[11]*i+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*i+n[12])/a,e[1]=(n[1]*s+n[5]*r+n[9]*i+n[13])/a,e[2]=(n[2]*s+n[6]*r+n[10]*i+n[14])/a,e}static transformMat3(e,t,n){let s=t[0],r=t[1],i=t[2];return e[0]=s*n[0]+r*n[3]+i*n[6],e[1]=s*n[1]+r*n[4]+i*n[7],e[2]=s*n[2]+r*n[5]+i*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-i*y,l=i*c-s*L,b=s*y-r*c,h=(r*b-i*l)*2,M=(i*k-s*b)*2,d=(s*l-r*k)*2;return e[0]=c+k*a+h,e[1]=y+l*a+M,e[2]=L+b*a+d,e}static rotateX(e,t,n,s){let r=n[1],i=n[2],a=t[1]-r,c=t[2]-i;return e[0]=t[0],e[1]=a*Math.cos(s)-c*Math.sin(s)+r,e[2]=a*Math.sin(s)+c*Math.cos(s)+i,e}static rotateY(e,t,n,s){let r=n[0],i=n[2],a=t[0]-r,c=t[2]-i;return e[0]=c*Math.sin(s)+a*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-a*Math.sin(s)+i,e}static rotateZ(e,t,n,s){let r=n[0],i=n[1],a=t[0]-r,c=t[1]-i;return e[0]=a*Math.cos(s)-c*Math.sin(s)+r,e[1]=a*Math.sin(s)+c*Math.cos(s)+i,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(i*i+a*a+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=t[0],a=t[1],c=t[2];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.hypot(n,s,r,i)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return n*n+s*s+r*r+i*i}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=s*a,e[2]=r*a,e[3]=i*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],i=n[0]*s[2]-n[2]*s[0],a=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],h=t[3];return e[0]=l*L-b*y+h*c,e[1]=-(k*L)+b*a-h*i,e[2]=k*y-l*a+h*r,e[3]=-(k*c)+l*i-b*r,e}static lerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e[2]=a+s*(n[2]-a),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*i+n[12]*a,e[1]=n[1]*s+n[5]*r+n[9]*i+n[13]*a,e[2]=n[2]*s+n[6]*r+n[10]*i+n[14]*a,e[3]=n[3]*s+n[7]*r+n[11]*i+n[15]*a,e}static transformQuat(e,t,n){let s=t[0],r=t[1],i=t[2],a=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*i-y*r,l=L*r+y*s-a*i,b=L*i+a*r-c*s,h=-a*s-c*r-y*i;return e[0]=k*L+h*-a+l*-y-b*-c,e[1]=l*L+h*-c+b*-a-k*-y,e[2]=b*L+h*-y+k*-c-l*-a,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(i-L)<=1e-6*Math.max(1,Math.abs(i),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ae,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n=n*.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=i*y-r*c,e[3]=a*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-i*c,e[1]=r*y+a*c,e[2]=i*y+s*c,e[3]=a*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],i=t[2],a=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=i*y+a*c,e[3]=a*y-i*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=Math.exp(i),y=a>0?c*Math.sin(a)/a:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(a),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=Math.sqrt(n*n+s*s+r*r),c=a>0?Math.atan2(a,i)/a:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+i*i),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],i=t[1],a=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,h,M=r*y+i*L+a*k+c*l;if(M<0&&(M=-M,y=-y,L=-L,k=-k,l=-l),1-M>1e-6){let d=Math.acos(M),m=Math.sin(d);b=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else b=1-s,h=s;return e[0]=b*r+h*y,e[1]=b*i+h*L,e[2]=b*a+h*k,e[3]=b*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],i=t[3],a=n*n+s*s+r*r+i*i,c=a?1/a:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=i*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let i=(r+1)%3,a=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[i*3+i]-t[a*3+a]+1),e[r]=.5*s,s=.5/s,e[3]=(t[i*3+a]-t[a*3+i])*s,e[i]=(t[i*3+r]+t[r*3+i])*s,e[a]=(t[a*3+r]+t[r*3+a])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let i=.5*Math.PI/180;t*=i,n*=i,s*=i;let a=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"xzy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l+a*y*k;break;case\"yxz\":e[0]=a*L*l+c*y*k,e[1]=c*y*l-a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;case\"yzx\":e[0]=a*L*l+c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l-a*y*k;break;case\"zxy\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k+a*y*l,e[3]=c*L*l-a*y*k;break;case\"zyx\":e[0]=a*L*l-c*y*k,e[1]=c*y*l+a*L*k,e[2]=c*L*k-a*y*l,e[3]=c*L*l+a*y*k;break;default:throw new Error(\"Unknown angle order \"+r)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,i){return f.slerp(E(f,ae),t,r,i),f.slerp(E(f,ce),n,s,i),f.slerp(e,E(f,ae),E(f,ce),2*i*(1-i)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ae=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ae,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,i,a,c){return new j(e,t,n,s,r,i,a,c)}static fromRotationTranslationValues(e,t,n,s,r,i,a){let c=r*.5,y=i*.5,L=a*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,i=n[2]*.5,a=t[0],c=t[1],y=t[2],L=t[3];return e[0]=a,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-i*c,e[5]=r*L+i*a-s*y,e[6]=i*L+s*c-r*a,e[7]=-s*a-r*c-i*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,i,a,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=i,e[5]=a,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],i=t[7],a=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+i*a+s*y-r*c)*2,e[1]=(s*L+i*c+r*a-n*y)*2,e[2]=(r*L+i*y+n*c-s*a)*2,e}static translate(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=a*c+r*L-i*y+k,e[5]=a*y+i*c-s*L+l,e[6]=a*L+s*y-r*c+b,e[7]=-s*c-r*y-i*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateX(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateY(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],i=-t[2],a=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*a+k*s+y*i-L*r,b=y*a+k*r+L*s-c*i,h=L*a+k*i+c*r-y*s,M=k*a-c*s-y*r-L*i;return O.rotateZ(e,t,n),s=e[0],r=e[1],i=e[2],a=e[3],e[4]=l*a+M*s+b*i-h*r,e[5]=b*a+M*r+h*s-l*i,e[6]=h*a+M*i+l*r-b*s,e[7]=M*a-l*s-b*r-h*i,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],i=n[2],a=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*a+k*s+y*i-L*r,e[1]=y*a+k*r+L*s-c*i,e[2]=L*a+k*i+c*r-y*s,e[3]=k*a-c*s-y*r-L*i,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*a+k*s+y*i-L*r,e[5]=y*a+k*r+L*s-c*i,e[6]=L*a+k*i+c*r-y*s,e[7]=k*a-c*s-y*r-L*i,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+a*c+r*L-i*y,e[1]=r*k+a*y+i*c-s*L,e[2]=i*k+a*L+s*y-r*c,e[3]=a*k-s*c-r*y-i*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+a*c+r*L-i*y,e[5]=r*k+a*y+i*c-s*L,e[6]=i*k+a*L+s*y-r*c,e[7]=a*k-s*c-r*y-i*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s=s*.5;let i=Math.sin(s),a=i*n[0]/r,c=i*n[1]/r,y=i*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],h=t[3];e[0]=k*L+h*a+l*y-b*c,e[1]=l*L+h*c+b*a-k*y,e[2]=b*L+h*y+k*c-l*a,e[3]=h*L-k*a-l*c-b*y;let M=t[4],d=t[5],m=t[6],x=t[7];return e[4]=M*L+x*a+d*y-m*c,e[5]=d*L+x*c+m*a-M*y,e[6]=m*L+x*y+M*c-d*a,e[7]=x*L-M*a-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],i=t[2],a=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],h=t[6],M=t[7],d=n[0],m=n[1],x=n[2],V=n[3];return e[0]=s*V+a*d+r*x-i*m,e[1]=r*V+a*m+i*d-s*x,e[2]=i*V+a*x+s*m-r*d,e[3]=a*V-s*d-r*m-i*x,e[4]=s*k+a*c+r*L-i*y+l*V+M*d+b*x-h*m,e[5]=r*k+a*y+i*c-s*L+b*V+M*m+h*d-l*x,e[6]=i*k+a*L+s*y-r*c+h*V+M*x+l*m-b*d,e[7]=a*k-s*c-r*y-i*L+M*V-l*d-b*m-h*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,i=t[2]/n,a=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+i*L+a*k;e[0]=s,e[1]=r,e[2]=i,e[3]=a,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-i*l)/n,e[7]=(k-a*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],i=e[3],a=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],h=t[3],M=t[4],d=t[5],m=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-h)<=1e-6*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var F=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],i=t[1];return e[0]=r+s*(n[0]-r),e[1]=i+s*(n[1]-i),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],i=t[1]-n[1],a=Math.sin(s),c=Math.cos(s);return e[0]=r*c-i*a+n[0],e[1]=r*a+i*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],i=t[1],a=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+i*i),c=a&&(n*r+s*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],i=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))}static str(e){return`Vec2(${e.join(\", \")})`}};F.prototype.sub=F.prototype.subtract;F.prototype.mul=F.prototype.multiply;F.prototype.div=F.prototype.divide;F.prototype.dist=F.prototype.distance;F.prototype.sqrDist=F.prototype.squaredDistance;F.sub=F.subtract;F.mul=F.multiply;F.div=F.divide;F.dist=F.distance;F.sqrDist=F.squaredDistance;F.sqrLen=F.squaredLength;F.mag=F.magnitude;F.length=F.magnitude;F.len=F.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new F(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}}for(let r of A){let i=s(r);Object.defineProperty(F.prototype,r,{get:i}),Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of e){let i=s(r);Object.defineProperty(T.prototype,r,{get:i}),Object.defineProperty(q.prototype,r,{get:i})}for(let r of t){let i=s(r);Object.defineProperty(q.prototype,r,{get:i})}me=!0}var oe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*oe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,F as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","i","a","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAoF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float64Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[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I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float64Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*xe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..ac866d32 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,81 @@ +import typescriptEslint from 'typescript-eslint'; + +/** @type {import('eslint').Linter.FlatConfig[]} */ +export default [ + { + ignores: ['coverage/*', 'dist/*', 'dist-cdn/*', 'docs/*'], + }, + ...typescriptEslint.config({ + files: ['src/**/*.ts', 'tests/**/*.ts'], + extends: [ + ...typescriptEslint.configs.recommendedTypeChecked, + ...typescriptEslint.configs.stylisticTypeChecked, + ], + languageOptions: { + parserOptions: { + allowAutomaticSingleRunInference: true, + projectService: true, + }, + }, + plugins: { + '@typescript-eslint': typescriptEslint.plugin, + }, + rules: { + // Styling + 'array-bracket-spacing': 'error', + 'block-spacing': 'error', + 'brace-style': ['error', '1tbs', { 'allowSingleLine': true }], + 'comma-spacing': 'error', + 'comma-style': 'error', + 'curly': 'error', + 'indent': ['error', 2, { 'SwitchCase': 1 }], + 'key-spacing': 'error', + 'keyword-spacing': 'error', + 'new-parens': 'error', + 'no-multiple-empty-lines': 'error', + 'no-spaced-func': 'error', + 'object-curly-spacing': ['error', 'always'], + 'operator-assignment': ['error', 'always'], + 'operator-linebreak': ['error', 'after'], + 'semi': 'error', + 'space-before-blocks': 'error', + 'space-before-function-paren': ['error', { + 'anonymous': 'never', + 'named': 'never', + 'asyncArrow': 'ignore' + }], + 'space-in-parens': 'error', + 'space-infix-ops': 'error', + 'space-unary-ops': ['error', { 'words': true, 'nonwords': false }], + 'spaced-comment': ['error', 'always'], + 'wrap-regex': 'error', + + 'max-len': ['error', { 'code': 120 }], + 'quotes': ['error', 'single', 'avoid-escape'], + 'quote-props': ['error', 'as-needed', { 'unnecessary': true }], + + // ESM + 'arrow-body-style': 'off', + 'arrow-parens': ['error', 'always'], + 'arrow-spacing': 'error', + 'constructor-super': 'error', + 'generator-star-spacing': ['error', { 'before': true, 'after': false }], + 'no-class-assign': 'error', + 'no-const-assign': 'error', + 'no-dupe-class-members': 'error', + 'no-this-before-super': 'error', + 'no-useless-constructor': 'error', + 'no-var': 'error', + 'object-shorthand': ['error', 'properties'], + 'prefer-arrow-callback': 'error', + 'prefer-const': 'error', + 'prefer-spread': 'error', + 'prefer-template': 'error', + 'require-yield': 'error', + + '@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }], + '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/restrict-template-expressions': 'off', + } + }) +]; diff --git a/package-lock.json b/package-lock.json index 0d1608dc..fab68f9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,9 +17,11 @@ "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.6.0", "esbuild": "^0.21.0", + "eslint": "^9.5.0", "rollup": "^4.18.0", "typedoc": "0.25.12", "typescript": "^5.4.0", + "typescript-eslint": "rc-v8", "vitest": "^1.6.0" } }, @@ -2106,6 +2108,179 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", + "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", + "integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", + "dev": true, + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", + "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -2565,6 +2740,134 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0-alpha.30.tgz", + "integrity": "sha512-2CBUupdkfbE3eATph4QeZejvT+M+1bVur+zXlVx09WN31phap51ps/qemeclnCbGEz6kTgBDmScrr9XmmF8/Pg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.0.0-alpha.30", + "@typescript-eslint/type-utils": "8.0.0-alpha.30", + "@typescript-eslint/utils": "8.0.0-alpha.30", + "@typescript-eslint/visitor-keys": "8.0.0-alpha.30", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0-alpha.30.tgz", + "integrity": "sha512-tAYgFmgXU1MlCK3nbblUvJlDSibBvxtAQXGrF3IG0KmnRza9FXILZifHWL0rrwacDn40K53K607Fk2QkMjiGgw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.0.0-alpha.30", + "@typescript-eslint/types": "8.0.0-alpha.30", + "@typescript-eslint/typescript-estree": "8.0.0-alpha.30", + "@typescript-eslint/visitor-keys": "8.0.0-alpha.30", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", + "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.0-alpha.30.tgz", + "integrity": "sha512-FGW/iPWGyPFamAVZ60oCAthMqQrqafUGebF8UKuq/ha+e9SVG6YhJoRzurlQXOVf8dHfOhJ0ADMXyFnMc53clg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.0-alpha.30", + "@typescript-eslint/visitor-keys": "8.0.0-alpha.30" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", + "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.0-alpha.30.tgz", + "integrity": "sha512-FrnhlCKEKZKRbpDviHkIU9tayIUGTOfa+SjvrRv6p/AJIUv6QT8oRboRjLH/cCuwUEbM0k5UtRWYug4albHUqQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.0.0-alpha.30", + "@typescript-eslint/utils": "8.0.0-alpha.30", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@typescript-eslint/types": { "version": "7.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.1.tgz", @@ -2578,6 +2881,136 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.0-alpha.30.tgz", + "integrity": "sha512-WSXbc9ZcXI+7yC+6q95u77i8FXz6HOLsw3ST+vMUlFy1lFbXyFL/3e6HDKQCm2Clt0krnoCPiTGvIn+GkYPn4Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.0-alpha.30", + "@typescript-eslint/visitor-keys": "8.0.0-alpha.30", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", + "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.0-alpha.30.tgz", + "integrity": "sha512-rfhqfLqFyXhHNDwMnHiVGxl/Z2q/3guQ1jLlGQ0hi9Rb7inmwz42crM+NnLPR+2vEnwyw1P/g7fnQgQ3qvFx4g==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.0.0-alpha.30", + "@typescript-eslint/types": "8.0.0-alpha.30", + "@typescript-eslint/typescript-estree": "8.0.0-alpha.30" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", + "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.0-alpha.30.tgz", + "integrity": "sha512-XZuNurZxBqmr6ZIRIwWFq7j5RZd6ZlkId/HZEWyfciK+CWoyOxSF9Pv2VXH9Rlu2ZG2PfbhLz2Veszl4Pfn7yA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.0-alpha.30", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", + "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@typhonjs-build-test/esm-d-ts": { "version": "0.3.0-next.7", "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", @@ -2872,6 +3305,15 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.3.3", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", @@ -2884,6 +3326,22 @@ "node": ">=0.4.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -2914,6 +3372,21 @@ "node": ">=4" } }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -3036,6 +3509,15 @@ "node": ">=8" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001636", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz", @@ -3279,6 +3761,12 @@ "node": ">=6" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -3288,6 +3776,18 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -3432,7 +3932,240 @@ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", + "integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/config-array": "^0.16.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.5.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.0.1", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/eslint-scope": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", + "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "dev": true, + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { @@ -3447,6 +4180,18 @@ "node": ">=0.10" } }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", @@ -3494,6 +4239,12 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -3510,6 +4261,18 @@ "node": ">=8.6.0" } }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -3525,6 +4288,18 @@ "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", "dev": true }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -3537,6 +4312,35 @@ "node": ">=8" } }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -3682,12 +4486,47 @@ "node": ">=4" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3743,6 +4582,31 @@ "node": ">=16.17.0" } }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/import-meta-resolve": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", @@ -3753,6 +4617,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -3824,6 +4697,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -3937,6 +4819,18 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/jsdoc-type-pratt-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", @@ -3958,6 +4852,24 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -3988,6 +4900,28 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/local-pkg": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", @@ -4004,12 +4938,33 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -4226,6 +5181,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/node-releases": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", @@ -4295,6 +5256,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", @@ -4310,12 +5288,66 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", "dev": true }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -4347,6 +5379,15 @@ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", "dev": true }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -4396,6 +5437,15 @@ "node": "14 || >=16.14" } }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -4468,6 +5518,15 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/prettier": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", @@ -4509,6 +5568,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4623,6 +5691,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -4949,6 +6026,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-literal": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", @@ -5048,6 +6137,12 @@ "node": "*" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/tinybench": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", @@ -5102,6 +6197,18 @@ "node": ">=6" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-morph": { "version": "22.0.0", "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", @@ -5112,6 +6219,18 @@ "code-block-writer": "^13.0.1" } }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5167,6 +6286,29 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.0.0-alpha.30", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.0.0-alpha.30.tgz", + "integrity": "sha512-/vGhBMsK1TpadQh1eQ02c5pyiPGmKR9cVzX5C9plZ+LC0HPLpWoJbbTVfQN7BkIK7tUxDt2BFr3pFL5hDDrx7g==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.0.0-alpha.30", + "@typescript-eslint/parser": "8.0.0-alpha.30", + "@typescript-eslint/utils": "8.0.0-alpha.30" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/ufo": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", @@ -5262,6 +6404,15 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/vite": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.1.tgz", @@ -5447,6 +6598,15 @@ "node": ">=8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", diff --git a/package.json b/package.json index 28cc1e4f..ffb30819 100644 --- a/package.json +++ b/package.json @@ -124,11 +124,11 @@ "build-all": "npm run build && npm run types && npm run docs && npm run docs-cdn", "docs": "typedoc-pkg --api-link es", "docs-cdn": "typedoc-pkg --api-link es --output docs/cdn --typedoc typedoc-cdn.json", + "eslint": "eslint .", "gen64": "node scripts/gen-f64.js", "test": "vitest run", "test-ui": "vitest --ui --coverage", - "types": "esm-d-ts gen -c", - "build-test": "node scripts/test-build.js" + "types": "esm-d-ts gen -c" }, "devDependencies": { "@babel/core": "^7.24.7", @@ -139,9 +139,11 @@ "@vitest/coverage-v8": "^1.6.0", "@vitest/ui": "^1.6.0", "esbuild": "^0.21.0", + "eslint": "^9.5.0", "rollup": "^4.18.0", "typedoc": "0.25.12", "typescript": "^5.4.0", + "typescript-eslint": "rc-v8", "vitest": "^1.6.0" } } diff --git a/scripts/gen-swizzle.js b/scripts/gen-swizzle.js index 6610839c..a11785f8 100644 --- a/scripts/gen-swizzle.js +++ b/scripts/gen-swizzle.js @@ -73,7 +73,7 @@ for (const vecSize of VEC_COMPONENT_COUNTS) { describe('${vecType}().${name}', () => { it('should return ${outType}(${argNames})', () => expect(v.${name}).toBeVec(${args})); it('should be return a copy', () => { - let sw = v.${name}; + const sw = v.${name}; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); @@ -105,7 +105,7 @@ const swizzleTypeAlias = { const accessorDocs = (length) => { return ` /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec${length} */`; }; diff --git a/src/_lib/f32/Mat2.ts b/src/_lib/f32/Mat2.ts index faf9bf9c..71a25bff 100644 --- a/src/_lib/f32/Mat2.ts +++ b/src/_lib/f32/Mat2.ts @@ -16,8 +16,8 @@ export class Mat2 extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 4: super(values); break; case 2: @@ -37,9 +37,9 @@ export class Mat2 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -51,9 +51,9 @@ export class Mat2 extends Float32Array { return Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. @@ -95,7 +95,7 @@ export class Mat2 extends Float32Array { * Alias for {@link Mat2.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} @@ -143,9 +143,9 @@ export class Mat2 extends Float32Array { return Mat2.rotate(this, this, rad) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -156,9 +156,9 @@ export class Mat2 extends Float32Array { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} @@ -251,7 +251,7 @@ export class Mat2 extends Float32Array { // If we are transposing ourselves we can skip a few steps but have to cache // some values if (out === a) { - let a1 = a[1]; + const a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { @@ -270,7 +270,7 @@ export class Mat2 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null { const a0 = a[0]; @@ -361,6 +361,7 @@ export class Mat2 extends Float32Array { * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; } /** @@ -387,11 +388,11 @@ export class Mat2 extends Float32Array { out[3] = a1 * b2 + a3 * b3; return out; } - /** * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; } /** @@ -540,7 +541,8 @@ export class Mat2 extends Float32Array { * @param a - the input matrix to factorize */ - static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) { + static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly): + [Mat2Like, Readonly, Mat2Like] { L[2] = a[2] / a[0]; U[0] = a[0]; U[1] = a[1]; @@ -605,7 +607,7 @@ export class Mat2 extends Float32Array { } // Instance method alias assignments -Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Mat2.mul = Mat2.multiply; diff --git a/src/_lib/f32/Mat2d.ts b/src/_lib/f32/Mat2d.ts index 0d374f9f..937b99cf 100644 --- a/src/_lib/f32/Mat2d.ts +++ b/src/_lib/f32/Mat2d.ts @@ -17,8 +17,8 @@ export class Mat2d extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 6: super(values); break; case 2: @@ -39,9 +39,9 @@ export class Mat2d extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -53,9 +53,9 @@ export class Mat2d extends Float32Array { return Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. @@ -99,7 +99,7 @@ export class Mat2d extends Float32Array { * Alias for {@link Mat2d.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector @@ -137,9 +137,9 @@ export class Mat2d extends Float32Array { return Mat2d.scale(this, this, v) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -150,9 +150,9 @@ export class Mat2d extends Float32Array { return 6 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} @@ -245,7 +245,7 @@ export class Mat2d extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null { const aa = a[0]; @@ -323,6 +323,7 @@ export class Mat2d extends Float32Array { * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; } /** @@ -360,6 +361,7 @@ export class Mat2d extends Float32Array { * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; } /** @@ -448,9 +450,10 @@ export class Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -470,9 +473,10 @@ export class Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -494,9 +498,10 @@ export class Mat2d extends Float32Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -553,7 +558,8 @@ export class Mat2d extends Float32Array { * @param scale - the amount to scale b's elements by before adding * @returns `out` */ - static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike { + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): + Mat2dLike { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; @@ -564,7 +570,7 @@ export class Mat2d extends Float32Array { } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -583,7 +589,7 @@ export class Mat2d extends Float32Array { } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. diff --git a/src/_lib/f32/Mat3.ts b/src/_lib/f32/Mat3.ts index e774deb0..4f7ad7cf 100644 --- a/src/_lib/f32/Mat3.ts +++ b/src/_lib/f32/Mat3.ts @@ -17,8 +17,8 @@ export class Mat3 extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 9: super(values); break; case 2: @@ -39,9 +39,9 @@ export class Mat3 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -53,9 +53,9 @@ export class Mat3 extends Float32Array { return Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. @@ -99,7 +99,7 @@ export class Mat3 extends Float32Array { * Alias for {@link Mat3.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} @@ -159,9 +159,9 @@ export class Mat3 extends Float32Array { return Mat3.scale(this, this, v) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -172,9 +172,9 @@ export class Mat3 extends Float32Array { return 9 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} @@ -311,7 +311,7 @@ export class Mat3 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null { const a00 = a[0], @@ -452,6 +452,7 @@ export class Mat3 extends Float32Array { * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; } /** @@ -501,6 +502,7 @@ export class Mat3 extends Float32Array { * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; } /** @@ -605,9 +607,10 @@ export class Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -660,9 +663,10 @@ export class Mat3 extends Float32Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -778,7 +782,7 @@ export class Mat3 extends Float32Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null { const a00 = a[0]; @@ -963,7 +967,7 @@ export class Mat3 extends Float32Array { } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -985,7 +989,7 @@ export class Mat3 extends Float32Array { } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1039,7 +1043,7 @@ export class Mat3 extends Float32Array { } // Instance method alias assignments -Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Mat3.mul = Mat3.multiply; diff --git a/src/_lib/f32/Mat4.ts b/src/_lib/f32/Mat4.ts index 8e893659..7505375c 100644 --- a/src/_lib/f32/Mat4.ts +++ b/src/_lib/f32/Mat4.ts @@ -24,8 +24,8 @@ export class Mat4 extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 16: super(values); break; case 2: @@ -47,9 +47,9 @@ export class Mat4 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -61,9 +61,9 @@ export class Mat4 extends Float32Array { return Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. @@ -105,7 +105,7 @@ export class Mat4 extends Float32Array { * Alias for {@link Mat4.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} @@ -276,9 +276,9 @@ export class Mat4 extends Float32Array { return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -289,9 +289,9 @@ export class Mat4 extends Float32Array { return 16 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} @@ -388,7 +388,7 @@ export class Mat4 extends Float32Array { * @param out - The receiving Matrix * @returns `out` */ - static identity(out: Mat4Like): Mat4Like { + static identity(out: Mat4Like): Mat4Like { out[0] = 1; out[1] = 0; out[2] = 0; @@ -466,7 +466,7 @@ export class Mat4 extends Float32Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null { const a00 = a[0], @@ -696,6 +696,7 @@ export class Mat4 extends Float32Array { * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; } /** @@ -873,16 +874,16 @@ export class Mat4 extends Float32Array { * @returns `out` */ static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { // If the source and destination differ, copy the unchanged rows @@ -918,16 +919,16 @@ export class Mat4 extends Float32Array { * @returns `out` */ static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { // If the source and destination differ, copy the unchanged rows @@ -963,16 +964,16 @@ export class Mat4 extends Float32Array { * @returns `out` */ static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; if (a !== out) { // If the source and destination differ, copy the unchanged last row @@ -1001,9 +1002,10 @@ export class Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1033,9 +1035,10 @@ export class Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1065,9 +1068,10 @@ export class Mat4 extends Float32Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1117,9 +1121,10 @@ export class Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1127,8 +1132,8 @@ export class Mat4 extends Float32Array { * @returns `out` */ static fromXRotation(out: Mat4Like, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = 1; @@ -1153,9 +1158,10 @@ export class Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1163,8 +1169,8 @@ export class Mat4 extends Float32Array { * @returns `out` */ static fromYRotation(out: Mat4Like, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = c; @@ -1189,9 +1195,10 @@ export class Mat4 extends Float32Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1225,12 +1232,13 @@ export class Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1296,8 +1304,9 @@ export class Mat4 extends Float32Array { const az = a[6]; const aw = a[7]; - let magnitude = bx * bx + by * by + bz * bz + bw * bw; - //Only scale if it makes sense + const magnitude = bx * bx + by * by + bz * bz + bw * bw; + + // Only scale if it makes sense if (magnitude > 0) { Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude; Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude; @@ -1317,7 +1326,7 @@ export class Mat4 extends Float32Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null { const a00 = a[0]; @@ -1619,13 +1628,14 @@ export class Mat4 extends Float32Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1634,7 +1644,8 @@ export class Mat4 extends Float32Array { * @param s - Scaling vector * @returns `out` */ - static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like { + static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, + s: Readonly): Mat4Like { // Quaternion math const x = q[0]; const y = q[1]; @@ -1678,17 +1689,18 @@ export class Mat4 extends Float32Array { } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1698,7 +1710,8 @@ export class Mat4 extends Float32Array { * @param o - The origin vector around which to scale and rotate * @returns `out` */ - static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like { + static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, + s: Readonly, o: Readonly): Mat4Like { // Quaternion math const x = q[0]; const y = q[1]; @@ -1822,7 +1835,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { + static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far = Infinity): Mat4Like { const rl = 1 / (right - left); const tb = 1 / (top - bottom); out[0] = near * 2 * rl; @@ -1856,7 +1870,8 @@ export class Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly */ - static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; } + static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds @@ -1874,7 +1889,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { + static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far = Infinity): Mat4Like { const rl = 1 / (right - left); const tb = 1 / (top - bottom); out[0] = near * 2 * rl; @@ -1917,7 +1933,7 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like { const f = 1.0 / Math.tan(fovy / 2); out[0] = f / aspect; out[1] = 0; @@ -1949,7 +1965,10 @@ export class Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ - static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like { + return out; + } /** * Generates a perspective projection matrix suitable for WebGPU with the given bounds. @@ -1965,7 +1984,7 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like { const f = 1.0 / Math.tan(fovy / 2); out[0] = f / aspect; out[1] = 0; @@ -1993,9 +2012,8 @@ export class Mat4 extends Float32Array { } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2005,7 +2023,10 @@ export class Mat4 extends Float32Array { * @returns `out` * @deprecated */ - static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like { + static perspectiveFromFieldOfView(out: Mat4Like, + fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number, + far: number): Mat4Like { + const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0); const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0); const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0); @@ -2033,9 +2054,8 @@ export class Mat4 extends Float32Array { } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2047,7 +2067,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum * @returns `out` */ - static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { + static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far: number): Mat4Like { const lr = 1 / (left - right); const bt = 1 / (bottom - top); const nf = 1 / (near - far); @@ -2075,12 +2096,15 @@ export class Mat4 extends Float32Array { * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ - static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): + Mat4Like { + return out; + } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2092,7 +2116,8 @@ export class Mat4 extends Float32Array { * @param far - Far bound of the frustum * @returns `out` */ - static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { + static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far: number): Mat4Like { const lr = 1 / (left - right); const bt = 1 / (bottom - top); const nf = 1 / (near - far); @@ -2116,8 +2141,8 @@ export class Mat4 extends Float32Array { } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2215,7 +2240,8 @@ export class Mat4 extends Float32Array { * @param up - vec3 pointing up * @returns `out` */ - static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like { + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): + Mat4Like { const eyex = eye[0]; const eyey = eye[1]; const eyez = eye[2]; @@ -2351,10 +2377,12 @@ export class Mat4 extends Float32Array { out[15] = a[15] - b[15]; return out; } + /** * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; } /** @@ -2417,7 +2445,7 @@ export class Mat4 extends Float32Array { } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2446,7 +2474,7 @@ export class Mat4 extends Float32Array { } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2521,7 +2549,7 @@ export class Mat4 extends Float32Array { } // Instance method alias assignments -Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Mat4.sub = Mat4.subtract; diff --git a/src/_lib/f32/Quat.ts b/src/_lib/f32/Quat.ts index 75ea911c..6bb53344 100644 --- a/src/_lib/f32/Quat.ts +++ b/src/_lib/f32/Quat.ts @@ -26,8 +26,8 @@ export class Quat extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 4: super(values); break; case 2: @@ -48,9 +48,9 @@ export class Quat extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -117,9 +117,9 @@ export class Quat extends Float32Array { return Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. @@ -164,7 +164,7 @@ export class Quat extends Float32Array { * Alias for {@link Quat.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis @@ -241,9 +241,9 @@ export class Quat extends Float32Array { return Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -254,9 +254,9 @@ export class Quat extends Float32Array { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat @@ -294,7 +294,7 @@ export class Quat extends Float32Array { * @returns `out` **/ static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike { - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -307,7 +307,7 @@ export class Quat extends Float32Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -349,7 +349,7 @@ export class Quat extends Float32Array { } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -605,7 +605,7 @@ export class Quat extends Float32Array { * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -649,7 +649,7 @@ export class Quat extends Float32Array { /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -668,7 +668,7 @@ export class Quat extends Float32Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -692,10 +692,10 @@ export class Quat extends Float32Array { } else { // |w| <= 1/2 let i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - let j = (i + 1) % 3; - let k = (i + 2) % 3; + if (m[4] > m[0]) { i = 1; } + if (m[8] > m[i * 3 + i]) { i = 2; } + const j = (i + 1) % 3; + const k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); out[i] = 0.5 * fRoot; @@ -720,17 +720,17 @@ export class Quat extends Float32Array { * @returns `out` */ static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike { - let halfToRad = (0.5 * Math.PI) / 180.0; + const halfToRad = (0.5 * Math.PI) / 180.0; x *= halfToRad; y *= halfToRad; z *= halfToRad; - let sx = Math.sin(x); - let cx = Math.cos(x); - let sy = Math.sin(y); - let cy = Math.cos(y); - let sz = Math.sin(z); - let cz = Math.cos(z); + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); switch (order) { case 'xyz': @@ -776,7 +776,7 @@ export class Quat extends Float32Array { break; default: - throw new Error('Unknown angle order ' + order); + throw new Error(`Unknown angle order ${order}`); } return out; @@ -845,6 +845,7 @@ export class Quat extends Float32Array { * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; } /** @@ -856,12 +857,14 @@ export class Quat extends Float32Array { * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; } /** * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; } /** @@ -903,7 +906,8 @@ export class Quat extends Float32Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; } /** * Calculates the magnitude (length) of a {@link Quat} @@ -912,12 +916,14 @@ export class Quat extends Float32Array { * @param a - quaternion to calculate length of * @returns length of `a` */ - static magnitude(a: Readonly): number { return 0; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static magnitude(a: Readonly): number { return 0; } /** * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mag(a: Readonly): number { return 0; } /** @@ -925,15 +931,15 @@ export class Quat extends Float32Array { * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static * @deprecated Use {@link Quat.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} @@ -942,13 +948,14 @@ export class Quat extends Float32Array { * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a: Readonly): number { return 0; } /** * Alias for {@link Quat.squaredLength} * @category Static */ - static sqrLen(a: Readonly): number { return 0; } + static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} @@ -958,26 +965,29 @@ export class Quat extends Float32Array { * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static normalize(out: QuatLike, a: Readonly): QuatLike { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static exactEquals(a: Readonly, b: Readonly): boolean { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static equals(a: Readonly, b: Readonly): boolean { return false; } /** @@ -993,10 +1003,11 @@ export class Quat extends Float32Array { * @returns `out` */ static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike { - let dot = Vec3.dot(a, b); + const dot = Vec3.dot(a, b); + if (dot < -0.999999) { Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a); - if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); + if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); } Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3); Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI); return out; @@ -1028,7 +1039,8 @@ export class Quat extends Float32Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike { + static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, + d: Readonly, t: number): QuatLike { Quat.slerp(Quat.#TMP_QUAT1, a, d, t); Quat.slerp(Quat.#TMP_QUAT2, b, c, t); Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t)); @@ -1077,7 +1089,7 @@ Quat.equals = Vec4.equals; Quat.magnitude = Vec4.magnitude; // Instance method alias assignments -Quat.prototype.mul = Quat.prototype.multiply; +Quat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Quat.mul = Quat.multiply; diff --git a/src/_lib/f32/Quat2.ts b/src/_lib/f32/Quat2.ts index 21330bf0..f8706911 100644 --- a/src/_lib/f32/Quat2.ts +++ b/src/_lib/f32/Quat2.ts @@ -19,8 +19,8 @@ export class Quat2 extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 8: super(values); break; case 2: @@ -41,9 +41,9 @@ export class Quat2 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -55,9 +55,9 @@ export class Quat2 extends Float32Array { return Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. @@ -71,9 +71,9 @@ export class Quat2 extends Float32Array { return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -84,9 +84,9 @@ export class Quat2 extends Float32Array { return 8 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} @@ -124,7 +124,7 @@ export class Quat2 extends Float32Array { * @returns a new dual quaternion */ static fromValues(x1: number, y1: number, z1: number, w1: number, - x2: number, y2: number, z2: number, w2: number): Quat2 { + x2: number, y2: number, z2: number, w2: number): Quat2 { return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2); } @@ -142,7 +142,7 @@ export class Quat2 extends Float32Array { * @returns a new dual quaternion */ static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number, - x2: number, y2: number, z2: number): Quat2 { + x2: number, y2: number, z2: number): Quat2 { const ax = x2 * 0.5; const ay = y2 * 0.5; const az = z2 * 0.5; @@ -151,7 +151,7 @@ export class Quat2 extends Float32Array { ax * w1 + ay * z1 - az * y1, ay * w1 + az * x1 - ax * z1, az * w1 + ax * y1 - ay * x1, - -ax * x1 - ay * y1 - az * z1); + -ax * x1 - ay * y1 - az * z1); } /** @@ -291,7 +291,7 @@ export class Quat2 extends Float32Array { * @returns `out` */ static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number, - x2: number, y2: number, z2: number, w2: number): Quat2Like { + x2: number, y2: number, z2: number, w2: number): Quat2Like { out[0] = x1; out[1] = y1; out[2] = z1; @@ -603,13 +603,13 @@ export class Quat2 extends Float32Array { * @returns `out` */ static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like { - //Special case for rad = 0 + // Special case for rad = 0 if (Math.abs(rad) < GLM_EPSILON) { return Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); const bx = (s * axis[0]) / axisLength; const by = (s * axis[1]) / axisLength; @@ -731,6 +731,7 @@ export class Quat2 extends Float32Array { * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; } /** @@ -762,6 +763,7 @@ export class Quat2 extends Float32Array { * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dot(a: Readonly, b: Readonly): number { return 0; } /** @@ -777,7 +779,7 @@ export class Quat2 extends Float32Array { */ static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like { const mt = 1 - t; - if (Quat2.dot(a, b) < 0) t = -t; + if (Quat2.dot(a, b) < 0) { t = -t; } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; @@ -813,8 +815,8 @@ export class Quat2 extends Float32Array { } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -840,28 +842,29 @@ export class Quat2 extends Float32Array { * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a: Readonly): number { return 0; } /** * Alias for {@link Quat2.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} @@ -870,13 +873,14 @@ export class Quat2 extends Float32Array { * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a: Readonly): number { return 0; } /** * Alias for {@link Quat2.squaredLength} * @category Static */ - static sqrLen(a: Readonly): number { return 0; } + static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} @@ -928,7 +932,7 @@ export class Quat2 extends Float32Array { } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -949,7 +953,7 @@ export class Quat2 extends Float32Array { } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -987,17 +991,17 @@ export class Quat2 extends Float32Array { } // Methods which re-use the Quat implementation -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.dot = Quat.dot; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.squaredLength = Quat.squaredLength; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.sqrLen = Quat.squaredLength; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.mag = Quat.magnitude; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.length = Quat.magnitude; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.len = Quat.magnitude; // Static method alias assignments diff --git a/src/_lib/f32/Vec2.ts b/src/_lib/f32/Vec2.ts index 9d25a672..1b445650 100644 --- a/src/_lib/f32/Vec2.ts +++ b/src/_lib/f32/Vec2.ts @@ -11,12 +11,12 @@ export class Vec2 extends Float32Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 2:{ const v = values[0]; if (typeof v === 'number') { - super([v, values[1]]); + super([v, values[1]!]); } else { super(v as ArrayBufferLike, values[1], 2); } @@ -36,9 +36,9 @@ export class Vec2 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -123,9 +123,9 @@ export class Vec2 extends Float32Array { return Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. @@ -173,7 +173,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.subtract} * @category Methods */ - sub(b: Readonly): this { return this; } + sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. @@ -193,7 +193,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. @@ -213,7 +213,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.divide} * @category Methods */ - div(b: Readonly): this { return this; } + div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. @@ -259,7 +259,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Methods */ - dist(b: Readonly): number { return 0; } + dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. @@ -276,7 +276,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.squaredDistance} * @category Methods */ - sqrDist(b: Readonly): number { return 0; } + sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. @@ -336,13 +336,13 @@ export class Vec2 extends Float32Array { * * @returns `this` */ - normalize(): this { + normalize(): this { return Vec2.normalize(this, this) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -353,9 +353,9 @@ export class Vec2 extends Float32Array { return 2 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} @@ -386,7 +386,7 @@ export class Vec2 extends Float32Array { * @param y - Y component * @returns A new 2D vector */ - static fromValues(x: number, y: number): Vec2 { + static fromValues(x: number, y: number): Vec2 { return new Vec2(x, y); } @@ -453,6 +453,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } /** @@ -474,7 +475,8 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.multiply} * @category Static */ - static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } /** * Divides two {@link Vec2}s @@ -495,6 +497,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } /** @@ -616,6 +619,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a: Readonly, b: Readonly): number { return 0; } /** @@ -636,7 +640,8 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.distance} * @category Static */ - static sqrDist(a: Readonly, b: Readonly): number { return 0; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a: Readonly, b: Readonly): number { return 0; } /** * Calculates the magnitude (length) of a {@link Vec2} @@ -646,15 +651,17 @@ export class Vec2 extends Float32Array { * @returns Magnitude of a */ static magnitude(a: Readonly): number { - let x = a[0]; - let y = a[1]; + const x = a[0]; + const y = a[1]; return Math.sqrt(x * x + y * y); } + /** * Alias for {@link Vec2.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars + /** * Alias for {@link Vec2.magnitude} * @category Static @@ -663,14 +670,15 @@ export class Vec2 extends Float32Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars + /** * Alias for {@link Vec2.magnitude} * @category Static * @deprecated Use {@link Vec2.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} @@ -689,6 +697,7 @@ export class Vec2 extends Float32Array { * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a: Readonly, b: Readonly): number { return 0; } /** @@ -746,7 +755,7 @@ export class Vec2 extends Float32Array { const y = a[1]; let len = x * x + y * y; if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? + // TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); } out[0] = a[0] * len; @@ -884,13 +893,13 @@ export class Vec2 extends Float32Array { * @returns `out` */ static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like { - //Translate point to the origin + // 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 + // perform rotation and translate to correct position out[0] = p0 * cosC - p1 * sinC + b[0]; out[1] = p0 * sinC + p1 * cosC + b[1]; @@ -932,7 +941,7 @@ export class Vec2 extends Float32Array { } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -944,7 +953,7 @@ export class Vec2 extends Float32Array { } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -969,17 +978,17 @@ export class Vec2 extends Float32Array { * @param a - Vector to represent as a string * @returns String representation of the vector */ - static str(a: Readonly): string { + static str(a: Readonly): string { return `Vec2(${a.join(', ')})`; } } // Instance method alias assignments -Vec2.prototype.sub = Vec2.prototype.subtract; -Vec2.prototype.mul = Vec2.prototype.multiply; -Vec2.prototype.div = Vec2.prototype.divide; -Vec2.prototype.dist = Vec2.prototype.distance; -Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Vec2.sub = Vec2.subtract; diff --git a/src/_lib/f32/Vec3.ts b/src/_lib/f32/Vec3.ts index 720892aa..89dfb525 100644 --- a/src/_lib/f32/Vec3.ts +++ b/src/_lib/f32/Vec3.ts @@ -2,9 +2,9 @@ import { GLM_EPSILON } from '#gl-matrix/common'; import type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types'; - /** - * 3 Dimensional Vector - */ +/** + * 3 Dimensional Vector + */ export class Vec3 extends Float32Array { /** * Create a {@link Vec3}. @@ -12,7 +12,7 @@ export class Vec3 extends Float32Array { * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + switch (values.length) { case 3: super(values); break; case 2: @@ -31,9 +31,9 @@ export class Vec3 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -136,9 +136,9 @@ export class Vec3 extends Float32Array { return Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. @@ -186,7 +186,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.subtract} * @category Methods */ - sub(b: Readonly): this { return this; } + sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. @@ -207,7 +207,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. @@ -228,7 +228,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.divide} * @category Methods */ - div(b: Readonly): this { return this; } + div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. @@ -276,7 +276,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.distance} * @category Methods */ - dist(b: Readonly): number { return 0; } + dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. @@ -294,7 +294,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.squaredDistance} * @category Methods */ - sqrDist(b: Readonly): number { return 0; } + sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. @@ -357,13 +357,13 @@ export class Vec3 extends Float32Array { * * @returns `this` */ - normalize(): this { + normalize(): this { return Vec3.normalize(this, this) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -374,9 +374,9 @@ export class Vec3 extends Float32Array { return 3 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 @@ -407,16 +407,16 @@ export class Vec3 extends Float32Array { * @returns Magnitude of a */ static magnitude(a: Readonly): number { - let x = a[0]; - let y = a[1]; - let z = a[2]; + const x = a[0]; + const y = a[1]; + const z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /** * Alias for {@link Vec3.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -425,14 +425,14 @@ export class Vec3 extends Float32Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static * @deprecated Use {@link Vec3.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values @@ -515,6 +515,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; /** @@ -537,6 +538,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; } /** @@ -559,7 +561,8 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.divide} * @category Static */ - static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; /** * Math.ceil the components of a vec3 @@ -631,7 +634,8 @@ export class Vec3 extends Float32Array { * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -689,6 +693,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a: Readonly, b: Readonly): number { return 0; } /** @@ -710,6 +715,7 @@ export class Vec3 extends Float32Array { * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a: Readonly, b: Readonly): number { return 0; } /** @@ -725,10 +731,12 @@ export class Vec3 extends Float32Array { const z = a[2]; return x * x + y * y + z * z; } + /** * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a: Readonly, b: Readonly): number { return 0; } /** @@ -790,7 +798,7 @@ export class Vec3 extends Float32Array { const z = a[2]; let len = x * x + y * y + z * z; if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? + // TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); } out[0] = a[0] * len; @@ -889,7 +897,8 @@ export class Vec3 extends Float32Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like { + static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, + d: Readonly, t: number): Vec3Like { const factorTimes2 = t * t; const factor1 = factorTimes2 * (2 * t - 3) + 1; const factor2 = factorTimes2 * (t - 2) + t; @@ -915,7 +924,8 @@ export class Vec3 extends Float32Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like { + static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, + d: Readonly, t: number): Vec3Like { const inverseFactor = 1 - t; const inverseFactorTimesTwo = inverseFactor * inverseFactor; const factorTimes2 = t * t; @@ -939,7 +949,8 @@ export class Vec3 extends Float32Array { * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -983,7 +994,7 @@ export class Vec3 extends Float32Array { * @returns `out` */ static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like { - let x = a[0], + const x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; @@ -1023,9 +1034,9 @@ export class Vec3 extends Float32Array { const uuvz = (qx * uvy - qy * uvx) * 2; // vec3.scale(uv, uv, 2 * w); // return vec3.add(out, a, vec3.add(out, uv, uuv)); - out[0] = x + (uvx*w2) + uuvx; - out[1] = y + (uvy*w2) + uuvy; - out[2] = z + (uvz*w2) + uuvz; + out[0] = x + (uvx * w2) + uuvx; + out[1] = y + (uvy * w2) + uuvy; + out[2] = z + (uvz * w2) + uuvz; return out; } @@ -1043,12 +1054,12 @@ export class Vec3 extends Float32Array { const by = b[1]; const bz = b[2]; - //Translate point to the origin + // Translate point to the origin const py = a[1] - by; const pz = a[2] - bz; - //perform rotation - //translate to correct position + // perform rotation + // translate to correct position out[0] = a[0]; out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by; out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz; @@ -1070,12 +1081,12 @@ export class Vec3 extends Float32Array { const bx = b[0]; const bz = b[2]; - //Translate point to the origin + // Translate point to the origin const px = a[0] - bx; const pz = a[2] - bz; - //perform rotation - //translate to correct position + // perform rotation + // translate to correct position out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx; out[1] = a[1]; out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz; @@ -1097,12 +1108,12 @@ export class Vec3 extends Float32Array { const bx = b[0]; const by = b[1]; - //Translate point to the origin + // Translate point to the origin const px = a[0] - bx; const py = a[1] - by; - //perform rotation - //translate to correct position + // perform rotation + // translate to correct position out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx; out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by; out[2] = b[2]; @@ -1156,7 +1167,7 @@ export class Vec3 extends Float32Array { } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -1168,7 +1179,7 @@ export class Vec3 extends Float32Array { } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -1191,11 +1202,11 @@ export class Vec3 extends Float32Array { } // Instance method alias assignments -Vec3.prototype.sub = Vec3.prototype.subtract; -Vec3.prototype.mul = Vec3.prototype.multiply; -Vec3.prototype.div = Vec3.prototype.divide; -Vec3.prototype.dist = Vec3.prototype.distance; -Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Vec3.sub = Vec3.subtract; diff --git a/src/_lib/f32/Vec4.ts b/src/_lib/f32/Vec4.ts index dbe969f9..1c38b204 100644 --- a/src/_lib/f32/Vec4.ts +++ b/src/_lib/f32/Vec4.ts @@ -12,7 +12,7 @@ export class Vec4 extends Float32Array { * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + switch (values.length) { case 4: super(values); break; case 2: @@ -31,9 +31,9 @@ export class Vec4 extends Float32Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -131,9 +131,9 @@ export class Vec4 extends Float32Array { return Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. @@ -171,7 +171,7 @@ export class Vec4 extends Float32Array { * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): this { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; this[2] -= b[2]; @@ -183,7 +183,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.subtract} * @category Methods */ - sub(b: Readonly): this { return this; } + sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. @@ -205,7 +205,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. @@ -227,7 +227,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.divide} * @category Methods */ - div(b: Readonly): this { return this; } + div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. @@ -278,7 +278,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.distance} * @category Methods */ - dist(b: Readonly): number { return 0; } + dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. @@ -296,7 +296,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.squaredDistance} * @category Methods */ - sqrDist(b: Readonly): number { return 0; } + sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. @@ -366,9 +366,9 @@ export class Vec4 extends Float32Array { return Vec4.normalize(this, this) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -379,9 +379,9 @@ export class Vec4 extends Float32Array { return 4 * Float32Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} @@ -491,6 +491,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } /** @@ -514,6 +515,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } /** @@ -537,6 +539,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } /** @@ -675,6 +678,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a: Readonly, b: Readonly): number { return 0; } /** @@ -696,6 +700,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a: Readonly, b: Readonly): number { return 0; } /** @@ -716,22 +721,22 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} @@ -752,7 +757,7 @@ export class Vec4 extends Float32Array { * Alias for {@link Vec4.squaredLength} * @category Static */ - static sqrLen(a: Readonly): number { return 0; } + static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} @@ -898,7 +903,8 @@ export class Vec4 extends Float32Array { * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -1005,7 +1011,7 @@ export class Vec4 extends Float32Array { } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -1017,7 +1023,7 @@ export class Vec4 extends Float32Array { } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -1043,11 +1049,11 @@ export class Vec4 extends Float32Array { } // Instance method alias assignments -Vec4.prototype.sub = Vec4.prototype.subtract; -Vec4.prototype.mul = Vec4.prototype.multiply; -Vec4.prototype.div = Vec4.prototype.divide; -Vec4.prototype.dist = Vec4.prototype.distance; -Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Vec4.sub = Vec4.subtract; diff --git a/src/_lib/f64/Mat2.ts b/src/_lib/f64/Mat2.ts index 30e12abd..854f8e0a 100644 --- a/src/_lib/f64/Mat2.ts +++ b/src/_lib/f64/Mat2.ts @@ -16,8 +16,8 @@ export class Mat2 extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 4: super(values); break; case 2: @@ -37,9 +37,9 @@ export class Mat2 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -51,9 +51,9 @@ export class Mat2 extends Float64Array { return Mat2.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat2} into `this`. @@ -95,7 +95,7 @@ export class Mat2 extends Float64Array { * Alias for {@link Mat2.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat2} @@ -143,9 +143,9 @@ export class Mat2 extends Float64Array { return Mat2.rotate(this, this, rad) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -156,9 +156,9 @@ export class Mat2 extends Float64Array { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2} @@ -251,7 +251,7 @@ export class Mat2 extends Float64Array { // If we are transposing ourselves we can skip a few steps but have to cache // some values if (out === a) { - let a1 = a[1]; + const a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { @@ -270,7 +270,7 @@ export class Mat2 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null { const a0 = a[0]; @@ -361,6 +361,7 @@ export class Mat2 extends Float64Array { * Alias for {@link Mat2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; } /** @@ -387,11 +388,11 @@ export class Mat2 extends Float64Array { out[3] = a1 * b2 + a3 * b3; return out; } - /** * Alias for {@link Mat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; } /** @@ -540,7 +541,8 @@ export class Mat2 extends Float64Array { * @param a - the input matrix to factorize */ - static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly) { + static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly): + [Mat2Like, Readonly, Mat2Like] { L[2] = a[2] / a[0]; U[0] = a[0]; U[1] = a[1]; @@ -605,7 +607,7 @@ export class Mat2 extends Float64Array { } // Instance method alias assignments -Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Mat2.mul = Mat2.multiply; diff --git a/src/_lib/f64/Mat2d.ts b/src/_lib/f64/Mat2d.ts index 3056e3e1..22c60cfc 100644 --- a/src/_lib/f64/Mat2d.ts +++ b/src/_lib/f64/Mat2d.ts @@ -17,8 +17,8 @@ export class Mat2d extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 6: super(values); break; case 2: @@ -39,9 +39,9 @@ export class Mat2d extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -53,9 +53,9 @@ export class Mat2d extends Float64Array { return Mat2d.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Mat2d} into `this`. @@ -99,7 +99,7 @@ export class Mat2d extends Float64Array { * Alias for {@link Mat2d.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Translate this {@link Mat2d} by the given vector @@ -137,9 +137,9 @@ export class Mat2d extends Float64Array { return Mat2d.scale(this, this, v) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -150,9 +150,9 @@ export class Mat2d extends Float64Array { return 6 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat2d} @@ -245,7 +245,7 @@ export class Mat2d extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null { const aa = a[0]; @@ -323,6 +323,7 @@ export class Mat2d extends Float64Array { * Alias for {@link Mat2d.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; } /** @@ -360,6 +361,7 @@ export class Mat2d extends Float64Array { * Alias for {@link Mat2d.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; } /** @@ -448,9 +450,10 @@ export class Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector translation * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.translate(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -470,9 +473,10 @@ export class Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.rotate(dest, dest, rad); + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -494,9 +498,10 @@ export class Mat2d extends Float64Array { /** * Creates a {@link Mat2d} from a vector scaling * This is equivalent to (but much faster than): - * - * Mat2d.identity(dest); - * Mat2d.scale(dest, dest, vec); + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat2d} receiving operation result @@ -553,7 +558,8 @@ export class Mat2d extends Float64Array { * @param scale - the amount to scale b's elements by before adding * @returns `out` */ - static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike { + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): + Mat2dLike { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; @@ -564,7 +570,7 @@ export class Mat2d extends Float64Array { } /** - * Returns whether or not two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -583,7 +589,7 @@ export class Mat2d extends Float64Array { } /** - * Returns whether or not two {@link Mat2d}s have approximately the same elements in the same position. + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. diff --git a/src/_lib/f64/Mat3.ts b/src/_lib/f64/Mat3.ts index 795cbb3f..41ba759e 100644 --- a/src/_lib/f64/Mat3.ts +++ b/src/_lib/f64/Mat3.ts @@ -17,8 +17,8 @@ export class Mat3 extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 9: super(values); break; case 2: @@ -39,9 +39,9 @@ export class Mat3 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -53,9 +53,9 @@ export class Mat3 extends Float64Array { return Mat3.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat3} into `this`. @@ -99,7 +99,7 @@ export class Mat3 extends Float64Array { * Alias for {@link Mat3.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat3} @@ -159,9 +159,9 @@ export class Mat3 extends Float64Array { return Mat3.scale(this, this, v) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -172,9 +172,9 @@ export class Mat3 extends Float64Array { return 9 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat3} @@ -311,7 +311,7 @@ export class Mat3 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null { const a00 = a[0], @@ -452,6 +452,7 @@ export class Mat3 extends Float64Array { * Alias for {@link Mat3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; } /** @@ -501,6 +502,7 @@ export class Mat3 extends Float64Array { * Alias for {@link Mat3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; } /** @@ -605,9 +607,10 @@ export class Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector translation * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.translate(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -660,9 +663,10 @@ export class Mat3 extends Float64Array { /** * Creates a {@link Mat3} from a vector scaling * This is equivalent to (but much faster than): - * - * mat3.identity(dest); - * mat3.scale(dest, dest, vec); + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat3} receiving operation result @@ -778,7 +782,7 @@ export class Mat3 extends Float64Array { * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null { const a00 = a[0]; @@ -963,7 +967,7 @@ export class Mat3 extends Float64Array { } /** - * Returns whether or not two {@link Mat3}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -985,7 +989,7 @@ export class Mat3 extends Float64Array { } /** - * Returns whether or not two {@link Mat3}s have approximately the same elements in the same position. + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -1039,7 +1043,7 @@ export class Mat3 extends Float64Array { } // Instance method alias assignments -Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Mat3.mul = Mat3.multiply; diff --git a/src/_lib/f64/Mat4.ts b/src/_lib/f64/Mat4.ts index d5d6bc12..917f2c42 100644 --- a/src/_lib/f64/Mat4.ts +++ b/src/_lib/f64/Mat4.ts @@ -24,8 +24,8 @@ export class Mat4 extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[] ) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 16: super(values); break; case 2: @@ -47,9 +47,9 @@ export class Mat4 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -61,9 +61,9 @@ export class Mat4 extends Float64Array { return Mat4.str(this); } - //=================== + // =================== // Instance methods - //=================== + // =================== /** * Copy the values from another {@link Mat4} into `this`. @@ -105,7 +105,7 @@ export class Mat4 extends Float64Array { * Alias for {@link Mat4.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Transpose this {@link Mat4} @@ -276,9 +276,9 @@ export class Mat4 extends Float64Array { return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -289,9 +289,9 @@ export class Mat4 extends Float64Array { return 16 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, identity {@link Mat4} @@ -388,7 +388,7 @@ export class Mat4 extends Float64Array { * @param out - The receiving Matrix * @returns `out` */ - static identity(out: Mat4Like): Mat4Like { + static identity(out: Mat4Like): Mat4Like { out[0] = 1; out[1] = 0; out[2] = 0; @@ -466,7 +466,7 @@ export class Mat4 extends Float64Array { * * @param out - the receiving matrix * @param a - the source matrix - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null { const a00 = a[0], @@ -696,6 +696,7 @@ export class Mat4 extends Float64Array { * Alias for {@link Mat4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; } /** @@ -873,16 +874,16 @@ export class Mat4 extends Float64Array { * @returns `out` */ static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { // If the source and destination differ, copy the unchanged rows @@ -918,16 +919,16 @@ export class Mat4 extends Float64Array { * @returns `out` */ static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a20 = a[8]; - let a21 = a[9]; - let a22 = a[10]; - let a23 = a[11]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; if (a !== out) { // If the source and destination differ, copy the unchanged rows @@ -963,16 +964,16 @@ export class Mat4 extends Float64Array { * @returns `out` */ static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); - let a00 = a[0]; - let a01 = a[1]; - let a02 = a[2]; - let a03 = a[3]; - let a10 = a[4]; - let a11 = a[5]; - let a12 = a[6]; - let a13 = a[7]; + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; if (a !== out) { // If the source and destination differ, copy the unchanged last row @@ -1001,9 +1002,10 @@ export class Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1033,9 +1035,10 @@ export class Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a vector scaling * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.scale(dest, dest, vec); + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1065,9 +1068,10 @@ export class Mat4 extends Float64Array { /** * Creates a {@link Mat4} from a given angle around a given axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotate(dest, dest, rad, axis); + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` * @category Static * * @param out - {@link Mat4} receiving operation result @@ -1117,9 +1121,10 @@ export class Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateX(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1127,8 +1132,8 @@ export class Mat4 extends Float64Array { * @returns `out` */ static fromXRotation(out: Mat4Like, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = 1; @@ -1153,9 +1158,10 @@ export class Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateY(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1163,8 +1169,8 @@ export class Mat4 extends Float64Array { * @returns `out` */ static fromYRotation(out: Mat4Like, rad: number): Mat4Like { - let s = Math.sin(rad); - let c = Math.cos(rad); + const s = Math.sin(rad); + const c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = c; @@ -1189,9 +1195,10 @@ export class Mat4 extends Float64Array { /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.rotateZ(dest, dest, rad); + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1225,12 +1232,13 @@ export class Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1296,8 +1304,9 @@ export class Mat4 extends Float64Array { const az = a[6]; const aw = a[7]; - let magnitude = bx * bx + by * by + bz * bz + bw * bw; - //Only scale if it makes sense + const magnitude = bx * bx + by * by + bz * bz + bw * bw; + + // Only scale if it makes sense if (magnitude > 0) { Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude; Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude; @@ -1317,7 +1326,7 @@ export class Mat4 extends Float64Array { * * @param out - Matrix receiving operation result * @param a - Mat4 to derive the normal matrix from - * @returns `out` or `null` if the matrix is not invertable + * @returns `out` or `null` if the matrix is not invertible */ static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null { const a00 = a[0]; @@ -1619,13 +1628,14 @@ export class Mat4 extends Float64Array { /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale); + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1634,7 +1644,8 @@ export class Mat4 extends Float64Array { * @param s - Scaling vector * @returns `out` */ - static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly): Mat4Like { + static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly, + s: Readonly): Mat4Like { // Quaternion math const x = q[0]; const y = q[1]; @@ -1678,17 +1689,18 @@ export class Mat4 extends Float64Array { } /** - * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin - * This is equivalent to (but much faster than): - * - * mat4.identity(dest); - * mat4.translate(dest, vec); - * mat4.translate(dest, origin); - * let quatMat = mat4.create(); - * quat4.toMat4(quat, quatMat); - * mat4.multiply(dest, quatMat); - * mat4.scale(dest, scale) - * mat4.translate(dest, negativeOrigin); + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` * @category Static * * @param out - mat4 receiving operation result @@ -1698,7 +1710,8 @@ export class Mat4 extends Float64Array { * @param o - The origin vector around which to scale and rotate * @returns `out` */ - static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, s: Readonly, o: Readonly): Mat4Like { + static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly, + s: Readonly, o: Readonly): Mat4Like { // Quaternion math const x = q[0]; const y = q[1]; @@ -1822,7 +1835,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { + static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far = Infinity): Mat4Like { const rl = 1 / (right - left); const tb = 1 / (top - bottom); out[0] = near * 2 * rl; @@ -1856,7 +1870,8 @@ export class Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly */ - static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { return out; } + static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Generates a frustum matrix with the given bounds @@ -1874,7 +1889,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number = Infinity): Mat4Like { + static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far = Infinity): Mat4Like { const rl = 1 / (right - left); const tb = 1 / (top - bottom); out[0] = near * 2 * rl; @@ -1917,7 +1933,7 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like { const f = 1.0 / Math.tan(fovy / 2); out[0] = f / aspect; out[1] = 0; @@ -1949,7 +1965,10 @@ export class Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly */ - static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { return out; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like { + return out; + } /** * Generates a perspective projection matrix suitable for WebGPU with the given bounds. @@ -1965,7 +1984,7 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum, can be null or Infinity * @returns `out` */ - static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far: number = Infinity): Mat4Like { + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like { const f = 1.0 / Math.tan(fovy / 2); out[0] = f / aspect; out[1] = 0; @@ -1993,9 +2012,8 @@ export class Mat4 extends Float64Array { } /** - * Generates a perspective projection matrix with the given field of view. - * This is primarily useful for generating projection matrices to be used - * with the still experiemental WebVR API. + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2005,7 +2023,10 @@ export class Mat4 extends Float64Array { * @returns `out` * @deprecated */ - static perspectiveFromFieldOfView(out: Mat4Like, fov, near: number, far: number): Mat4Like { + static perspectiveFromFieldOfView(out: Mat4Like, + fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number, + far: number): Mat4Like { + const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0); const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0); const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0); @@ -2033,9 +2054,8 @@ export class Mat4 extends Float64Array { } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], - * which matches WebGL/OpenGL's clip volume. + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2047,7 +2067,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum * @returns `out` */ - static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { + static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far: number): Mat4Like { const lr = 1 / (left - right); const bt = 1 / (bottom - top); const nf = 1 / (near - far); @@ -2075,12 +2096,15 @@ export class Mat4 extends Float64Array { * @category Static * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly */ - static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { return out; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): + Mat4Like { + return out; + } /** - * Generates a orthogonal projection matrix with the given bounds. - * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], - * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2092,7 +2116,8 @@ export class Mat4 extends Float64Array { * @param far - Far bound of the frustum * @returns `out` */ - static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4Like { + static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, + far: number): Mat4Like { const lr = 1 / (left - right); const bt = 1 / (bottom - top); const nf = 1 / (near - far); @@ -2116,8 +2141,8 @@ export class Mat4 extends Float64Array { } /** - * Generates a look-at matrix with the given eye position, focal point, and up axis. - * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. * @category Static * * @param out - mat4 frustum matrix will be written into @@ -2215,7 +2240,8 @@ export class Mat4 extends Float64Array { * @param up - vec3 pointing up * @returns `out` */ - static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like { + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): + Mat4Like { const eyex = eye[0]; const eyey = eye[1]; const eyez = eye[2]; @@ -2351,10 +2377,12 @@ export class Mat4 extends Float64Array { out[15] = a[15] - b[15]; return out; } + /** * Alias for {@link Mat4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; } /** @@ -2417,7 +2445,7 @@ export class Mat4 extends Float64Array { } /** - * Returns whether or not two {@link Mat4}s have exactly the same elements in the same position (when compared with ===) + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). * @category Static * * @param a - The first matrix. @@ -2446,7 +2474,7 @@ export class Mat4 extends Float64Array { } /** - * Returns whether or not two {@link Mat4}s have approximately the same elements in the same position. + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. * @category Static * * @param a - The first matrix. @@ -2521,7 +2549,7 @@ export class Mat4 extends Float64Array { } // Instance method alias assignments -Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Mat4.sub = Mat4.subtract; diff --git a/src/_lib/f64/Quat.ts b/src/_lib/f64/Quat.ts index 57e6a9e9..d0a734d6 100644 --- a/src/_lib/f64/Quat.ts +++ b/src/_lib/f64/Quat.ts @@ -26,8 +26,8 @@ export class Quat extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 4: super(values); break; case 2: @@ -48,9 +48,9 @@ export class Quat extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -117,9 +117,9 @@ export class Quat extends Float64Array { return Quat.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat} into `this`. @@ -164,7 +164,7 @@ export class Quat extends Float64Array { * Alias for {@link Quat.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Rotates `this` by the given angle about the X axis @@ -241,9 +241,9 @@ export class Quat extends Float64Array { return Quat.dot(this, b); } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -254,9 +254,9 @@ export class Quat extends Float64Array { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity quat @@ -294,7 +294,7 @@ export class Quat extends Float64Array { * @returns `out` **/ static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike { - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; @@ -307,7 +307,7 @@ export class Quat extends Float64Array { * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same - * values as providied in the original parameter list + * values as provided in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by @@ -349,7 +349,7 @@ export class Quat extends Float64Array { } /** - * Multiplies two quat's + * Multiplies two quaternions. * @category Static * * @param out - the receiving quaternion @@ -605,7 +605,7 @@ export class Quat extends Float64Array { * @param out - the receiving quaternion * @returns `out` */ - /*static random(out: QuatLike): QuatLike { + /* static random(out: QuatLike): QuatLike { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution let u1 = glMatrix.RANDOM(); @@ -649,7 +649,7 @@ export class Quat extends Float64Array { /** * Calculates the conjugate of a quat - * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. * @category Static * * @param out - the receiving quaternion @@ -668,7 +668,7 @@ export class Quat extends Float64Array { * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure - * to renormalize the quaternion yourself where necessary. + * to re-normalize the quaternion yourself where necessary. * @category Static * * @param out - the receiving quaternion @@ -692,10 +692,10 @@ export class Quat extends Float64Array { } else { // |w| <= 1/2 let i = 0; - if (m[4] > m[0]) i = 1; - if (m[8] > m[i * 3 + i]) i = 2; - let j = (i + 1) % 3; - let k = (i + 2) % 3; + if (m[4] > m[0]) { i = 1; } + if (m[8] > m[i * 3 + i]) { i = 2; } + const j = (i + 1) % 3; + const k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); out[i] = 0.5 * fRoot; @@ -720,17 +720,17 @@ export class Quat extends Float64Array { * @returns `out` */ static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike { - let halfToRad = (0.5 * Math.PI) / 180.0; + const halfToRad = (0.5 * Math.PI) / 180.0; x *= halfToRad; y *= halfToRad; z *= halfToRad; - let sx = Math.sin(x); - let cx = Math.cos(x); - let sy = Math.sin(y); - let cy = Math.cos(y); - let sz = Math.sin(z); - let cz = Math.cos(z); + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); switch (order) { case 'xyz': @@ -776,7 +776,7 @@ export class Quat extends Float64Array { break; default: - throw new Error('Unknown angle order ' + order); + throw new Error(`Unknown angle order ${order}`); } return out; @@ -845,6 +845,7 @@ export class Quat extends Float64Array { * @param w - W component * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; } /** @@ -856,12 +857,14 @@ export class Quat extends Float64Array { * @param b - the second operand * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; } /** * Alias for {@link Quat.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; } /** @@ -903,7 +906,8 @@ export class Quat extends Float64Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; } /** * Calculates the magnitude (length) of a {@link Quat} @@ -912,12 +916,14 @@ export class Quat extends Float64Array { * @param a - quaternion to calculate length of * @returns length of `a` */ - static magnitude(a: Readonly): number { return 0; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static magnitude(a: Readonly): number { return 0; } /** * Alias for {@link Quat.magnitude} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mag(a: Readonly): number { return 0; } /** @@ -925,15 +931,15 @@ export class Quat extends Float64Array { * @category Static * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat.magnitude} * @category Static * @deprecated Use {@link Quat.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat} @@ -942,13 +948,14 @@ export class Quat extends Float64Array { * @param a - quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a: Readonly): number { return 0; } /** * Alias for {@link Quat.squaredLength} * @category Static */ - static sqrLen(a: Readonly): number { return 0; } + static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat} @@ -958,26 +965,29 @@ export class Quat extends Float64Array { * @param a - quaternion to normalize * @returns `out` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static normalize(out: QuatLike, a: Readonly): QuatLike { return out; } /** - * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first quaternion. * @param b - The second quaternion. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static exactEquals(a: Readonly, b: Readonly): boolean { return false; } /** - * Returns whether or not the quaternions have approximately the same elements in the same position. + * Returns whether the quaternions have approximately the same elements in the same position. * @category Static * * @param a - The first vector. * @param b - The second vector. * @returns True if the vectors are equal, false otherwise. */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static equals(a: Readonly, b: Readonly): boolean { return false; } /** @@ -993,10 +1003,11 @@ export class Quat extends Float64Array { * @returns `out` */ static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike { - let dot = Vec3.dot(a, b); + const dot = Vec3.dot(a, b); + if (dot < -0.999999) { Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a); - if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); + if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); } Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3); Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI); return out; @@ -1028,7 +1039,8 @@ export class Quat extends Float64Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): QuatLike { + static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly, + d: Readonly, t: number): QuatLike { Quat.slerp(Quat.#TMP_QUAT1, a, d, t); Quat.slerp(Quat.#TMP_QUAT2, b, c, t); Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t)); @@ -1077,7 +1089,7 @@ Quat.equals = Vec4.equals; Quat.magnitude = Vec4.magnitude; // Instance method alias assignments -Quat.prototype.mul = Quat.prototype.multiply; +Quat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Quat.mul = Quat.multiply; diff --git a/src/_lib/f64/Quat2.ts b/src/_lib/f64/Quat2.ts index ad997163..7c1003b9 100644 --- a/src/_lib/f64/Quat2.ts +++ b/src/_lib/f64/Quat2.ts @@ -19,8 +19,8 @@ export class Quat2 extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 8: super(values); break; case 2: @@ -41,9 +41,9 @@ export class Quat2 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ /** * A string representation of `this` @@ -55,9 +55,9 @@ export class Quat2 extends Float64Array { return Quat2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Quat2} into `this`. @@ -71,9 +71,9 @@ export class Quat2 extends Float64Array { return this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -84,9 +84,9 @@ export class Quat2 extends Float64Array { return 8 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new identity {@link Quat2} @@ -124,7 +124,7 @@ export class Quat2 extends Float64Array { * @returns a new dual quaternion */ static fromValues(x1: number, y1: number, z1: number, w1: number, - x2: number, y2: number, z2: number, w2: number): Quat2 { + x2: number, y2: number, z2: number, w2: number): Quat2 { return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2); } @@ -142,7 +142,7 @@ export class Quat2 extends Float64Array { * @returns a new dual quaternion */ static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number, - x2: number, y2: number, z2: number): Quat2 { + x2: number, y2: number, z2: number): Quat2 { const ax = x2 * 0.5; const ay = y2 * 0.5; const az = z2 * 0.5; @@ -151,7 +151,7 @@ export class Quat2 extends Float64Array { ax * w1 + ay * z1 - az * y1, ay * w1 + az * x1 - ax * z1, az * w1 + ax * y1 - ay * x1, - -ax * x1 - ay * y1 - az * z1); + -ax * x1 - ay * y1 - az * z1); } /** @@ -291,7 +291,7 @@ export class Quat2 extends Float64Array { * @returns `out` */ static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number, - x2: number, y2: number, z2: number, w2: number): Quat2Like { + x2: number, y2: number, z2: number, w2: number): Quat2Like { out[0] = x1; out[1] = y1; out[2] = z1; @@ -603,13 +603,13 @@ export class Quat2 extends Float64Array { * @returns `out` */ static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like { - //Special case for rad = 0 + // Special case for rad = 0 if (Math.abs(rad) < GLM_EPSILON) { return Quat2.copy(out, a); } const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); - rad = rad * 0.5; + rad *= 0.5; const s = Math.sin(rad); const bx = (s * axis[0]) / axisLength; const by = (s * axis[1]) / axisLength; @@ -731,6 +731,7 @@ export class Quat2 extends Float64Array { * Alias for {@link Quat2.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; } /** @@ -762,6 +763,7 @@ export class Quat2 extends Float64Array { * @param b - the second operand * @returns dot product of a and b */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dot(a: Readonly, b: Readonly): number { return 0; } /** @@ -777,7 +779,7 @@ export class Quat2 extends Float64Array { */ static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like { const mt = 1 - t; - if (Quat2.dot(a, b) < 0) t = -t; + if (Quat2.dot(a, b) < 0) { t = -t; } out[0] = a[0] * mt + b[0] * t; out[1] = a[1] * mt + b[1] * t; @@ -813,8 +815,8 @@ export class Quat2 extends Float64Array { } /** - * Calculates the conjugate of a {@link Quat2} - * If the dual quaternion is normalized, this function is faster than {@link Quat2.invert} and produces the same result. + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. * @category Static * * @param out - the receiving dual quaternion @@ -840,28 +842,29 @@ export class Quat2 extends Float64Array { * @param a - dual quaternion to calculate length of * @returns length of `a` */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static magnitude(a: Readonly): number { return 0; } /** * Alias for {@link Quat2.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Quat2.magnitude} * @category Static * @deprecated Use {@link Quat2.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Quat2} @@ -870,13 +873,14 @@ export class Quat2 extends Float64Array { * @param a - dual quaternion to calculate squared length of * @returns squared length of a */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static squaredLength(a: Readonly): number { return 0; } /** * Alias for {@link Quat2.squaredLength} * @category Static */ - static sqrLen(a: Readonly): number { return 0; } + static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Normalize a {@link Quat2} @@ -928,7 +932,7 @@ export class Quat2 extends Float64Array { } /** - * Returns whether or not the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first dual quaternion. @@ -949,7 +953,7 @@ export class Quat2 extends Float64Array { } /** - * Returns whether or not the {@link Quat2}s have approximately the same elements in the same position. + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. * @category Static * * @param a - The first dual quaternion. @@ -987,17 +991,17 @@ export class Quat2 extends Float64Array { } // Methods which re-use the Quat implementation -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.dot = Quat.dot; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.squaredLength = Quat.squaredLength; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.sqrLen = Quat.squaredLength; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.mag = Quat.magnitude; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.length = Quat.magnitude; -// @ts-ignore +// @ts-expect-error: Ignore type error coercion. Quat2.len = Quat.magnitude; // Static method alias assignments diff --git a/src/_lib/f64/Vec2.ts b/src/_lib/f64/Vec2.ts index 5df3b2fb..6731c5fb 100644 --- a/src/_lib/f64/Vec2.ts +++ b/src/_lib/f64/Vec2.ts @@ -11,12 +11,12 @@ export class Vec2 extends Float64Array { * * @category Constructor */ - constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { + switch (values.length) { case 2:{ const v = values[0]; if (typeof v === 'number') { - super([v, values[1]]); + super([v, values[1]!]); } else { super(v as ArrayBufferLike, values[1], 2); } @@ -36,9 +36,9 @@ export class Vec2 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -123,9 +123,9 @@ export class Vec2 extends Float64Array { return Vec2.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec2} into `this`. @@ -173,7 +173,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.subtract} * @category Methods */ - sub(b: Readonly): this { return this; } + sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec2}. @@ -193,7 +193,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec2}. @@ -213,7 +213,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.divide} * @category Methods */ - div(b: Readonly): this { return this; } + div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. @@ -259,7 +259,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Methods */ - dist(b: Readonly): number { return 0; } + dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. @@ -276,7 +276,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.squaredDistance} * @category Methods */ - sqrDist(b: Readonly): number { return 0; } + sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. @@ -336,13 +336,13 @@ export class Vec2 extends Float64Array { * * @returns `this` */ - normalize(): this { + normalize(): this { return Vec2.normalize(this, this) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -353,9 +353,9 @@ export class Vec2 extends Float64Array { return 2 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec2} @@ -386,7 +386,7 @@ export class Vec2 extends Float64Array { * @param y - Y component * @returns A new 2D vector */ - static fromValues(x: number, y: number): Vec2 { + static fromValues(x: number, y: number): Vec2 { return new Vec2(x, y); } @@ -453,6 +453,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } /** @@ -474,7 +475,8 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.multiply} * @category Static */ - static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } /** * Divides two {@link Vec2}s @@ -495,6 +497,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; } /** @@ -616,6 +619,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a: Readonly, b: Readonly): number { return 0; } /** @@ -636,7 +640,8 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.distance} * @category Static */ - static sqrDist(a: Readonly, b: Readonly): number { return 0; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a: Readonly, b: Readonly): number { return 0; } /** * Calculates the magnitude (length) of a {@link Vec2} @@ -646,15 +651,17 @@ export class Vec2 extends Float64Array { * @returns Magnitude of a */ static magnitude(a: Readonly): number { - let x = a[0]; - let y = a[1]; + const x = a[0]; + const y = a[1]; return Math.sqrt(x * x + y * y); } + /** * Alias for {@link Vec2.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars + /** * Alias for {@link Vec2.magnitude} * @category Static @@ -663,14 +670,15 @@ export class Vec2 extends Float64Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars + /** * Alias for {@link Vec2.magnitude} * @category Static * @deprecated Use {@link Vec2.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec2} @@ -689,6 +697,7 @@ export class Vec2 extends Float64Array { * Alias for {@link Vec2.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a: Readonly, b: Readonly): number { return 0; } /** @@ -746,7 +755,7 @@ export class Vec2 extends Float64Array { const y = a[1]; let len = x * x + y * y; if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? + // TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); } out[0] = a[0] * len; @@ -884,13 +893,13 @@ export class Vec2 extends Float64Array { * @returns `out` */ static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like { - //Translate point to the origin + // 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 + // perform rotation and translate to correct position out[0] = p0 * cosC - p1 * sinC + b[0]; out[1] = p0 * sinC + p1 * cosC + b[1]; @@ -932,7 +941,7 @@ export class Vec2 extends Float64Array { } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -944,7 +953,7 @@ export class Vec2 extends Float64Array { } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -969,17 +978,17 @@ export class Vec2 extends Float64Array { * @param a - Vector to represent as a string * @returns String representation of the vector */ - static str(a: Readonly): string { + static str(a: Readonly): string { return `Vec2(${a.join(', ')})`; } } // Instance method alias assignments -Vec2.prototype.sub = Vec2.prototype.subtract; -Vec2.prototype.mul = Vec2.prototype.multiply; -Vec2.prototype.div = Vec2.prototype.divide; -Vec2.prototype.dist = Vec2.prototype.distance; -Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Vec2.sub = Vec2.subtract; diff --git a/src/_lib/f64/Vec3.ts b/src/_lib/f64/Vec3.ts index 3813dea9..6eeec3cf 100644 --- a/src/_lib/f64/Vec3.ts +++ b/src/_lib/f64/Vec3.ts @@ -2,9 +2,9 @@ import { GLM_EPSILON } from '#gl-matrix/common'; import type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types'; - /** - * 3 Dimensional Vector - */ +/** + * 3 Dimensional Vector + */ export class Vec3 extends Float64Array { /** * Create a {@link Vec3}. @@ -12,7 +12,7 @@ export class Vec3 extends Float64Array { * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + switch (values.length) { case 3: super(values); break; case 2: @@ -31,9 +31,9 @@ export class Vec3 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -136,9 +136,9 @@ export class Vec3 extends Float64Array { return Vec3.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec3} into `this`. @@ -186,7 +186,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.subtract} * @category Methods */ - sub(b: Readonly): this { return this; } + sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec3}. @@ -207,7 +207,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec3}. @@ -228,7 +228,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.divide} * @category Methods */ - div(b: Readonly): this { return this; } + div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. @@ -276,7 +276,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.distance} * @category Methods */ - dist(b: Readonly): number { return 0; } + dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. @@ -294,7 +294,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.squaredDistance} * @category Methods */ - sqrDist(b: Readonly): number { return 0; } + sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. @@ -357,13 +357,13 @@ export class Vec3 extends Float64Array { * * @returns `this` */ - normalize(): this { + normalize(): this { return Vec3.normalize(this, this) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -374,9 +374,9 @@ export class Vec3 extends Float64Array { return 3 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty vec3 @@ -407,16 +407,16 @@ export class Vec3 extends Float64Array { * @returns Magnitude of a */ static magnitude(a: Readonly): number { - let x = a[0]; - let y = a[1]; - let z = a[2]; + const x = a[0]; + const y = a[1]; + const z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /** * Alias for {@link Vec3.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static @@ -425,14 +425,14 @@ export class Vec3 extends Float64Array { * @param a - vector to calculate length of * @returns length of a */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec3.magnitude} * @category Static * @deprecated Use {@link Vec3.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Creates a new vec3 initialized with the given values @@ -515,6 +515,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; /** @@ -537,6 +538,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; } /** @@ -559,7 +561,8 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.divide} * @category Static */ - static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }; /** * Math.ceil the components of a vec3 @@ -631,7 +634,8 @@ export class Vec3 extends Float64Array { * @param a - vector to round * @returns `out` */ - /*static round(out: Vec3Like, a: Readonly): Vec3Like { + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { out[0] = glMatrix.round(a[0]); out[1] = glMatrix.round(a[1]); out[2] = glMatrix.round(a[2]); @@ -689,6 +693,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a: Readonly, b: Readonly): number { return 0; } /** @@ -710,6 +715,7 @@ export class Vec3 extends Float64Array { * Alias for {@link Vec3.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a: Readonly, b: Readonly): number { return 0; } /** @@ -725,10 +731,12 @@ export class Vec3 extends Float64Array { const z = a[2]; return x * x + y * y + z * z; } + /** * Alias for {@link Vec3.squaredLength} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrLen(a: Readonly, b: Readonly): number { return 0; } /** @@ -790,7 +798,7 @@ export class Vec3 extends Float64Array { const z = a[2]; let len = x * x + y * y + z * z; if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? + // TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); } out[0] = a[0] * len; @@ -889,7 +897,8 @@ export class Vec3 extends Float64Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like { + static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, + d: Readonly, t: number): Vec3Like { const factorTimes2 = t * t; const factor1 = factorTimes2 * (2 * t - 3) + 1; const factor2 = factorTimes2 * (t - 2) + t; @@ -915,7 +924,8 @@ export class Vec3 extends Float64Array { * @param t - interpolation amount, in the range [0-1], between the two inputs * @returns `out` */ - static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, d: Readonly, t: number): Vec3Like { + static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly, + d: Readonly, t: number): Vec3Like { const inverseFactor = 1 - t; const inverseFactorTimesTwo = inverseFactor * inverseFactor; const factorTimes2 = t * t; @@ -939,7 +949,8 @@ export class Vec3 extends Float64Array { * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec3Like, scale) { + /* + static random(out: Vec3Like, scale) { scale = scale === undefined ? 1.0 : scale; let r = glMatrix.RANDOM() * 2.0 * Math.PI; @@ -983,7 +994,7 @@ export class Vec3 extends Float64Array { * @returns `out` */ static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like { - let x = a[0], + const x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; @@ -1023,9 +1034,9 @@ export class Vec3 extends Float64Array { const uuvz = (qx * uvy - qy * uvx) * 2; // vec3.scale(uv, uv, 2 * w); // return vec3.add(out, a, vec3.add(out, uv, uuv)); - out[0] = x + (uvx*w2) + uuvx; - out[1] = y + (uvy*w2) + uuvy; - out[2] = z + (uvz*w2) + uuvz; + out[0] = x + (uvx * w2) + uuvx; + out[1] = y + (uvy * w2) + uuvy; + out[2] = z + (uvz * w2) + uuvz; return out; } @@ -1043,12 +1054,12 @@ export class Vec3 extends Float64Array { const by = b[1]; const bz = b[2]; - //Translate point to the origin + // Translate point to the origin const py = a[1] - by; const pz = a[2] - bz; - //perform rotation - //translate to correct position + // perform rotation + // translate to correct position out[0] = a[0]; out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by; out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz; @@ -1070,12 +1081,12 @@ export class Vec3 extends Float64Array { const bx = b[0]; const bz = b[2]; - //Translate point to the origin + // Translate point to the origin const px = a[0] - bx; const pz = a[2] - bz; - //perform rotation - //translate to correct position + // perform rotation + // translate to correct position out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx; out[1] = a[1]; out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz; @@ -1097,12 +1108,12 @@ export class Vec3 extends Float64Array { const bx = b[0]; const by = b[1]; - //Translate point to the origin + // Translate point to the origin const px = a[0] - bx; const py = a[1] - by; - //perform rotation - //translate to correct position + // perform rotation + // translate to correct position out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx; out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by; out[2] = b[2]; @@ -1156,7 +1167,7 @@ export class Vec3 extends Float64Array { } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -1168,7 +1179,7 @@ export class Vec3 extends Float64Array { } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -1191,11 +1202,11 @@ export class Vec3 extends Float64Array { } // Instance method alias assignments -Vec3.prototype.sub = Vec3.prototype.subtract; -Vec3.prototype.mul = Vec3.prototype.multiply; -Vec3.prototype.div = Vec3.prototype.divide; -Vec3.prototype.dist = Vec3.prototype.distance; -Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Vec3.sub = Vec3.subtract; diff --git a/src/_lib/f64/Vec4.ts b/src/_lib/f64/Vec4.ts index 9c462532..540d4c38 100644 --- a/src/_lib/f64/Vec4.ts +++ b/src/_lib/f64/Vec4.ts @@ -12,7 +12,7 @@ export class Vec4 extends Float64Array { * @category Constructor */ constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) { - switch(values.length) { + switch (values.length) { case 4: super(values); break; case 2: @@ -31,9 +31,9 @@ export class Vec4 extends Float64Array { } } - //============ + // ============ // Accessors - //============ + // ============ // Getters and setters to make component access read better. // These are likely to be a little bit slower than direct array access. @@ -131,9 +131,9 @@ export class Vec4 extends Float64Array { return Vec4.str(this); } - //=================== + // =================== // Instances methods - //=================== + // =================== /** * Copy the values from another {@link Vec4} into `this`. @@ -171,7 +171,7 @@ export class Vec4 extends Float64Array { * @param b - The vector to subtract from `this` * @returns `this` */ - subtract(b: Readonly): this { + subtract(b: Readonly): this { this[0] -= b[0]; this[1] -= b[1]; this[2] -= b[2]; @@ -183,7 +183,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.subtract} * @category Methods */ - sub(b: Readonly): this { return this; } + sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Multiplies `this` by a {@link Vec4}. @@ -205,7 +205,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.multiply} * @category Methods */ - mul(b: Readonly): this { return this; } + mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Divides `this` by a {@link Vec4}. @@ -227,7 +227,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.divide} * @category Methods */ - div(b: Readonly): this { return this; } + div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Scales `this` by a scalar number. @@ -278,7 +278,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.distance} * @category Methods */ - dist(b: Readonly): number { return 0; } + dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. @@ -296,7 +296,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.squaredDistance} * @category Methods */ - sqrDist(b: Readonly): number { return 0; } + sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of `this`. @@ -366,9 +366,9 @@ export class Vec4 extends Float64Array { return Vec4.normalize(this, this) as this; } - //=================== + // =================== // Static accessors - //=================== + // =================== /** * @category Static @@ -379,9 +379,9 @@ export class Vec4 extends Float64Array { return 4 * Float64Array.BYTES_PER_ELEMENT; } - //=================== + // =================== // Static methods - //=================== + // =================== /** * Creates a new, empty {@link Vec4} @@ -491,6 +491,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.subtract} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } /** @@ -514,6 +515,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.multiply} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } /** @@ -537,6 +539,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.divide} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; } /** @@ -675,6 +678,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.distance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static dist(a: Readonly, b: Readonly): number { return 0; } /** @@ -696,6 +700,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.squaredDistance} * @category Static */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars static sqrDist(a: Readonly, b: Readonly): number { return 0; } /** @@ -716,22 +721,22 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.magnitude} * @category Static */ - static mag(a: Readonly): number { return 0; } + static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs */ - // @ts-ignore: Length conflicts with Function.length - static length(a: Readonly): number { return 0; } + // Length conflicts with Function.length + static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Alias for {@link Vec4.magnitude} * @category Static * @deprecated Use {@link Vec4.mag} */ - static len(a: Readonly): number { return 0; } + static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Calculates the squared length of a {@link Vec4} @@ -752,7 +757,7 @@ export class Vec4 extends Float64Array { * Alias for {@link Vec4.squaredLength} * @category Static */ - static sqrLen(a: Readonly): number { return 0; } + static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars /** * Negates the components of a {@link Vec4} @@ -898,7 +903,8 @@ export class Vec4 extends Float64Array { * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned * @returns `out` */ - /*static random(out: Vec4Like, scale): Vec4Like { + /* + static random(out: Vec4Like, scale): Vec4Like { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a @@ -1005,7 +1011,7 @@ export class Vec4 extends Float64Array { } /** - * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) * @category Static * * @param a - The first vector. @@ -1017,7 +1023,7 @@ export class Vec4 extends Float64Array { } /** - * Returns whether or not the vectors have approximately the same elements in the same position. + * Returns whether the vectors have approximately the same elements in the same position. * @category Static * * @param a - The first vector. @@ -1043,11 +1049,11 @@ export class Vec4 extends Float64Array { } // Instance method alias assignments -Vec4.prototype.sub = Vec4.prototype.subtract; -Vec4.prototype.mul = Vec4.prototype.multiply; -Vec4.prototype.div = Vec4.prototype.divide; -Vec4.prototype.dist = Vec4.prototype.distance; -Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method // Static method alias assignments Vec4.sub = Vec4.subtract; diff --git a/src/common/index.ts b/src/common/index.ts index 86b159ae..0913dcde 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -7,4 +7,4 @@ /** * A small constant used to determine the acceptable error margin in floating-point calculations. */ -export const GLM_EPSILON: number = 0.000001; +export const GLM_EPSILON = 0.000001; diff --git a/src/swizzle/f64/index.ts b/src/swizzle/f64/index.ts index 4a9e4eca..220b0f06 100644 --- a/src/swizzle/f64/index.ts +++ b/src/swizzle/f64/index.ts @@ -24,7 +24,7 @@ import { Vec2, Vec3, Vec4 } from '#gl-matrix/f64'; /** * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit). */ -let GLM_SWIZZLES_ENABLED_F64: boolean = false; +let GLM_SWIZZLES_ENABLED_F64 = false; /** * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / @@ -56,6 +56,8 @@ export function EnableSwizzlesF64(): void { /* v8 ignore next 1 */ if (GLM_SWIZZLES_ENABLED_F64) { return; } + /* eslint-disable comma-spacing, max-len */ + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should // not be modified by hand. // [Swizzle Autogen] @@ -66,10 +68,12 @@ export function EnableSwizzlesF64(): void { // [/Swizzle Autogen] + /* eslint-enable comma-spacing, max-len */ + /** * Internal swizzle index table for `gl-matrix`. */ - const SWIZZLE_INDEX = { + const SWIZZLE_INDEX: Record = { x: 0, r: 0, y: 1, g: 1, z: 2, b: 2, @@ -82,15 +86,25 @@ export function EnableSwizzlesF64(): void { * @param swizzle - Swizzle format to apply. * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance. */ - function getSwizzleImpl(swizzle: string): () => any { - switch(swizzle.length) { + function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 { + switch (swizzle.length) { case 2: - return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); }; + return function(this: Float64Array) { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; case 3: - return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); }; + return function(this: Float64Array) { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]]); + }; case 4: - return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; + return function(this: Float64Array) { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; } + + throw new Error('Illegal swizzle length'); } for (const swizzle of VEC2_SWIZZLES) { diff --git a/src/swizzle/index.ts b/src/swizzle/index.ts index 22d9396d..9dfe3c39 100644 --- a/src/swizzle/index.ts +++ b/src/swizzle/index.ts @@ -24,7 +24,7 @@ import { Vec2, Vec3, Vec4 } from '#gl-matrix'; /** * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit). */ -let GLM_SWIZZLES_ENABLED_F32: boolean = false; +let GLM_SWIZZLES_ENABLED_F32 = false; /** * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / @@ -55,6 +55,8 @@ export function EnableSwizzles(): void { /* v8 ignore next 1 */ if (GLM_SWIZZLES_ENABLED_F32) { return; } + /* eslint-disable comma-spacing, max-len */ + // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should // not be modified by hand. // [Swizzle Autogen] @@ -65,10 +67,12 @@ export function EnableSwizzles(): void { // [/Swizzle Autogen] + /* eslint-enable comma-spacing, max-len */ + /** * Internal swizzle index table for `gl-matrix`. */ - const SWIZZLE_INDEX = { + const SWIZZLE_INDEX: Record = { x: 0, r: 0, y: 1, g: 1, z: 2, b: 2, @@ -81,15 +85,25 @@ export function EnableSwizzles(): void { * @param swizzle - Swizzle format to apply. * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance. */ - function getSwizzleImpl(swizzle: string): () => any { - switch(swizzle.length) { + function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 { + switch (swizzle.length) { case 2: - return function() { return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); }; + return function(this: Float32Array) { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; case 3: - return function() { return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]]); }; + return function(this: Float32Array) { + return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]]); + }; case 4: - return function() { return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); }; + return function(this: Float32Array) { + return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]); + }; } + + throw new Error('Illegal swizzle length'); } for (const swizzle of VEC2_SWIZZLES) { diff --git a/src/types/swizzle/f64/index.ts b/src/types/swizzle/f64/index.ts index 73997ed5..93dcccd0 100644 --- a/src/types/swizzle/f64/index.ts +++ b/src/types/swizzle/f64/index.ts @@ -54,282 +54,282 @@ declare module '#gl-matrix/f64' { */ interface Vec2 { /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; @@ -340,1172 +340,1172 @@ declare module '#gl-matrix/f64' { */ interface Vec3 { /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; @@ -1516,3362 +1516,3362 @@ declare module '#gl-matrix/f64' { */ interface Vec4 { /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xw(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yw(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zw(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ww(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xww(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yww(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zww(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get www(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ra(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ga(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ba(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ar(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ag(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ab(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get aa(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rra(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get raa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gra(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gaa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bra(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get baa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ara(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aaa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rraa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get graa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get braa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get araa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaaa(): Vec4Alias; diff --git a/src/types/swizzle/index.ts b/src/types/swizzle/index.ts index 0d56f8ba..74f24c5f 100644 --- a/src/types/swizzle/index.ts +++ b/src/types/swizzle/index.ts @@ -54,282 +54,282 @@ declare module '#gl-matrix' { */ interface Vec2 { /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; @@ -340,1172 +340,1172 @@ declare module '#gl-matrix' { */ interface Vec3 { /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; @@ -1516,3362 +1516,3362 @@ declare module '#gl-matrix' { */ interface Vec4 { /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gr(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get rb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get gb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get br(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bg(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get bb(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rrb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get grb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ggb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get brb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bgb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bbb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get xw(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get yw(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get zw(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wx(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wy(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get wz(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ww(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xwz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get xww(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ywz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get yww(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zwz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get zww(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wxw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wyw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wzw(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwx(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwy(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get wwz(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get www(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get xwww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get yzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ywww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get zwww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wxww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wywz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wyww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wzww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwxw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwyw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwzw(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwx(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwy(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwwz(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get wwww(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ra(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ga(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ba(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ar(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ag(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get ab(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec2 */ get aa(): Vec2Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rra(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get rab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get raa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gra(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get gaa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bra(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get bab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get baa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get arb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get ara(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get agb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aga(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abr(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abg(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get abb(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aba(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aar(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aag(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aab(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec3 */ get aaa(): Vec3Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rrab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rraa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rgaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rbaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rarb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ragb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get rabb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get raaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get grab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get graa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get ggaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gbaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get garb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gagb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gabb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get gaaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get brab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get braa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bgaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bbaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get barb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get bagb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get babb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get baaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get argb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get arab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get araa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aggb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get agaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abrb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abra(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abgb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abbb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get abaa(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aarb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aara(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aagb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaga(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabr(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabg(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aabb(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaba(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaar(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaag(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaab(): Vec4Alias; /** - * @category Swizzle Accessors (Optional) + * @category Swizzle Accessors (Optional) * @returns New instance of swizzled Vec4 */ get aaaa(): Vec4Alias; diff --git a/tests/f32/Mat2.spec.ts b/tests/f32/Mat2.spec.ts index 578a4ab7..94db01b2 100644 --- a/tests/f32/Mat2.spec.ts +++ b/tests/f32/Mat2.spec.ts @@ -2,20 +2,22 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat2 } from '#gl-matrix'; +import type { FloatArray, Mat2Like, Vec2Like } from '#gl-matrix/types'; + describe('Mat2', () => { describe('constructor', () => { it('should return an identity Mat2 if called with no arguments', () => { expect(new Mat2()).toBeVec( 1, 0, - 0, 1) + 0, 1); }); it('should return Mat2(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { expect(new Mat2( 1, 2, 3, 4)).toBeVec( - 1, 2, - 3, 4); + 1, 2, + 3, 4); }); it('should return Mat2(x, x, x, ...) if called with (x)', () => { @@ -33,14 +35,14 @@ describe('Mat2', () => { }); it('should return Mat2(m0, m1, ...m8) if called with (Mat4(m0, m1, ...m9))', () => { - let v = new Mat2( + const v = new Mat2( 1, 2, 3, 4); expect(new Mat2(v)).toBeVec(v); }); it('should return Mat2(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))', () => { - let arr = new Float32Array([ + const arr = new Float32Array([ 1, 2, 3, 4]); expect(new Mat2(arr)).toBeVec(arr); @@ -48,7 +50,8 @@ describe('Mat2', () => { }); describe('static', () => { - let out, matA, matB, identity, result; + let out: Mat2Like, matA: Mat2Like, matB: Mat2Like, identity: Mat2Like, + result: [Mat2Like, Readonly, Mat2Like] | FloatArray | Mat2Like | null | number | string; beforeEach(() => { matA = new Float32Array([1, 2, 3, 4]); @@ -61,7 +64,7 @@ describe('Mat2', () => { beforeEach(() => { result = Mat2.create(); }); it('should return a 4 element array initialized to a 2x2 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -147,10 +150,10 @@ describe('Mat2', () => { describe('with a separate output matrix', () => { beforeEach(() => { result = Mat2.multiply(out, matA, matB); }); - it('should place values into out', () => expect(out).toBeVec(23, 34, 31, 46)); - it('should return out', () => expect(result).toBe(out)); - it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); - it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + it('should place values into out', () => expect(out).toBeVec(23, 34, 31, 46)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); }); describe('when matA is the output matrix', () => { @@ -188,7 +191,7 @@ describe('Mat2', () => { }); describe('scale', () => { - let vecA; + let vecA: Vec2Like; beforeEach(() => { vecA = [2, 3]; }); @@ -217,17 +220,17 @@ describe('Mat2', () => { describe('frob', () => { beforeEach(() => { result = Mat2.frob(matA); }); it('should return the Frobenius Norm of the matrix', - () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2)))); + () => expect(result).toEqual(Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2)))); }); describe('LDU', () => { - let L, D, U, L_result, D_result, U_result; + let L: Mat2, D: Mat2, U: Mat2, L_result: Mat2, D_result: Mat2, U_result: Mat2; beforeEach(() => { L = Mat2.create(); D = Mat2.create(); U = Mat2.create(); - result = Mat2.LDU(L, D, U, [4,3,6,3]); + result = Mat2.LDU(L, D, U, [4, 3, 6, 3]); L_result = Mat2.create(); L_result[2] = 1.5; D_result = Mat2.create(); U_result = Mat2.create(); @@ -235,20 +238,23 @@ describe('Mat2', () => { }); it('should return a lower triangular, a diagonal and an upper triangular matrix', () => { + // @ts-expect-error Not null expect(result[0]).toBeVec(L_result); + // @ts-expect-error Not null expect(result[1]).toBeVec(D_result); + // @ts-expect-error Not null expect(result[2]).toBeVec(U_result); }); - }); + }); describe('add', () => { describe('with a separate output matrix', () => { beforeEach(() => { result = Mat2.add(out, matA, matB); }); - it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); - it('should return out', () => expect(result).toBe(out)); - it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); - it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); }); describe('when matA is the output matrix', () => { @@ -355,7 +361,7 @@ describe('Mat2', () => { }); describe('exactEquals', () => { - let matC, r0, r1, r2; + let matC: Mat2Like, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3]; @@ -372,7 +378,7 @@ describe('Mat2', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat2Like, matD: Mat2Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3]; diff --git a/tests/f32/Mat2d.spec.ts b/tests/f32/Mat2d.spec.ts index f9e7d439..dc10fe34 100644 --- a/tests/f32/Mat2d.spec.ts +++ b/tests/f32/Mat2d.spec.ts @@ -2,13 +2,15 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat2d } from '#gl-matrix'; +import type { Mat2dLike, Vec2Like } from '#gl-matrix/types'; + describe('Mat2d', () => { describe('constructor', () => { it('should return an identity Mat2d if called with no arguments', () => { expect(new Mat2d()).toBeVec( 1, 0, 0, 1, - 0, 0) + 0, 0); }); it('should return Mat2d(m0, m1, ...m5) if called with (m0, m1, ...m5)', () => { @@ -16,9 +18,9 @@ describe('Mat2d', () => { 1, 2, 3, 4, 5, 6)).toBeVec( - 1, 2, - 3, 4, - 5, 6); + 1, 2, + 3, 4, + 5, 6); }); it('should return Mat2d(x, x, x, ...) if called with (x)', () => { @@ -39,7 +41,7 @@ describe('Mat2d', () => { }); it('should return Mat2d(m0, m1, ...m8) if called with (Mat2d(m0, m1, ...m9))', () => { - let v = new Mat2d( + const v = new Mat2d( 1, 2, 3, 4, 5, 6); @@ -47,7 +49,7 @@ describe('Mat2d', () => { }); it('should return Mat2d(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))', () => { - let arr = new Float32Array([ + const arr = new Float32Array([ 1, 2, 3, 4, 5, 6]); @@ -56,7 +58,8 @@ describe('Mat2d', () => { }); describe('static', () => { - let out, matA, matB, oldA, oldB, identity, result; + let out: Mat2dLike, matA: Mat2dLike, matB: Mat2dLike, oldA: Mat2dLike, oldB: Mat2dLike, + identity: Mat2dLike, result: Mat2dLike | null | number | string; beforeEach(() => { matA = new Float32Array([1, 2, @@ -79,7 +82,7 @@ describe('Mat2d', () => { 0, 0, 0, 0]); - identity = new Float32Array([1, 0, + identity = new Float32Array([1, 0, 0, 1, 0, 0]); }); @@ -88,7 +91,7 @@ describe('Mat2d', () => { beforeEach(() => { result = Mat2d.create(); }); it('should return a 6 element array initialized to a 2x3 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -115,7 +118,7 @@ describe('Mat2d', () => { describe('with a separate output matrix', () => { beforeEach(() => { result = Mat2d.invert(out, matA); }); - it('should place values into out', () => expect(out).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should place values into out', () => expect(out).toBeVec(-2, 1, 1.5, -0.5, 1, -2)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(oldA)); }); @@ -123,7 +126,7 @@ describe('Mat2d', () => { describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat2d.invert(matA, matA); }); - it('should place values into matA', () => expect(matA).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should place values into matA', () => expect(matA).toBeVec(-2, 1, 1.5, -0.5, 1, -2)); it('should return matA', () => expect(result).toBe(matA)); }); }); @@ -181,7 +184,7 @@ describe('Mat2d', () => { }); describe('scale', () => { - let vecA; + let vecA: Vec2Like; beforeEach(() => { vecA = [2, 3]; }); describe('with a separate output matrix', () => { @@ -201,7 +204,7 @@ describe('Mat2d', () => { }); describe('translate', () => { - let vecA; + let vecA: Vec2Like; beforeEach(() => { vecA = [2, 3]; }); describe('with a separate output matrix', () => { @@ -224,7 +227,7 @@ describe('Mat2d', () => { beforeEach(() => { result = Mat2d.str(matA); }); it('should return a string representation of the matrix', - () => expect(result).toEqual('Mat2d(1, 2, 3, 4, 5, 6)')); + () => expect(result).toEqual('Mat2d(1, 2, 3, 4, 5, 6)')); }); describe('frob', () => { @@ -294,7 +297,7 @@ describe('Mat2d', () => { beforeEach(() => { result = Mat2d.fromValues(1, 2, 3, 4, 5, 6); }); it('should return a 6 element array initialized to the values passed', - () => expect(result).toBeVec(1, 2, 3, 4, 5, 6)); + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6)); }); describe('set', () => { @@ -349,7 +352,7 @@ describe('Mat2d', () => { }); describe('exactEquals', () => { - let matC, r0, r1; + let matC: Mat2dLike, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5]; matB = [0, 1, 2, 3, 4, 5]; @@ -365,7 +368,7 @@ describe('Mat2d', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat2dLike, matD: Mat2dLike, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5]; diff --git a/tests/f32/Mat3.spec.ts b/tests/f32/Mat3.spec.ts index 537bd5fc..b70014a2 100644 --- a/tests/f32/Mat3.spec.ts +++ b/tests/f32/Mat3.spec.ts @@ -2,13 +2,15 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat3, Mat4, Vec3 } from '#gl-matrix'; +import type { Mat3Like, Mat4Like, Vec4Like } from '#gl-matrix/types'; + describe('Mat3', () => { describe('constructor', () => { it('should return an identity Mat3 if called with no arguments', () => { expect(new Mat3()).toBeVec( 1, 0, 0, 0, 1, 0, - 0, 0, 1) + 0, 0, 1); }); it('should return Mat3(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { @@ -39,7 +41,7 @@ describe('Mat3', () => { }); it('should return Mat3(m0, m1, ...m8) if called with (Mat3(m0, m1, ...m9))', () => { - let v = new Mat3( + const v = new Mat3( 1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -47,7 +49,7 @@ describe('Mat3', () => { }); it('should return Mat3(m0, m1, ...m8) if called with (Float32Array([m0, m1, ...m8]))', () => { - let arr = new Float32Array([ + const arr = new Float32Array([ 1, 2, 3, 4, 5, 6, 7, 8, 9]); @@ -56,7 +58,8 @@ describe('Mat3', () => { }); describe('static', () => { - let out, matA, matB, identity, result; + let out: Mat3Like, matA: Mat3Like, matB: Mat3Like, mat4: Mat4Like, identity: Mat3Like, + result: Mat3Like | null | number | string; beforeEach(() => { matA = new Float32Array([1, 0, 0, @@ -78,90 +81,95 @@ describe('Mat3', () => { describe('normalFromMat4', () => { beforeEach(() => { - matA = new Float32Array([1, 0, 0, 0, + mat4 = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); - result = Mat3.normalFromMat4(out, matA); + result = Mat3.normalFromMat4(out, mat4); }); it('should return out', () => expect(result).toBe(out)); describe('with translation and rotation', () => { beforeEach(() => { - Mat4.translate(matA, matA, [2, 4, 6]); - Mat4.rotateX(matA, matA, Math.PI / 2); + Mat4.translate(mat4, mat4, [2, 4, 6]); + Mat4.rotateX(mat4, mat4, Math.PI / 2); - result = Mat3.normalFromMat4(out, matA); + result = Mat3.normalFromMat4(out, mat4); }); it('should give rotated matrix', () => { - expect(result).toBeVec(1, 0, 0, - 0, 0, 1, - 0,-1, 0); + expect(result).toBeVec( + 1, 0, 0, + 0, 0, 1, + 0, -1, 0); }); describe('and scale', () => { beforeEach(() => { - Mat4.scale(matA, matA, [2, 3, 4]); + Mat4.scale(mat4, mat4, [2, 3, 4]); - result = Mat3.normalFromMat4(out, matA); + result = Mat3.normalFromMat4(out, mat4); }); it('should give rotated matrix', () => { - expect(result).toBeVec(0.5, 0, 0, - 0, 0, 0.333333, - 0, -0.25, 0); + expect(result).toBeVec( + 0.5, 0, 0, + 0, 0, 0.333333, + 0, -0.25, 0); }); }); }); }); describe('fromQuat', () => { - let q; + let q: Vec4Like; beforeEach(() => { - q = [ 0, -0.7071067811865475, 0, 0.7071067811865475 ]; + q = [0, -0.7071067811865475, 0, 0.7071067811865475]; result = Mat3.fromQuat(out, q); }); it('should return out', () => expect(result).toBe(out)); it('should rotate a vector the same as the original quat', () => { - let vecOut = new Vec3(); - Vec3.transformQuat(vecOut, [0,0,-1], q); - expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(vecOut); + const vecOut = new Vec3(); + Vec3.transformQuat(vecOut, [0, 0, -1], q); + expect(Vec3.transformMat3([0, 0, 0], [0, 0, -1], out)).toBeVec(vecOut); }); it('should rotate a vector by PI/2 radians', - () => expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(1,0,0)); + () => expect(Vec3.transformMat3([0, 0, 0], [0, 0, -1], out)).toBeVec(1, 0, 0)); }); describe('fromMat4', () => { beforeEach(() => { - result = Mat3.fromMat4(out, [ 1, 2, 3, 4, - 5, 6, 7, 8, - 9,10,11,12, - 13,14,15,16]); + result = Mat3.fromMat4(out, [ + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16]); }); it('should return out', () => expect(result).toBe(out)); it('should calculate proper Mat3', () => { - expect(out).toBeVec( 1, 2, 3, - 5, 6, 7, - 9,10,11); + expect(out).toBeVec( + 1, 2, 3, + 5, 6, 7, + 9, 10, 11); }); }); describe('scale', () => { - beforeEach(() => { result = Mat3.scale(out, matA, [2,2]); }); + beforeEach(() => { result = Mat3.scale(out, matA, [2, 2]); }); it('should return out', () => expect(result).toBe(out)); it('should place proper values in out', () => { - expect(out).toBeVec( 2, 0, 0, - 0, 2, 0, - 1, 2, 1); + expect(out).toBeVec( + 2, 0, 0, + 0, 2, 0, + 1, 2, 1); }); }); @@ -169,7 +177,7 @@ describe('Mat3', () => { beforeEach(() => { result = Mat3.create(); }); it('should return a 9 element array initialized to a 3x3 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -378,13 +386,13 @@ describe('Mat3', () => { beforeEach(() => { result = Mat3.str(matA); }); it('should return a string representation of the matrix', - () => expect(result).toEqual('Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)')); + () => expect(result).toEqual('Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)')); }); describe('frob', () => { beforeEach(() => { result = Mat3.frob(matA); }); - it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + + it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual(Math.sqrt(Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(1, 2)))); }); @@ -459,7 +467,7 @@ describe('Mat3', () => { beforeEach(() => { result = Mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); }); it('should return a 9 element array initialized to the values passed', - () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); }); describe('set', () => { @@ -526,14 +534,15 @@ describe('Mat3', () => { it('should return out', () => expect(result).toBe(out)); it('should give projection matrix', () => { - expect(result).toBeVec(0.02, 0, 0, - 0, -0.01, 0, - -1, 1, 1); + expect(result).toBeVec( + 0.02, 0, 0, + 0, -0.01, 0, + -1, 1, 1); }); }); describe('exactEquals', () => { - let matC, r0, r1; + let matC: Mat3Like, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; @@ -550,7 +559,7 @@ describe('Mat3', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat3Like, matD: Mat3Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; diff --git a/tests/f32/Mat4.spec.ts b/tests/f32/Mat4.spec.ts index b2d59080..506f52d4 100644 --- a/tests/f32/Mat4.spec.ts +++ b/tests/f32/Mat4.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat4, Quat, Vec3 } from '#gl-matrix'; -import type { Vec3Like } from '#gl-matrix/types'; +import type { FloatArray, Mat4Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; describe('Mat4', () => { describe('constructor', () => { @@ -47,7 +47,7 @@ describe('Mat4', () => { }); it('should return Mat4(m0, m1, ...m15) if called with (Mat4(m0, m1, ...m15))', () => { - let v = new Mat4( + const v = new Mat4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -56,7 +56,7 @@ describe('Mat4', () => { }); it('should return Mat4(m0, m1, ...m15) if called with (Float32Array([m0, m1, ...m15]))', () => { - let arr = new Float32Array([ + const arr = new Float32Array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -66,7 +66,8 @@ describe('Mat4', () => { }); describe('static', () => { - let out, matA, matB, identity, result; + let out: Mat4Like, matA: Mat4Like, matB: Mat4Like, identity: Mat4Like, + result: Mat4Like | Vec3Like | Vec4Like | null | number | string; beforeEach(() => { // Attempting to portray a semi-realistic transform matrix @@ -103,7 +104,7 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.create(); }); it('should return a 16 element array initialized to a 4x4 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -358,8 +359,8 @@ describe('Mat4', () => { }); describe('rotate', () => { - let rad = Math.PI * 0.5; - let axis: Vec3Like = [1, 0, 0]; + const rad = Math.PI * 0.5; + const axis: Vec3Like = [1, 0, 0]; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotate(out, matA, rad, axis); }); @@ -393,7 +394,7 @@ describe('Mat4', () => { }); describe('rotateX', () => { - let rad = Math.PI * 0.5; + const rad = Math.PI * 0.5; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotateX(out, matA, rad); }); @@ -427,7 +428,7 @@ describe('Mat4', () => { }); describe('rotateY', () => { - let rad = Math.PI * 0.5; + const rad = Math.PI * 0.5; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotateY(out, matA, rad); }); @@ -461,7 +462,7 @@ describe('Mat4', () => { }); describe('rotateZ', () => { - let rad = Math.PI * 0.5; + const rad = Math.PI * 0.5; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotateZ(out, matA, rad); }); @@ -498,10 +499,11 @@ describe('Mat4', () => { describe('normalFromMat4', () => { beforeEach(() => { - matA = new Float32Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1]); + matA = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); result = Mat4.normalFromMat4(out, matA); }); @@ -516,10 +518,10 @@ describe('Mat4', () => { }); it('should give rotated matrix', () => expect(result).toBeVec( - 1, 0, 0, 0, - 0, 0, 1, 0, - 0,-1, 0, 0, - 0, 0, 0, 1 + 1, 0, 0, 0, + 0, 0, 1, 0, + 0, -1, 0, 0, + 0, 0, 0, 1 )); describe('and scale', () => { @@ -563,8 +565,8 @@ describe('Mat4', () => { describe('from a translation and rotation matrix', () => { beforeEach(() => { - let q = new Quat(); - let v = new Vec3(5, 6, 7); + const q = new Quat(); + const v = new Vec3(5, 6, 7); Quat.setAxisAngle(q, [0.26726124, 0.534522474, 0.8017837], 0.55); Mat4.fromRotationTranslation(out, q, v); @@ -590,8 +592,8 @@ describe('Mat4', () => { describe('from a scale-only matrix', () => { beforeEach(() => { - let v = new Vec3(4, 5, 6); - result = new Vec3(1, 2, 3) + const v = new Vec3(4, 5, 6); + result = new Vec3(1, 2, 3); out = new Vec3(1, 2, 3); Mat4.fromScaling(matA, v); result = Mat4.getScaling(out, matA); @@ -603,7 +605,7 @@ describe('Mat4', () => { describe('from a translation and rotation matrix', () => { beforeEach(() => { let q = Quat.create(); - let v = Vec3.fromValues(5, 6, 7); + const v = Vec3.fromValues(5, 6, 7); q = Quat.setAxisAngle(q, [1, 0, 0], 0.5) as Quat; Mat4.fromRotationTranslation(out, q, v); @@ -617,8 +619,8 @@ describe('Mat4', () => { describe('from a translation, rotation and scale matrix', () => { beforeEach(() => { let q = Quat.create(); - let t = Vec3.fromValues(1, 2, 3); - let s = Vec3.fromValues(5, 6, 7); + const t = Vec3.fromValues(1, 2, 3); + const s = Vec3.fromValues(5, 6, 7); q = Quat.setAxisAngle(q, [0, 1, 0], 0.7) as Quat; Mat4.fromRotationTranslationScale(out, q, t, s); result = Vec3.fromValues(5, 6, 7); @@ -639,7 +641,7 @@ describe('Mat4', () => { it('should place result both in result and out', () => expect(result).toBe(out)); it('should return the unit quaternion', () => { - let unitQuat = Quat.create(); + const unitQuat = Quat.create(); Quat.identity(unitQuat); expect(result).toBeVec(unitQuat); }); @@ -653,7 +655,7 @@ describe('Mat4', () => { }); it('should return the unit quaternion', () => { - let unitQuat = Quat.create(); + const unitQuat = Quat.create(); Quat.identity(unitQuat); expect(result).toBeVec(unitQuat); }); @@ -662,9 +664,9 @@ describe('Mat4', () => { describe('from a translation and rotation matrix', () => { it('should keep the same rotation as when created', () => { let q = Quat.create(); - let outVec = Vec3.fromValues(5, 6, 7); - let testVec = Vec3.fromValues(1, 5, 2); - let ang = 0.78972; + const outVec = Vec3.fromValues(5, 6, 7); + const testVec = Vec3.fromValues(1, 5, 2); + const ang = 0.78972; Vec3.normalize(testVec, testVec); q = Quat.setAxisAngle(q, testVec, ang) as Quat; @@ -672,8 +674,8 @@ describe('Mat4', () => { result = Quat.fromValues(2, 3, 4, 6); Mat4.getRotation(result, out); - let outaxis = Vec3.create(); - let outangle = Quat.getAxisAngle(outaxis, result); + const outaxis = Vec3.create(); + const outangle = Quat.getAxisAngle(outaxis, result); expect(outaxis).toBeVec(testVec); expect(outangle).toBeCloseTo(ang); @@ -732,7 +734,7 @@ describe('Mat4', () => { describe('perspectiveNO', () => { it('should have an alias called `perspective`', () => expect(Mat4.perspectiveNO).toEqual(Mat4.perspective)); - let fovy = Math.PI * 0.5; + const fovy = Math.PI * 0.5; beforeEach(() => { result = Mat4.perspectiveNO(out, fovy, 1, 0, 1); }); it('should place values into out', () => expect(result).toBeVec( @@ -744,7 +746,7 @@ describe('Mat4', () => { it('should return out', () => expect(result).toBe(out)); describe('with nonzero near, 45deg fovy, and realistic aspect ratio', () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, 200); }); + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640 / 480, 0.1, 200); }); it('should calculate correct matrix', () => expect(result).toBeVec( 1.81066, 0, 0, 0, @@ -755,7 +757,7 @@ describe('Mat4', () => { }); describe('with no far plane, 45deg fovy, and realistic aspect ratio', () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1); }); + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640 / 480, 0.1); }); it('should calculate correct matrix', () => expect(result).toBeVec( 1.81066, 0, 0, 0, @@ -766,7 +768,7 @@ describe('Mat4', () => { }); describe('with infinite far plane, 45deg fovy, and realistic aspect ratio', () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, Infinity); }); + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640 / 480, 0.1, Infinity); }); it('should calculate correct matrix', () => expect(result).toBeVec( 1.81066, 0, 0, 0, @@ -791,10 +793,10 @@ describe('Mat4', () => { }); describe('lookAt', () => { - let eye = new Float32Array([0, 0, 1]); - let center = new Float32Array([0, 0, -1]); - let up = new Float32Array([0, 1, 0]); - let view, right; + let eye: FloatArray = new Float32Array([0, 0, 1]); + let center: FloatArray = new Float32Array([0, 0, -1]); + let up: FloatArray = new Float32Array([0, 1, 0]); + let view: FloatArray, right: FloatArray; beforeEach(() => { eye = new Float32Array([0, 0, 1]); @@ -805,9 +807,9 @@ describe('Mat4', () => { describe('looking down', () => { beforeEach(() => { - view = new Float32Array([0, -1, 0]); - up = new Float32Array([0, 0, -1]); - right= new Float32Array([1, 0, 0]); + view = new Float32Array([0, -1, 0]); + up = new Float32Array([0, 0, -1]); + right = new Float32Array([1, 0, 0]); result = Mat4.lookAt(out, [0, 0, 0], view, up); }); @@ -832,9 +834,9 @@ describe('Mat4', () => { describe('#74', () => { beforeEach(() => { Mat4.lookAt(out, - new Float32Array([0,2,0]), - new Float32Array([0,0.6,0]), - new Float32Array([0,0,-1])); + new Float32Array([0, 2, 0]), + new Float32Array([0, 0.6, 0]), + new Float32Array([0, 0, -1])); }); it('should transform a point `above` into local +Y', () => { @@ -863,10 +865,10 @@ describe('Mat4', () => { }); describe('targetTo', () => { - let eye = new Float32Array([0, 0, 1]); - let center = new Float32Array([0, 0, -1]); - let up = new Float32Array([0, 1, 0]); - let view: Float32Array, right: Float32Array; + let eye: FloatArray = new Float32Array([0, 0, 1]); + let center: FloatArray = new Float32Array([0, 0, -1]); + let up: FloatArray = new Float32Array([0, 1, 0]); + let view: FloatArray, right: FloatArray; beforeEach(() => { eye = new Float32Array([0, 0, 1]); @@ -877,9 +879,9 @@ describe('Mat4', () => { describe('looking down', () => { beforeEach(() => { - view = new Float32Array([0, -1, 0]); - up = new Float32Array([0, 0, -1]); - right= new Float32Array([1, 0, 0]); + view = new Float32Array([0, -1, 0]); + up = new Float32Array([0, 0, -1]); + right = new Float32Array([1, 0, 0]); result = Mat4.targetTo(out, [0, 0, 0], view, up); }); @@ -901,7 +903,7 @@ describe('Mat4', () => { it('should return out', () => expect(result).toBe(out)); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float32Array(3), out); + const scaling = Mat4.getScaling(new Float32Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -909,9 +911,9 @@ describe('Mat4', () => { describe('#74', () => { beforeEach(() => { Mat4.targetTo(out, - new Float32Array([0,2,0]), - new Float32Array([0,0.6,0]), - new Float32Array([0,0,-1])); + new Float32Array([0, 2, 0]), + new Float32Array([0, 0.6, 0]), + new Float32Array([0, 0, -1])); }); it('should transform a point `above` into local +Y', () => { @@ -930,7 +932,7 @@ describe('Mat4', () => { }); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float32Array(3), out); + const scaling = Mat4.getScaling(new Float32Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -938,13 +940,13 @@ describe('Mat4', () => { describe('scaling test', () => { beforeEach(() => { Mat4.targetTo(out, - new Float32Array([0,1,0]), - new Float32Array([0,0,1]), - new Float32Array([0,0,-1])); + new Float32Array([0, 1, 0]), + new Float32Array([0, 0, 1]), + new Float32Array([0, 0, -1])); }); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float32Array(3), out); + const scaling = Mat4.getScaling(new Float32Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -957,7 +959,7 @@ describe('Mat4', () => { )); it('should return out', () => expect(result).toBe(out)); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float32Array(3), out); + const scaling = Mat4.getScaling(new Float32Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -966,14 +968,14 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.str(matA); }); it('should return a string representation of the matrix', - () => expect(result).toEqual('Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)')); + () => expect(result).toEqual('Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)')); }); describe('frob', () => { beforeEach(() => { result = Mat4.frob(matA); }); - it('should return the Frobenius Norm of the matrix', () => expect(result).toBeCloseTo( Math.sqrt(Math.pow(1, 2) + - Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) ))); + it('should return the Frobenius Norm of the matrix', () => expect(result).toBeCloseTo(Math.sqrt(Math.pow(1, 2) + + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2)))); }); describe('add', () => { @@ -986,28 +988,28 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.add(out, matA, matB); }); it('should place values into out', - () => expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + () => expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat4.add(matA, matA, matB); }); it('should place values into matA', - () => expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + () => expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); it('should return matA', () => expect(result).toBe(matA)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matB is the output matrix', () => { beforeEach(() => { result = Mat4.add(matB, matA, matB); }); it('should place values into matB', - () => expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + () => expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); it('should return matB', () => expect(result).toBe(matB)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); @@ -1025,28 +1027,28 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.subtract(out, matA, matB); }); it('should place values into out', - () => expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + () => expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat4.subtract(matA, matA, matB); }); it('should place values into matA', - () => expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + () => expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); it('should return matA', () => expect(result).toBe(matA)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matB is the output matrix', () => { beforeEach(() => { result = Mat4.subtract(matB, matA, matB); }); it('should place values into matB', - () => expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + () => expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); it('should return matB', () => expect(result).toBe(matB)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); @@ -1056,14 +1058,14 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); it('should return a 16 element array initialized to the values passed', - () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); describe('set', () => { beforeEach(() => { result = Mat4.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); it('should place values into out', - () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should return out', () => expect(result).toBe(out)); }); @@ -1074,7 +1076,7 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.multiplyScalar(out, matA, 2); }); it('should place values into out', - () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); @@ -1083,7 +1085,7 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.multiplyScalar(matA, matA, 2); }); it('should place values into matA', - () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); it('should return matA', () => expect(result).toBe(matA)); }); }); @@ -1098,35 +1100,35 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.multiplyScalarAndAdd(out, matA, matB, 0.5); }); it('should place values into out', - () => expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + () => expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); it('should place values into matA', - () => expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + () => expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); it('should return matA', () => expect(result).toBe(matA)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matB is the output matrix', () => { beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); it('should place values into matB', - () => expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + () => expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); it('should return matB', () => expect(result).toBe(matB)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); }); describe('exactEquals', () => { - let matC, r0, r1; + let matC: Mat4Like, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; @@ -1143,7 +1145,7 @@ describe('Mat4', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat4Like, matD: Mat4Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; diff --git a/tests/f32/Quat.spec.ts b/tests/f32/Quat.spec.ts index 5b1b4b61..312f0d9a 100644 --- a/tests/f32/Quat.spec.ts +++ b/tests/f32/Quat.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Quat, Vec3 } from '#gl-matrix'; -import type { Vec3Like, QuatLike } from '#gl-matrix/types'; +import type { Vec3Like, Vec4Like, QuatLike } from '#gl-matrix/types'; describe('Quat', () => { describe('constructor', () => { @@ -24,21 +24,21 @@ describe('Quat', () => { }); it('should return Quat(x, y, z, w) if called with (Quat(x, y, z, w))', () => { - let v = new Quat(3.4, 5.6, 7.8, 9); + const v = new Quat(3.4, 5.6, 7.8, 9); expect(new Quat(v)).toBeVec(v); }); it('should return Quat(x, y, z, w) if called with (Float32Array([x, y, z, w]))', () => { - let arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); + const arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); expect(new Quat(arr)).toBeVec(arr); }); }); describe('static', () => { - let out: Quat + let out: Quat; let quatA: QuatLike; let quatB: QuatLike; - let result: any; + let result: Vec4Like | number | string; let vec: Vec3Like; const id = new Quat(0, 0, 0, 1); @@ -68,11 +68,11 @@ describe('Quat', () => { describe('where theta == 180deg', () => { beforeEach(() => { - Quat.rotateX(quatA, [1,0,0,0], Math.PI); // 180 deg - result = Quat.slerp(out, [1,0,0,0], quatA, 1); + Quat.rotateX(quatA, [1, 0, 0, 0], Math.PI); // 180 deg + result = Quat.slerp(out, [1, 0, 0, 0], quatA, 1); }); - it('should calculate proper quat', () => expect(result).toBeVec(0,0,0,-1)); + it('should calculate proper quat', () => expect(result).toBeVec(0, 0, 0, -1)); }); describe('where a == -b', () => { @@ -99,7 +99,7 @@ describe('Quat', () => { }); it('should be the identity', () => expect(result).toBeVec(quatA)); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); describe('squared', () => { @@ -110,11 +110,11 @@ describe('Quat', () => { }); it('should be the square', () => { - let reference = Quat.multiply(Quat.create(), quatA, quatA); + const reference = Quat.multiply(Quat.create(), quatA, quatA); expect(result).toBeVec(reference); }); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); describe('conjugate', () => { @@ -125,23 +125,23 @@ describe('Quat', () => { }); it('should be the conjugate', () => { - let reference = Quat.conjugate(Quat.create(), quatA); + const reference = Quat.conjugate(Quat.create(), quatA); expect(result).toBeVec(reference); }); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); describe('reversible', () => { beforeEach(() => { Quat.normalize(quatA, quatA); - let b = 2.1; // random number + const b = 2.1; // random number result = Quat.pow(out, quatA, b); - result = Quat.pow(out, result, 1/b); + result = Quat.pow(out, result, 1 / b); }); it('should be reverted', () => expect(result).toBeVec(quatA)); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); }); @@ -150,7 +150,7 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should transform vec accordingly', () => { - Vec3.transformQuat(vec, [0,0,-1], out); + Vec3.transformQuat(vec, [0, 0, -1], out); expect(vec).toBeVec(0, 1, 0); }); }); @@ -160,7 +160,7 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should transform vec accordingly', () => { - Vec3.transformQuat(vec, [0,0,-1], out); + Vec3.transformQuat(vec, [0, 0, -1], out); expect(vec).toBeVec(-1, 0, 0); }); }); @@ -170,12 +170,13 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should transform vec accordingly', () => { - Vec3.transformQuat(vec, [0,1,0], out); + Vec3.transformQuat(vec, [0, 1, 0], out); expect(vec).toBeVec(-1, 0, 0); }); }); - /*describe('fromMat3', () => { + /* + describe('fromMat3', () => { let matr; describe('legacy', () => { @@ -259,11 +260,12 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should produce the correct transformation', - () => expect(Vec3.transformQuat([0, 0, 0], [0,1,0], out)).toBeVec(0,0,-1)); + () => expect(Vec3.transformQuat([0, 0, 0], [0, 1, 0], out)).toBeVec(0, 0, -1)); }); }); - /*describe('setAxes', () => { + /* + describe('setAxes', () => { let r; beforeEach(() => { r = Vec3.create(); }); @@ -317,7 +319,7 @@ describe('Quat', () => { });*/ describe('rotationTo', () => { - let r; + let r: Vec3; beforeEach(() => { r = Vec3.create(); }); @@ -361,7 +363,7 @@ describe('Quat', () => { beforeEach(() => { result = Quat.create(); }); it('should return a 4 element array initialized to an identity quaternion', - () => expect(result).toBeVec(0, 0, 0, 1)); + () => expect(result).toBeVec(0, 0, 0, 1)); }); describe('clone', () => { @@ -411,7 +413,7 @@ describe('Quat', () => { beforeEach(() => { result = Quat.setAxisAngle(out, [0, 1, 0], 0.0); angle = Quat.getAxisAngle(vec, out); }); it('should return a multiple of 2*PI as the angle component', - () => expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0)); + () => expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0)); }); describe('for a simple rotation about X axis', () => { @@ -490,10 +492,10 @@ describe('Quat', () => { it('should be equalish', () => { // compute reference value as axisAngle of quatA^{-1} * quatB - let quatAInv = Quat.conjugate(Quat.create(), quatA); - let quatAB = Quat.multiply(quatAInv, quatAInv, quatB); - let dummy = Vec3.create(); - let reference = Quat.getAxisAngle(dummy, quatAB); + const quatAInv = Quat.conjugate(Quat.create(), quatA); + const quatAB = Quat.multiply(quatAInv, quatAInv, quatB); + const dummy = Vec3.create(); + const reference = Quat.getAxisAngle(dummy, quatAB); expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(reference); }); @@ -660,7 +662,8 @@ describe('Quat', () => { }); }); - /*describe('random', () => { + /* + describe('random', () => { beforeEach(() => { result = Quat.random(out); }); it('should result in a normalized quaternion', () => { @@ -711,7 +714,7 @@ describe('Quat', () => { }); describe('exactEquals', () => { - let quatC, r0, r1; + let quatC: Vec4Like, r0: boolean, r1: boolean; beforeEach(() => { quatA = [0, 1, 2, 3]; @@ -728,7 +731,7 @@ describe('Quat', () => { }); describe('equals', () => { - let quatC, quatD, r0, r1, r2; + let quatC: Vec4Like, quatD: Vec4Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { quatA = [0, 1, 2, 3]; diff --git a/tests/f32/Quat2.spec.ts b/tests/f32/Quat2.spec.ts index 824a1c94..1c63ff12 100644 --- a/tests/f32/Quat2.spec.ts +++ b/tests/f32/Quat2.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat4, Quat, Quat2, Vec3 } from '#gl-matrix'; -import type { QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; +import type { QuatLike, Quat2Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; describe('Quat2', () => { describe('constructor', () => { @@ -12,7 +12,8 @@ describe('Quat2', () => { it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (x, y, z, w, x2, y2, z2, w2)', () => { expect(new Quat2(1, 2, 3, 4, 5, 6, 7, 8)).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec( + -3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); }); it('should return Quat(x, x, x, x, x, x, x, x) if called with (x)', () => { @@ -22,18 +23,20 @@ describe('Quat2', () => { it('should return Quat(x, y, z, w) if called with ([x, y, z, w])', () => { expect(new Quat2([1, 2, 3, 4, 5, 6, 7, 8])).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec( + -3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); }); it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Quat(x, y, z, w, x2, y2, z2, w2))', () => { - let v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); + const v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); expect(new Quat2(v)).toBeVec(v); }); - it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float32Array([x, y, z, w, x2, y2, z2, w2]))', () => { - let arr = new Float32Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); - expect(new Quat2(arr)).toBeVec(arr); - }); + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float32Array([x, y, z, w, x2, y2, z2, w2]))', + () => { + const arr = new Float32Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); + expect(new Quat2(arr)).toBeVec(arr); + }); }); describe('static', () => { @@ -41,7 +44,7 @@ describe('Quat2', () => { let outVec: Vec3; let quat2A: Quat2Like; let quat2B: Quat2Like; - let result: any; + let result: Vec4Like | Quat2Like | number | string; let resultVec: Vec3Like; let outQuat: QuatLike; let vec: Vec3Like; @@ -56,11 +59,11 @@ describe('Quat2', () => { }); describe('translate', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]); Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -68,7 +71,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.translate(out, quat2A, vec); - //Same thing with a matrix + // Same thing with a matrix Mat4.translate(matOut, matrixA, vec); Quat2.fromMat4(quatOut, matOut); }); @@ -76,13 +79,13 @@ describe('Quat2', () => { it('should place values into out', () => expect(out).toBeQuat2(quatOut)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); - it('should not modify vec', () => expect(vec).toBeVec(1,1,-1)); + it('should not modify vec', () => expect(vec).toBeVec(1, 1, -1)); }); describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.translate(quat2A, quat2A, vec); - //Same thing with a matrix + // Same thing with a matrix Mat4.translate(matOut, matrixA, vec); Quat2.fromMat4(quatOut, matOut); }); @@ -93,13 +96,13 @@ describe('Quat2', () => { }); describe('rotateAroundAxis', () => { - let matrixA = new Mat4(); - let matOut = new Mat4(); - let ax: Vec3Like = [1,4,2]; + const matrixA = new Mat4(); + const matOut = new Mat4(); + const ax: Vec3Like = [1, 4, 2]; beforeEach(() => { - //quat2A only seems to work when created using this function? - Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + // quat2A only seems to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]); Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -108,7 +111,7 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.rotateAroundAxis(out, quat2A, ax, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotate(matOut, matrixA, 5, ax); Quat2.fromMat4(quat2B, matOut); }); @@ -125,7 +128,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateAroundAxis(quat2A, quat2A, ax, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotate(matOut, matrixA, 5, ax); Quat2.fromMat4(quat2B, matOut); @@ -138,8 +141,8 @@ describe('Quat2', () => { }); describe('rotateByQuatAppend', () => { - let correctResult = Quat2.create(); - let rotationQuat = Quat2.create(); + const correctResult = Quat2.create(); + const rotationQuat = Quat2.create(); beforeEach(() => { rotationQuat[0] = 2; @@ -155,7 +158,7 @@ describe('Quat2', () => { it('should place values into out', () => expect(out).toBeQuat2(correctResult)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); describe('when quat2A is the output quaternion', () => { @@ -163,13 +166,13 @@ describe('Quat2', () => { it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); it('should return quat2A', () => expect(result).toBe(quat2A)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); }); describe('rotateByQuatPrepend', () => { - let correctResult = Quat2.create(); - let rotationQuat = Quat2.create(); + const correctResult = Quat2.create(); + const rotationQuat = Quat2.create(); beforeEach(() => { rotationQuat[0] = 2; @@ -185,7 +188,7 @@ describe('Quat2', () => { it('should place values into out', () => expect(out).toBeQuat2(correctResult)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); describe('when quat2A is the output quaternion', () => { @@ -193,16 +196,16 @@ describe('Quat2', () => { it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); it('should return quat2A', () => expect(result).toBe(quat2A)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); }); describe('rotateX', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]) as Quat2; + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]) as Quat2; Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -210,7 +213,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.rotateX(out, quat2A, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateX(matOut, matrixA, 5); Quat2.fromMat4(quatOut, matOut); }); @@ -223,7 +226,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateX(quat2A, quat2A, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateX(matOut, matrixA, 5); Quat2.fromMat4(quatOut, matOut); }); @@ -234,11 +237,11 @@ describe('Quat2', () => { }); describe('rotateY', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [5, 4, -10]) as Quat2; + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [5, 4, -10]) as Quat2; Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -246,7 +249,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.rotateY(out, quat2A, -2); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateY(matOut, matrixA, -2); Quat2.fromMat4(quatOut, matOut); }); @@ -259,7 +262,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateY(quat2A, quat2A, -2); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateY(matOut, matrixA, -2); Quat2.fromMat4(quatOut, matOut); }); @@ -270,11 +273,11 @@ describe('Quat2', () => { }); describe('rotateZ', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,0,3,-4], [0, -4, -10]) as Quat2; + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 0, 3, -4], [0, -4, -10]) as Quat2; Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -282,7 +285,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.rotateZ(out, quat2A, 1); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateZ(matOut, matrixA, 1); Quat2.fromMat4(quatOut, matOut); }); @@ -295,7 +298,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateZ(quat2A, quat2A, 1); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateZ(matOut, matrixA, 1); Quat2.fromMat4(quatOut, matOut); }); @@ -306,14 +309,15 @@ describe('Quat2', () => { }); describe('from/toMat4', () => { - let matRes = Mat4.create(), matOut = Mat4.create(); - let rotationQuat = Quat.create(); + let matRes = Mat4.create(); + const matOut = Mat4.create(); + const rotationQuat = Quat.create(); describe('quat to matrix and back', () => { beforeEach(() => { - Quat.normalize(rotationQuat, [1,2,3,4]); + Quat.normalize(rotationQuat, [1, 2, 3, 4]); - Quat2.fromRotationTranslation(quat2A, rotationQuat, [1,-5,3]); + Quat2.fromRotationTranslation(quat2A, rotationQuat, [1, -5, 3]); matRes = Mat4.fromQuat2(matOut, quat2A) as Mat4; result = Quat2.fromMat4(out, matRes); @@ -322,8 +326,8 @@ describe('Quat2', () => { it('should return out', () => expect(result).toBe(out)); it('should return matOut', () => expect(matRes).toBe(matOut)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(0.18257418, 0.36514836, 0.54772257, 0.73029673, - -1.5518806, -1.82574184, 1.73445473, 0 )); - it('should be equal to the starting dual quat', () => expect(quat2A).toBeQuat2(result)); + -1.5518806, -1.82574184, 1.73445473, 0)); + it('should be equal to the starting dual quat', () => expect(quat2A).toBeQuat2(result as Quat2Like)); }); }); @@ -331,21 +335,21 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.create(); }); it('should return 2 4 element arrays initialized to an identity dual quaternion', - () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); + () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); }); describe('clone', () => { beforeEach(() => { result = Quat2.clone(quat2A); }); it('should return 2 4 element arrays initialized to the values in quat2A', - () => expect(result).toBeQuat2(quat2A)); + () => expect(result).toBeQuat2(quat2A)); }); describe('fromValues', () => { beforeEach(() => { result = Quat2.fromValues(1, 2, 3, 4, 5, 7, 8, -2); }); it('should return 2 4 element arrays initialized to the values passedd to the values passed', - () => expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2)); + () => expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2)); }); describe('copy', () => { @@ -411,7 +415,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.multiply(quat2A, quat2A, quat2B); }); - it('should place values into quat2A', () => expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157 )); + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157)); it('should return quat2A', () => expect(result).toBe(quat2A)); it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); }); @@ -425,12 +429,12 @@ describe('Quat2', () => { }); describe('same as matrix multiplication', () => { - let matrixA = Mat4.create(), matrixB = Mat4.create(); - let matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matrixB = Mat4.create(); + const matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A and quat2B only seem to work when created using this function? - Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + // quat2A and quat2B only seem to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]); Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); @@ -440,7 +444,7 @@ describe('Quat2', () => { }); it('the matrices should be equal to the dual quaternions', () => { - let testQuat = Quat2.create(); + const testQuat = Quat2.create(); Quat2.fromMat4(testQuat, matrixA); expect(testQuat).toBeQuat2(...quat2A); @@ -515,7 +519,7 @@ describe('Quat2', () => { it('should not modify the quaternion', () => expect(Quat2.getReal(outQuat, quat2A)).toBeVec(1, 2, 3, 4)); it('should not modify the vector', () => expect(vec).toBeVec(1, 2, 3)); it('should have a translation that can be retrieved with getTranslation', () => { - let t: Vec3Like = [0, 0, 0]; + const t: Vec3Like = [0, 0, 0]; Quat2.normalize(out, out); Quat2.getTranslation(t, out); @@ -524,14 +528,14 @@ describe('Quat2', () => { }); describe('fromRotationTranslationValues', () => { - beforeEach(() => { result = Quat2.fromRotationTranslationValues(1,2,3,4, 1,2,3); }); + beforeEach(() => { result = Quat2.fromRotationTranslationValues(1, 2, 3, 4, 1, 2, 3); }); it('should return the correct result', () => expect(result).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7)); it('should have a translation that can be retrieved with getTranslation', () => { - let t: Vec3Like = [0, 0, 0]; + const t: Vec3Like = [0, 0, 0]; - Quat2.normalize(result, result); - Quat2.getTranslation(t, result); + Quat2.normalize(result as Quat2Like, result as Quat2Like); + Quat2.getTranslation(t, result as Quat2Like); expect(t).toBeVec(1, 2, 3); }); }); @@ -539,7 +543,7 @@ describe('Quat2', () => { describe('getTranslation', () => { describe('without a real part', () => { beforeEach(() => { - Quat2.fromTranslation(out, [1,2,3]); + Quat2.fromTranslation(out, [1, 2, 3]); resultVec = Quat2.getTranslation(outVec, out); }); @@ -584,8 +588,8 @@ describe('Quat2', () => { Quat2.normalize(out, quat2A); }); - it('both parts should have been normalized', () => expect(out).toBeQuat2(1/5.4772255, 2/5.4772255, - 3/5.4772255, 4/5.4772255, 0.231260, 0.6450954, 0.693781,-0.9006993)); + it('both parts should have been normalized', () => expect(out).toBeQuat2(1 / 5.4772255, 2 / 5.4772255, + 3 / 5.4772255, 4 / 5.4772255, 0.231260, 0.6450954, 0.693781, -0.9006993)); }); beforeEach(() => { quat2A = [5, 0, 0, 0, 0, 0, 0, 0]; }); @@ -628,7 +632,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.lerp(quat2A, quat2A, quat2B, 0.5); }); - it('should place values into quat2A', () => expect(quat2A).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(3, 4, 5, 6, 5.5, 6.5, 6, -3)); it('should return quat2A', () => expect(result).toBe(quat2A)); it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); }); @@ -636,7 +640,7 @@ describe('Quat2', () => { describe('when quat2B is the output quaternion', () => { beforeEach(() => { result = Quat2.lerp(quat2B, quat2A, quat2B, 0.5); }); - it('should place values into quat2B', () => expect(quat2B).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(3, 4, 5, 6, 5.5, 6.5, 6, -3)); it('should return quat2B', () => expect(result).toBe(quat2B)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); }); @@ -644,7 +648,7 @@ describe('Quat2', () => { describe('shortest path', () => { beforeEach(() => { result = Quat2.lerp(out, [1, 2, 3, -4, 2, 5, 6, -2], [5, -6, 7, 8, 9, 8, 6, -4], 0.4); }); - it('should pick the shorter path', () => expect(out).toBeQuat2( -1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4 )); + it('should pick the shorter path', () => expect(out).toBeQuat2(-1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4)); }); }); @@ -663,7 +667,7 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.invert(out, quat2A); }); it('should place values into out', () => expect(out).toBeQuat2( - -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2 / 30, -5 / 30, -6 / 30, -2 / 30)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); it('the real part should be equal to a inverted quaternion', () => { @@ -676,7 +680,7 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.invert(quat2A, quat2A); }); it('should place values into quat2A', () => expect(quat2A).toBeVec( - -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2 / 30, -5 / 30, -6 / 30, -2 / 30)); it('should return quat2A', () => expect(result).toBe(quat2A)); }); }); @@ -744,11 +748,11 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.str(quat2A); }); it('should return a string representation of the quaternion', - () => expect(result).toEqual('Quat2(1, 2, 3, 4, 2, 5, 6, -2)')); + () => expect(result).toEqual('Quat2(1, 2, 3, 4, 2, 5, 6, -2)')); }); describe('exactEquals', () => { - let quat2C, r0, r1; + let quat2C: Quat2Like, r0: boolean, r1: boolean; beforeEach(() => { quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; @@ -765,7 +769,7 @@ describe('Quat2', () => { }); describe('equals', () => { - let quat2C, quat2D, r0, r1, r2; + let quat2C: Quat2Like, quat2D: Quat2Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; diff --git a/tests/f32/Vec2-swizzle.spec.ts b/tests/f32/Vec2-swizzle.spec.ts index bdcbcf57..767a610c 100644 --- a/tests/f32/Vec2-swizzle.spec.ts +++ b/tests/f32/Vec2-swizzle.spec.ts @@ -16,506 +16,506 @@ describe('Vec2 Swizzles', () => { describe('Vec2().xx', () => { it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.xx; + const sw = v.xx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xy', () => { it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.xy; + const sw = v.xy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yx', () => { it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.yx; + const sw = v.yx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yy', () => { it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.yy; + const sw = v.yy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxx', () => { it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxx; + const sw = v.xxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxy', () => { it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxy; + const sw = v.xxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyx', () => { it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyx; + const sw = v.xyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyy', () => { it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyy; + const sw = v.xyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxx', () => { it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxx; + const sw = v.yxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxy', () => { it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxy; + const sw = v.yxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyx', () => { it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyx; + const sw = v.yyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyy', () => { it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyy; + const sw = v.yyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxxx', () => { it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxxx; + const sw = v.xxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxxy', () => { it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxxy; + const sw = v.xxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxyx', () => { it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xxyx; + const sw = v.xxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxyy', () => { it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xxyy; + const sw = v.xxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyxx', () => { it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xyxx; + const sw = v.xyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyxy', () => { it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xyxy; + const sw = v.xyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyyx', () => { it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyyx; + const sw = v.xyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyyy', () => { it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyyy; + const sw = v.xyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxxx', () => { it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxxx; + const sw = v.yxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxxy', () => { it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxxy; + const sw = v.yxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxyx', () => { it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yxyx; + const sw = v.yxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxyy', () => { it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yxyy; + const sw = v.yxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyxx', () => { it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yyxx; + const sw = v.yyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyxy', () => { it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yyxy; + const sw = v.yyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyyx', () => { it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyyx; + const sw = v.yyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyyy', () => { it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyyy; + const sw = v.yyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rr', () => { it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.rr; + const sw = v.rr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rg', () => { it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.rg; + const sw = v.rg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gr', () => { it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.gr; + const sw = v.gr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gg', () => { it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.gg; + const sw = v.gg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrr', () => { it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrr; + const sw = v.rrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrg', () => { it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrg; + const sw = v.rrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgr', () => { it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rgr; + const sw = v.rgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgg', () => { it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rgg; + const sw = v.rgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grr', () => { it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grr; + const sw = v.grr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grg', () => { it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grg; + const sw = v.grg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggr', () => { it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ggr; + const sw = v.ggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggg', () => { it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ggg; + const sw = v.ggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrrr', () => { it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrrr; + const sw = v.rrrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrrg', () => { it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrrg; + const sw = v.rrrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrgr', () => { it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rrgr; + const sw = v.rrgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrgg', () => { it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rrgg; + const sw = v.rrgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgrr', () => { it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rgrr; + const sw = v.rgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgrg', () => { it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rgrg; + const sw = v.rgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rggr', () => { it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rggr; + const sw = v.rggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rggg', () => { it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rggg; + const sw = v.rggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grrr', () => { it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grrr; + const sw = v.grrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grrg', () => { it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grrg; + const sw = v.grrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grgr', () => { it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.grgr; + const sw = v.grgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grgg', () => { it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.grgg; + const sw = v.grgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggrr', () => { it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ggrr; + const sw = v.ggrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggrg', () => { it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ggrg; + const sw = v.ggrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gggr', () => { it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gggr; + const sw = v.gggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gggg', () => { it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gggg; + const sw = v.gggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + // [/Swizzle Autogen] }); diff --git a/tests/f32/Vec2.spec.ts b/tests/f32/Vec2.spec.ts index 56528f97..e0cdde72 100644 --- a/tests/f32/Vec2.spec.ts +++ b/tests/f32/Vec2.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Vec2 } from '#gl-matrix'; -import type { Vec2Like } from '#gl-matrix/types'; +import type { Mat2Like, Mat2dLike, Vec2Like, Vec3Like } from '#gl-matrix/types'; describe('Vec2', () => { let vecA: Vec2; @@ -34,12 +34,12 @@ describe('Vec2', () => { }); it('should return Vec2(x, y) if called with (Vec2(x, y))', () => { - let v = new Vec2(3.4, 5.6); + const v = new Vec2(3.4, 5.6); expect(new Vec2(v)).toBeVec(v); }); it('should return Vec2(x, y) if called with (Float32Array([x, y]))', () => { - let arr = new Float32Array([1.2, 3.4]); + const arr = new Float32Array([1.2, 3.4]); expect(new Vec2(arr)).toBeVec(arr); }); }); @@ -78,7 +78,7 @@ describe('Vec2', () => { }); describe('with raw array as the output', () => { - let outArray: Vec2Like = [0, 0]; + const outArray: Vec2Like = [0, 0]; beforeEach(() => { result = Vec2.add(outArray, vecA, vecB); }); it('should place values into out', () => expect(outArray).toBeVec(4, 6)); @@ -95,7 +95,7 @@ describe('Vec2', () => { }); describe('static', () => { - let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: any; + let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: Vec2Like | number; beforeEach(() => { vecA = new Vec2(1, 2); @@ -457,7 +457,7 @@ describe('Vec2', () => { describe('with a separate output vector', () => { beforeEach(() => { result = Vec2.inverse(out, vecA); }); - it('should place values into out', () => expect(out).toBeVec(1, 1/2)); + it('should place values into out', () => expect(out).toBeVec(1, 1 / 2)); it('should return out', () => expect(result).toBe(out)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); }); @@ -465,7 +465,7 @@ describe('Vec2', () => { describe('when vecA is the output vector', () => { beforeEach(() => { result = Vec2.inverse(vecA, vecA); }); - it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2)); + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1 / 2)); it('should return vecA', () => expect(result).toBe(vecA)); }); }); @@ -516,11 +516,11 @@ describe('Vec2', () => { }); describe('cross', () => { - let out3; + let out3: Vec3Like; beforeEach(() => { out3 = [0, 0, 0]; - result = Vec2.cross(out3, vecA, vecB); + result = Vec2.cross(out3 as unknown as Vec2Like, vecA, vecB); }); it('should place values into out', () => expect(out3).toBeVec(0, 0, -2)); @@ -556,7 +556,8 @@ describe('Vec2', () => { }); }); - /*describe('random', () => { + /* + describe('random', () => { describe('with no scale', () => { beforeEach(() => { result = Vec2.random(out); }); @@ -573,7 +574,7 @@ describe('Vec2', () => { });*/ describe('transformMat2', () => { - let matA; + let matA: Mat2Like; beforeEach(() => { matA = [1, 2, 3, 4]; }); @@ -596,7 +597,7 @@ describe('Vec2', () => { }); describe('transformMat2d', () => { - let matA; + let matA: Mat2dLike; beforeEach(() => { matA = [1, 2, 3, 4, 5, 6]; }); @@ -618,7 +619,8 @@ describe('Vec2', () => { }); }); - /*describe('forEach', () => { + /* + describe('forEach', () => { let vecArray; beforeEach(() => { @@ -736,8 +738,8 @@ describe('Vec2', () => { describe('angle', () => { beforeEach(() => { - vecA = [1,0]; - vecB = [1,2]; + vecA = [1, 0]; + vecB = [1, 2]; result = Vec2.angle(vecA, vecB); }); @@ -751,7 +753,7 @@ describe('Vec2', () => { }); describe('exactEquals', () => { - let vecC, r0, r1; + let vecC: Vec2Like, r0: boolean, r1: boolean; beforeEach(() => { vecA = [0, 1]; @@ -768,7 +770,7 @@ describe('Vec2', () => { }); describe('equals', () => { - let vecC, vecD, r0, r1, r2; + let vecC: Vec2Like, vecD: Vec2Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { vecA = [0, 1]; diff --git a/tests/f32/Vec3-swizzle.spec.ts b/tests/f32/Vec3-swizzle.spec.ts index 077a706d..d7ee3ce3 100644 --- a/tests/f32/Vec3-swizzle.spec.ts +++ b/tests/f32/Vec3-swizzle.spec.ts @@ -16,2108 +16,2108 @@ describe('Vec3 Swizzles', () => { describe('Vec3().xx', () => { it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.xx; + const sw = v.xx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xy', () => { it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.xy; + const sw = v.xy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xz', () => { it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.xz; + const sw = v.xz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yx', () => { it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.yx; + const sw = v.yx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yy', () => { it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.yy; + const sw = v.yy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yz', () => { it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.yz; + const sw = v.yz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zx', () => { it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.zx; + const sw = v.zx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zy', () => { it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.zy; + const sw = v.zy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zz', () => { it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.zz; + const sw = v.zz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxx', () => { it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxx; + const sw = v.xxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxy', () => { it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxy; + const sw = v.xxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxz', () => { it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxz; + const sw = v.xxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyx', () => { it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyx; + const sw = v.xyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyy', () => { it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyy; + const sw = v.xyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyz', () => { it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyz; + const sw = v.xyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzx', () => { it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzx; + const sw = v.xzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzy', () => { it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzy; + const sw = v.xzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzz', () => { it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzz; + const sw = v.xzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxx', () => { it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxx; + const sw = v.yxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxy', () => { it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxy; + const sw = v.yxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxz', () => { it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxz; + const sw = v.yxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyx', () => { it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyx; + const sw = v.yyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyy', () => { it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyy; + const sw = v.yyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyz', () => { it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyz; + const sw = v.yyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzx', () => { it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzx; + const sw = v.yzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzy', () => { it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzy; + const sw = v.yzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzz', () => { it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzz; + const sw = v.yzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxx', () => { it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxx; + const sw = v.zxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxy', () => { it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxy; + const sw = v.zxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxz', () => { it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxz; + const sw = v.zxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyx', () => { it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyx; + const sw = v.zyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyy', () => { it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyy; + const sw = v.zyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyz', () => { it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyz; + const sw = v.zyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzx', () => { it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzx; + const sw = v.zzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzy', () => { it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzy; + const sw = v.zzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzz', () => { it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzz; + const sw = v.zzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxxx', () => { it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxxx; + const sw = v.xxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxxy', () => { it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxxy; + const sw = v.xxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxxz', () => { it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxxz; + const sw = v.xxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxyx', () => { it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xxyx; + const sw = v.xxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxyy', () => { it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xxyy; + const sw = v.xxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxyz', () => { it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xxyz; + const sw = v.xxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxzx', () => { it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xxzx; + const sw = v.xxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxzy', () => { it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xxzy; + const sw = v.xxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxzz', () => { it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xxzz; + const sw = v.xxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyxx', () => { it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xyxx; + const sw = v.xyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyxy', () => { it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xyxy; + const sw = v.xyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyxz', () => { it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xyxz; + const sw = v.xyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyyx', () => { it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyyx; + const sw = v.xyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyyy', () => { it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyyy; + const sw = v.xyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyyz', () => { it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyyz; + const sw = v.xyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyzx', () => { it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xyzx; + const sw = v.xyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyzy', () => { it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xyzy; + const sw = v.xyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyzz', () => { it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xyzz; + const sw = v.xyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzxx', () => { it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xzxx; + const sw = v.xzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzxy', () => { it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xzxy; + const sw = v.xzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzxz', () => { it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xzxz; + const sw = v.xzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzyx', () => { it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xzyx; + const sw = v.xzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzyy', () => { it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xzyy; + const sw = v.xzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzyz', () => { it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xzyz; + const sw = v.xzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzzx', () => { it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzzx; + const sw = v.xzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzzy', () => { it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzzy; + const sw = v.xzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzzz', () => { it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzzz; + const sw = v.xzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxxx', () => { it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxxx; + const sw = v.yxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxxy', () => { it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxxy; + const sw = v.yxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxxz', () => { it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxxz; + const sw = v.yxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxyx', () => { it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yxyx; + const sw = v.yxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxyy', () => { it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yxyy; + const sw = v.yxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxyz', () => { it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yxyz; + const sw = v.yxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxzx', () => { it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yxzx; + const sw = v.yxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxzy', () => { it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yxzy; + const sw = v.yxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxzz', () => { it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yxzz; + const sw = v.yxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyxx', () => { it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yyxx; + const sw = v.yyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyxy', () => { it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yyxy; + const sw = v.yyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyxz', () => { it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yyxz; + const sw = v.yyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyyx', () => { it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyyx; + const sw = v.yyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyyy', () => { it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyyy; + const sw = v.yyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyyz', () => { it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyyz; + const sw = v.yyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyzx', () => { it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yyzx; + const sw = v.yyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyzy', () => { it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yyzy; + const sw = v.yyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyzz', () => { it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yyzz; + const sw = v.yyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzxx', () => { it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yzxx; + const sw = v.yzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzxy', () => { it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yzxy; + const sw = v.yzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzxz', () => { it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yzxz; + const sw = v.yzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzyx', () => { it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yzyx; + const sw = v.yzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzyy', () => { it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yzyy; + const sw = v.yzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzyz', () => { it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yzyz; + const sw = v.yzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzzx', () => { it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzzx; + const sw = v.yzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzzy', () => { it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzzy; + const sw = v.yzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzzz', () => { it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzzz; + const sw = v.yzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxxx', () => { it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxxx; + const sw = v.zxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxxy', () => { it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxxy; + const sw = v.zxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxxz', () => { it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxxz; + const sw = v.zxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxyx', () => { it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zxyx; + const sw = v.zxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxyy', () => { it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zxyy; + const sw = v.zxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxyz', () => { it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zxyz; + const sw = v.zxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxzx', () => { it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zxzx; + const sw = v.zxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxzy', () => { it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zxzy; + const sw = v.zxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxzz', () => { it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zxzz; + const sw = v.zxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyxx', () => { it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zyxx; + const sw = v.zyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyxy', () => { it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zyxy; + const sw = v.zyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyxz', () => { it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zyxz; + const sw = v.zyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyyx', () => { it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyyx; + const sw = v.zyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyyy', () => { it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyyy; + const sw = v.zyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyyz', () => { it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyyz; + const sw = v.zyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyzx', () => { it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zyzx; + const sw = v.zyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyzy', () => { it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zyzy; + const sw = v.zyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyzz', () => { it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zyzz; + const sw = v.zyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzxx', () => { it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zzxx; + const sw = v.zzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzxy', () => { it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zzxy; + const sw = v.zzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzxz', () => { it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zzxz; + const sw = v.zzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzyx', () => { it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zzyx; + const sw = v.zzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzyy', () => { it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zzyy; + const sw = v.zzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzyz', () => { it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zzyz; + const sw = v.zzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzzx', () => { it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzzx; + const sw = v.zzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzzy', () => { it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzzy; + const sw = v.zzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzzz', () => { it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzzz; + const sw = v.zzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rr', () => { it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.rr; + const sw = v.rr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rg', () => { it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.rg; + const sw = v.rg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rb', () => { it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.rb; + const sw = v.rb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gr', () => { it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.gr; + const sw = v.gr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gg', () => { it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.gg; + const sw = v.gg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gb', () => { it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.gb; + const sw = v.gb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().br', () => { it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.br; + const sw = v.br; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bg', () => { it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.bg; + const sw = v.bg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bb', () => { it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.bb; + const sw = v.bb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrr', () => { it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrr; + const sw = v.rrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrg', () => { it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrg; + const sw = v.rrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrb', () => { it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrb; + const sw = v.rrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgr', () => { it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rgr; + const sw = v.rgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgg', () => { it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rgg; + const sw = v.rgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgb', () => { it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rgb; + const sw = v.rgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbr', () => { it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbr; + const sw = v.rbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbg', () => { it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbg; + const sw = v.rbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbb', () => { it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbb; + const sw = v.rbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grr', () => { it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grr; + const sw = v.grr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grg', () => { it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grg; + const sw = v.grg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grb', () => { it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grb; + const sw = v.grb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggr', () => { it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ggr; + const sw = v.ggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggg', () => { it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ggg; + const sw = v.ggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggb', () => { it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ggb; + const sw = v.ggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbr', () => { it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbr; + const sw = v.gbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbg', () => { it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbg; + const sw = v.gbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbb', () => { it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbb; + const sw = v.gbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brr', () => { it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brr; + const sw = v.brr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brg', () => { it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brg; + const sw = v.brg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brb', () => { it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brb; + const sw = v.brb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgr', () => { it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bgr; + const sw = v.bgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgg', () => { it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bgg; + const sw = v.bgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgb', () => { it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bgb; + const sw = v.bgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbr', () => { it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbr; + const sw = v.bbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbg', () => { it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbg; + const sw = v.bbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbb', () => { it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbb; + const sw = v.bbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrrr', () => { it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrrr; + const sw = v.rrrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrrg', () => { it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrrg; + const sw = v.rrrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrrb', () => { it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrrb; + const sw = v.rrrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrgr', () => { it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rrgr; + const sw = v.rrgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrgg', () => { it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rrgg; + const sw = v.rrgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrgb', () => { it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rrgb; + const sw = v.rrgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrbr', () => { it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rrbr; + const sw = v.rrbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrbg', () => { it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rrbg; + const sw = v.rrbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrbb', () => { it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rrbb; + const sw = v.rrbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgrr', () => { it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rgrr; + const sw = v.rgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgrg', () => { it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rgrg; + const sw = v.rgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgrb', () => { it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rgrb; + const sw = v.rgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rggr', () => { it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rggr; + const sw = v.rggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rggg', () => { it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rggg; + const sw = v.rggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rggb', () => { it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rggb; + const sw = v.rggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgbr', () => { it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rgbr; + const sw = v.rgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgbg', () => { it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rgbg; + const sw = v.rgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgbb', () => { it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rgbb; + const sw = v.rgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbrr', () => { it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rbrr; + const sw = v.rbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbrg', () => { it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rbrg; + const sw = v.rbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbrb', () => { it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rbrb; + const sw = v.rbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbgr', () => { it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rbgr; + const sw = v.rbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbgg', () => { it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rbgg; + const sw = v.rbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbgb', () => { it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rbgb; + const sw = v.rbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbbr', () => { it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbbr; + const sw = v.rbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbbg', () => { it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbbg; + const sw = v.rbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbbb', () => { it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbbb; + const sw = v.rbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grrr', () => { it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grrr; + const sw = v.grrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grrg', () => { it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grrg; + const sw = v.grrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grrb', () => { it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grrb; + const sw = v.grrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grgr', () => { it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.grgr; + const sw = v.grgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grgg', () => { it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.grgg; + const sw = v.grgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grgb', () => { it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.grgb; + const sw = v.grgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grbr', () => { it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.grbr; + const sw = v.grbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grbg', () => { it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.grbg; + const sw = v.grbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grbb', () => { it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.grbb; + const sw = v.grbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggrr', () => { it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ggrr; + const sw = v.ggrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggrg', () => { it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ggrg; + const sw = v.ggrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggrb', () => { it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.ggrb; + const sw = v.ggrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gggr', () => { it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gggr; + const sw = v.gggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gggg', () => { it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gggg; + const sw = v.gggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gggb', () => { it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gggb; + const sw = v.gggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggbr', () => { it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.ggbr; + const sw = v.ggbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggbg', () => { it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.ggbg; + const sw = v.ggbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggbb', () => { it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.ggbb; + const sw = v.ggbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbrr', () => { it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.gbrr; + const sw = v.gbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbrg', () => { it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.gbrg; + const sw = v.gbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbrb', () => { it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.gbrb; + const sw = v.gbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbgr', () => { it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gbgr; + const sw = v.gbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbgg', () => { it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gbgg; + const sw = v.gbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbgb', () => { it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gbgb; + const sw = v.gbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbbr', () => { it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbbr; + const sw = v.gbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbbg', () => { it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbbg; + const sw = v.gbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbbb', () => { it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbbb; + const sw = v.gbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brrr', () => { it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brrr; + const sw = v.brrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brrg', () => { it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brrg; + const sw = v.brrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brrb', () => { it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brrb; + const sw = v.brrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brgr', () => { it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.brgr; + const sw = v.brgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brgg', () => { it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.brgg; + const sw = v.brgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brgb', () => { it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.brgb; + const sw = v.brgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brbr', () => { it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.brbr; + const sw = v.brbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brbg', () => { it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.brbg; + const sw = v.brbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brbb', () => { it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.brbb; + const sw = v.brbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgrr', () => { it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bgrr; + const sw = v.bgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgrg', () => { it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bgrg; + const sw = v.bgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgrb', () => { it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bgrb; + const sw = v.bgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bggr', () => { it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bggr; + const sw = v.bggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bggg', () => { it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bggg; + const sw = v.bggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bggb', () => { it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bggb; + const sw = v.bggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgbr', () => { it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bgbr; + const sw = v.bgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgbg', () => { it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bgbg; + const sw = v.bgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgbb', () => { it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bgbb; + const sw = v.bgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbrr', () => { it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bbrr; + const sw = v.bbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbrg', () => { it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bbrg; + const sw = v.bbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbrb', () => { it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bbrb; + const sw = v.bbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbgr', () => { it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bbgr; + const sw = v.bbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbgg', () => { it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bbgg; + const sw = v.bbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbgb', () => { it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bbgb; + const sw = v.bbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbbr', () => { it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbbr; + const sw = v.bbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbbg', () => { it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbbg; + const sw = v.bbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbbb', () => { it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbbb; + const sw = v.bbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + // [/Swizzle Autogen] }); diff --git a/tests/f32/Vec3.spec.ts b/tests/f32/Vec3.spec.ts index 6ae5c693..de774310 100644 --- a/tests/f32/Vec3.spec.ts +++ b/tests/f32/Vec3.spec.ts @@ -24,12 +24,12 @@ describe('Vec3', () => { }); it('should return Vec3(x, y, z) if called with (Vec3(x, y, z))', () => { - let v = new Vec3(3.4, 5.6, 7.8); + const v = new Vec3(3.4, 5.6, 7.8); expect(new Vec3(v)).toBeVec(v); }); it('should return Vec3(x, y, z) if called with (Float32Array([x, y, z]))', () => { - let arr = new Float32Array([1.2, 3.4, 5.6]); + const arr = new Float32Array([1.2, 3.4, 5.6]); expect(new Vec3(arr)).toBeVec(arr); }); }); @@ -115,7 +115,7 @@ describe('Vec3', () => { describe('with an identity', () => { beforeEach(() => { - matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; + matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; result = Vec3.transformMat4(out, vecA, matr); }); @@ -129,23 +129,25 @@ describe('Vec3', () => { result = Vec3.transformMat4(out, vecA, matr); }); - it('should rotate and translate the input', () => expect(out).toBeVec( 4, -4, -4 )); + it('should rotate and translate the input', () => expect(out).toBeVec(4, -4, -4)); it('should return out', () => expect(result).toBe(out)); }); describe('with a perspective matrix (#92)', () => { it('should transform a point from perspective(pi/2, 4/3, 1, 100)', () => { - matr = [0.750, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, -1.02, -1, - 0, 0, -2.02, 0]; + matr = [ + 0.750, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1.02, -1, + 0, 0, -2.02, 0]; result = Vec3.transformMat4([0, 0, 0], [10, 20, 30], matr); expect(result).toBeVec(-0.25, -0.666666, 1.087333); }); }); }); - /*describe('transformMat3', () => { + /* + describe('transformMat3', () => { let matr; describe('with an identity', () => { @@ -193,11 +195,11 @@ describe('Vec3', () => { describe('transformQuat', () => { beforeEach(() => { result = Vec3.transformQuat(out, vecA, - [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); + [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); }); it('should rotate the input vector', () => expect(out).toBeVec(1, 2, 3)); - it('should return out', () => expect(result).not.toBe([1,2,3,4])); + it('should return out', () => expect(result).not.toBe([1, 2, 3, 4])); }); describe('create', () => { @@ -442,7 +444,8 @@ describe('Vec3', () => { }); }); - /*describe('round', () => { + /* + describe('round', () => { beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); describe('with a separate output vector', () => { @@ -546,7 +549,7 @@ describe('Vec3', () => { describe('with a separate output vector', () => { beforeEach(() => { result = Vec3.inverse(out, vecA); }); - it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3)); + it('should place values into out', () => expect(out).toBeVec(1, 1 / 2, 1 / 3)); it('should return out', () => expect(result).toBe(out)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); }); @@ -554,7 +557,7 @@ describe('Vec3', () => { describe('when vecA is the output vector', () => { beforeEach(() => { result = Vec3.inverse(vecA, vecA); }); - it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3)); + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1 / 2, 1 / 3)); it('should return vecA', () => expect(result).toBe(vecA)); }); }); @@ -693,10 +696,10 @@ describe('Vec3', () => { describe('equals', () => { let vecC: Vec3Like, - vecD: Vec3Like, - r0: boolean, - r1: boolean, - r2: boolean; + vecD: Vec3Like, + r0: boolean, + r1: boolean, + r2: boolean; beforeEach(() => { vecA = [0, 1, 2]; diff --git a/tests/f32/Vec4-swizzle.spec.ts b/tests/f32/Vec4-swizzle.spec.ts index 5858fa0f..f3161e54 100644 --- a/tests/f32/Vec4-swizzle.spec.ts +++ b/tests/f32/Vec4-swizzle.spec.ts @@ -16,6050 +16,6050 @@ describe('Vec4 Swizzles', () => { describe('Vec4().xx', () => { it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.xx; + const sw = v.xx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xy', () => { it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.xy; + const sw = v.xy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xz', () => { it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.xz; + const sw = v.xz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xw', () => { it('should return Vec2(x, w)', () => expect(v.xw).toBeVec(v[0], v[3])); it('should be return a copy', () => { - let sw = v.xw; + const sw = v.xw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yx', () => { it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.yx; + const sw = v.yx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yy', () => { it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.yy; + const sw = v.yy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yz', () => { it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.yz; + const sw = v.yz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yw', () => { it('should return Vec2(y, w)', () => expect(v.yw).toBeVec(v[1], v[3])); it('should be return a copy', () => { - let sw = v.yw; + const sw = v.yw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zx', () => { it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.zx; + const sw = v.zx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zy', () => { it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.zy; + const sw = v.zy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zz', () => { it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.zz; + const sw = v.zz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zw', () => { it('should return Vec2(z, w)', () => expect(v.zw).toBeVec(v[2], v[3])); it('should be return a copy', () => { - let sw = v.zw; + const sw = v.zw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wx', () => { it('should return Vec2(w, x)', () => expect(v.wx).toBeVec(v[3], v[0])); it('should be return a copy', () => { - let sw = v.wx; + const sw = v.wx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wy', () => { it('should return Vec2(w, y)', () => expect(v.wy).toBeVec(v[3], v[1])); it('should be return a copy', () => { - let sw = v.wy; + const sw = v.wy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wz', () => { it('should return Vec2(w, z)', () => expect(v.wz).toBeVec(v[3], v[2])); it('should be return a copy', () => { - let sw = v.wz; + const sw = v.wz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ww', () => { it('should return Vec2(w, w)', () => expect(v.ww).toBeVec(v[3], v[3])); it('should be return a copy', () => { - let sw = v.ww; + const sw = v.ww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxx', () => { it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxx; + const sw = v.xxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxy', () => { it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxy; + const sw = v.xxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxz', () => { it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxz; + const sw = v.xxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxw', () => { it('should return Vec3(x, x, w)', () => expect(v.xxw).toBeVec(v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xxw; + const sw = v.xxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyx', () => { it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyx; + const sw = v.xyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyy', () => { it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyy; + const sw = v.xyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyz', () => { it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyz; + const sw = v.xyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyw', () => { it('should return Vec3(x, y, w)', () => expect(v.xyw).toBeVec(v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xyw; + const sw = v.xyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzx', () => { it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzx; + const sw = v.xzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzy', () => { it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzy; + const sw = v.xzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzz', () => { it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzz; + const sw = v.xzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzw', () => { it('should return Vec3(x, z, w)', () => expect(v.xzw).toBeVec(v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xzw; + const sw = v.xzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwx', () => { it('should return Vec3(x, w, x)', () => expect(v.xwx).toBeVec(v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xwx; + const sw = v.xwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwy', () => { it('should return Vec3(x, w, y)', () => expect(v.xwy).toBeVec(v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xwy; + const sw = v.xwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwz', () => { it('should return Vec3(x, w, z)', () => expect(v.xwz).toBeVec(v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xwz; + const sw = v.xwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xww', () => { it('should return Vec3(x, w, w)', () => expect(v.xww).toBeVec(v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xww; + const sw = v.xww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxx', () => { it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxx; + const sw = v.yxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxy', () => { it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxy; + const sw = v.yxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxz', () => { it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxz; + const sw = v.yxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxw', () => { it('should return Vec3(y, x, w)', () => expect(v.yxw).toBeVec(v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yxw; + const sw = v.yxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyx', () => { it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyx; + const sw = v.yyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyy', () => { it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyy; + const sw = v.yyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyz', () => { it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyz; + const sw = v.yyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyw', () => { it('should return Vec3(y, y, w)', () => expect(v.yyw).toBeVec(v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yyw; + const sw = v.yyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzx', () => { it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzx; + const sw = v.yzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzy', () => { it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzy; + const sw = v.yzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzz', () => { it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzz; + const sw = v.yzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzw', () => { it('should return Vec3(y, z, w)', () => expect(v.yzw).toBeVec(v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yzw; + const sw = v.yzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywx', () => { it('should return Vec3(y, w, x)', () => expect(v.ywx).toBeVec(v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.ywx; + const sw = v.ywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywy', () => { it('should return Vec3(y, w, y)', () => expect(v.ywy).toBeVec(v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.ywy; + const sw = v.ywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywz', () => { it('should return Vec3(y, w, z)', () => expect(v.ywz).toBeVec(v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.ywz; + const sw = v.ywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yww', () => { it('should return Vec3(y, w, w)', () => expect(v.yww).toBeVec(v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yww; + const sw = v.yww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxx', () => { it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxx; + const sw = v.zxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxy', () => { it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxy; + const sw = v.zxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxz', () => { it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxz; + const sw = v.zxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxw', () => { it('should return Vec3(z, x, w)', () => expect(v.zxw).toBeVec(v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zxw; + const sw = v.zxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyx', () => { it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyx; + const sw = v.zyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyy', () => { it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyy; + const sw = v.zyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyz', () => { it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyz; + const sw = v.zyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyw', () => { it('should return Vec3(z, y, w)', () => expect(v.zyw).toBeVec(v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zyw; + const sw = v.zyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzx', () => { it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzx; + const sw = v.zzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzy', () => { it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzy; + const sw = v.zzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzz', () => { it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzz; + const sw = v.zzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzw', () => { it('should return Vec3(z, z, w)', () => expect(v.zzw).toBeVec(v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zzw; + const sw = v.zzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwx', () => { it('should return Vec3(z, w, x)', () => expect(v.zwx).toBeVec(v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zwx; + const sw = v.zwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwy', () => { it('should return Vec3(z, w, y)', () => expect(v.zwy).toBeVec(v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zwy; + const sw = v.zwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwz', () => { it('should return Vec3(z, w, z)', () => expect(v.zwz).toBeVec(v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zwz; + const sw = v.zwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zww', () => { it('should return Vec3(z, w, w)', () => expect(v.zww).toBeVec(v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zww; + const sw = v.zww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxx', () => { it('should return Vec3(w, x, x)', () => expect(v.wxx).toBeVec(v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wxx; + const sw = v.wxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxy', () => { it('should return Vec3(w, x, y)', () => expect(v.wxy).toBeVec(v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wxy; + const sw = v.wxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxz', () => { it('should return Vec3(w, x, z)', () => expect(v.wxz).toBeVec(v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wxz; + const sw = v.wxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxw', () => { it('should return Vec3(w, x, w)', () => expect(v.wxw).toBeVec(v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wxw; + const sw = v.wxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyx', () => { it('should return Vec3(w, y, x)', () => expect(v.wyx).toBeVec(v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wyx; + const sw = v.wyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyy', () => { it('should return Vec3(w, y, y)', () => expect(v.wyy).toBeVec(v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wyy; + const sw = v.wyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyz', () => { it('should return Vec3(w, y, z)', () => expect(v.wyz).toBeVec(v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wyz; + const sw = v.wyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyw', () => { it('should return Vec3(w, y, w)', () => expect(v.wyw).toBeVec(v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wyw; + const sw = v.wyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzx', () => { it('should return Vec3(w, z, x)', () => expect(v.wzx).toBeVec(v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wzx; + const sw = v.wzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzy', () => { it('should return Vec3(w, z, y)', () => expect(v.wzy).toBeVec(v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wzy; + const sw = v.wzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzz', () => { it('should return Vec3(w, z, z)', () => expect(v.wzz).toBeVec(v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wzz; + const sw = v.wzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzw', () => { it('should return Vec3(w, z, w)', () => expect(v.wzw).toBeVec(v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wzw; + const sw = v.wzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwx', () => { it('should return Vec3(w, w, x)', () => expect(v.wwx).toBeVec(v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wwx; + const sw = v.wwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwy', () => { it('should return Vec3(w, w, y)', () => expect(v.wwy).toBeVec(v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wwy; + const sw = v.wwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwz', () => { it('should return Vec3(w, w, z)', () => expect(v.wwz).toBeVec(v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wwz; + const sw = v.wwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().www', () => { it('should return Vec3(w, w, w)', () => expect(v.www).toBeVec(v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.www; + const sw = v.www; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxx', () => { it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxxx; + const sw = v.xxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxy', () => { it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxxy; + const sw = v.xxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxz', () => { it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxxz; + const sw = v.xxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxw', () => { it('should return Vec4(x, x, x, w)', () => expect(v.xxxw).toBeVec(v[0], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xxxw; + const sw = v.xxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyx', () => { it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xxyx; + const sw = v.xxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyy', () => { it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xxyy; + const sw = v.xxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyz', () => { it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xxyz; + const sw = v.xxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyw', () => { it('should return Vec4(x, x, y, w)', () => expect(v.xxyw).toBeVec(v[0], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xxyw; + const sw = v.xxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzx', () => { it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xxzx; + const sw = v.xxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzy', () => { it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xxzy; + const sw = v.xxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzz', () => { it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xxzz; + const sw = v.xxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzw', () => { it('should return Vec4(x, x, z, w)', () => expect(v.xxzw).toBeVec(v[0], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xxzw; + const sw = v.xxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxwx', () => { it('should return Vec4(x, x, w, x)', () => expect(v.xxwx).toBeVec(v[0], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xxwx; + const sw = v.xxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxwy', () => { it('should return Vec4(x, x, w, y)', () => expect(v.xxwy).toBeVec(v[0], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xxwy; + const sw = v.xxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxwz', () => { it('should return Vec4(x, x, w, z)', () => expect(v.xxwz).toBeVec(v[0], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xxwz; + const sw = v.xxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxww', () => { it('should return Vec4(x, x, w, w)', () => expect(v.xxww).toBeVec(v[0], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xxww; + const sw = v.xxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxx', () => { it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xyxx; + const sw = v.xyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxy', () => { it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xyxy; + const sw = v.xyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxz', () => { it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xyxz; + const sw = v.xyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxw', () => { it('should return Vec4(x, y, x, w)', () => expect(v.xyxw).toBeVec(v[0], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xyxw; + const sw = v.xyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyx', () => { it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyyx; + const sw = v.xyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyy', () => { it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyyy; + const sw = v.xyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyz', () => { it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyyz; + const sw = v.xyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyw', () => { it('should return Vec4(x, y, y, w)', () => expect(v.xyyw).toBeVec(v[0], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xyyw; + const sw = v.xyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzx', () => { it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xyzx; + const sw = v.xyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzy', () => { it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xyzy; + const sw = v.xyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzz', () => { it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xyzz; + const sw = v.xyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzw', () => { it('should return Vec4(x, y, z, w)', () => expect(v.xyzw).toBeVec(v[0], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xyzw; + const sw = v.xyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xywx', () => { it('should return Vec4(x, y, w, x)', () => expect(v.xywx).toBeVec(v[0], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xywx; + const sw = v.xywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xywy', () => { it('should return Vec4(x, y, w, y)', () => expect(v.xywy).toBeVec(v[0], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xywy; + const sw = v.xywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xywz', () => { it('should return Vec4(x, y, w, z)', () => expect(v.xywz).toBeVec(v[0], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xywz; + const sw = v.xywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyww', () => { it('should return Vec4(x, y, w, w)', () => expect(v.xyww).toBeVec(v[0], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xyww; + const sw = v.xyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxx', () => { it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xzxx; + const sw = v.xzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxy', () => { it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xzxy; + const sw = v.xzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxz', () => { it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xzxz; + const sw = v.xzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxw', () => { it('should return Vec4(x, z, x, w)', () => expect(v.xzxw).toBeVec(v[0], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xzxw; + const sw = v.xzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyx', () => { it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xzyx; + const sw = v.xzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyy', () => { it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xzyy; + const sw = v.xzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyz', () => { it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xzyz; + const sw = v.xzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyw', () => { it('should return Vec4(x, z, y, w)', () => expect(v.xzyw).toBeVec(v[0], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xzyw; + const sw = v.xzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzx', () => { it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzzx; + const sw = v.xzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzy', () => { it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzzy; + const sw = v.xzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzz', () => { it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzzz; + const sw = v.xzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzw', () => { it('should return Vec4(x, z, z, w)', () => expect(v.xzzw).toBeVec(v[0], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xzzw; + const sw = v.xzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzwx', () => { it('should return Vec4(x, z, w, x)', () => expect(v.xzwx).toBeVec(v[0], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xzwx; + const sw = v.xzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzwy', () => { it('should return Vec4(x, z, w, y)', () => expect(v.xzwy).toBeVec(v[0], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xzwy; + const sw = v.xzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzwz', () => { it('should return Vec4(x, z, w, z)', () => expect(v.xzwz).toBeVec(v[0], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xzwz; + const sw = v.xzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzww', () => { it('should return Vec4(x, z, w, w)', () => expect(v.xzww).toBeVec(v[0], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xzww; + const sw = v.xzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxx', () => { it('should return Vec4(x, w, x, x)', () => expect(v.xwxx).toBeVec(v[0], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xwxx; + const sw = v.xwxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxy', () => { it('should return Vec4(x, w, x, y)', () => expect(v.xwxy).toBeVec(v[0], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xwxy; + const sw = v.xwxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxz', () => { it('should return Vec4(x, w, x, z)', () => expect(v.xwxz).toBeVec(v[0], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xwxz; + const sw = v.xwxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxw', () => { it('should return Vec4(x, w, x, w)', () => expect(v.xwxw).toBeVec(v[0], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xwxw; + const sw = v.xwxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyx', () => { it('should return Vec4(x, w, y, x)', () => expect(v.xwyx).toBeVec(v[0], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xwyx; + const sw = v.xwyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyy', () => { it('should return Vec4(x, w, y, y)', () => expect(v.xwyy).toBeVec(v[0], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xwyy; + const sw = v.xwyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyz', () => { it('should return Vec4(x, w, y, z)', () => expect(v.xwyz).toBeVec(v[0], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xwyz; + const sw = v.xwyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyw', () => { it('should return Vec4(x, w, y, w)', () => expect(v.xwyw).toBeVec(v[0], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xwyw; + const sw = v.xwyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzx', () => { it('should return Vec4(x, w, z, x)', () => expect(v.xwzx).toBeVec(v[0], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xwzx; + const sw = v.xwzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzy', () => { it('should return Vec4(x, w, z, y)', () => expect(v.xwzy).toBeVec(v[0], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xwzy; + const sw = v.xwzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzz', () => { it('should return Vec4(x, w, z, z)', () => expect(v.xwzz).toBeVec(v[0], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xwzz; + const sw = v.xwzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzw', () => { it('should return Vec4(x, w, z, w)', () => expect(v.xwzw).toBeVec(v[0], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xwzw; + const sw = v.xwzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwwx', () => { it('should return Vec4(x, w, w, x)', () => expect(v.xwwx).toBeVec(v[0], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xwwx; + const sw = v.xwwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwwy', () => { it('should return Vec4(x, w, w, y)', () => expect(v.xwwy).toBeVec(v[0], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xwwy; + const sw = v.xwwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwwz', () => { it('should return Vec4(x, w, w, z)', () => expect(v.xwwz).toBeVec(v[0], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xwwz; + const sw = v.xwwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwww', () => { it('should return Vec4(x, w, w, w)', () => expect(v.xwww).toBeVec(v[0], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xwww; + const sw = v.xwww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxx', () => { it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxxx; + const sw = v.yxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxy', () => { it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxxy; + const sw = v.yxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxz', () => { it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxxz; + const sw = v.yxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxw', () => { it('should return Vec4(y, x, x, w)', () => expect(v.yxxw).toBeVec(v[1], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yxxw; + const sw = v.yxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyx', () => { it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yxyx; + const sw = v.yxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyy', () => { it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yxyy; + const sw = v.yxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyz', () => { it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yxyz; + const sw = v.yxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyw', () => { it('should return Vec4(y, x, y, w)', () => expect(v.yxyw).toBeVec(v[1], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yxyw; + const sw = v.yxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzx', () => { it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yxzx; + const sw = v.yxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzy', () => { it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yxzy; + const sw = v.yxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzz', () => { it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yxzz; + const sw = v.yxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzw', () => { it('should return Vec4(y, x, z, w)', () => expect(v.yxzw).toBeVec(v[1], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yxzw; + const sw = v.yxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxwx', () => { it('should return Vec4(y, x, w, x)', () => expect(v.yxwx).toBeVec(v[1], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.yxwx; + const sw = v.yxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxwy', () => { it('should return Vec4(y, x, w, y)', () => expect(v.yxwy).toBeVec(v[1], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.yxwy; + const sw = v.yxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxwz', () => { it('should return Vec4(y, x, w, z)', () => expect(v.yxwz).toBeVec(v[1], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.yxwz; + const sw = v.yxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxww', () => { it('should return Vec4(y, x, w, w)', () => expect(v.yxww).toBeVec(v[1], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yxww; + const sw = v.yxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxx', () => { it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yyxx; + const sw = v.yyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxy', () => { it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yyxy; + const sw = v.yyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxz', () => { it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yyxz; + const sw = v.yyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxw', () => { it('should return Vec4(y, y, x, w)', () => expect(v.yyxw).toBeVec(v[1], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yyxw; + const sw = v.yyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyx', () => { it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyyx; + const sw = v.yyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyy', () => { it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyyy; + const sw = v.yyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyz', () => { it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyyz; + const sw = v.yyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyw', () => { it('should return Vec4(y, y, y, w)', () => expect(v.yyyw).toBeVec(v[1], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yyyw; + const sw = v.yyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzx', () => { it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yyzx; + const sw = v.yyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzy', () => { it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yyzy; + const sw = v.yyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzz', () => { it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yyzz; + const sw = v.yyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzw', () => { it('should return Vec4(y, y, z, w)', () => expect(v.yyzw).toBeVec(v[1], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yyzw; + const sw = v.yyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yywx', () => { it('should return Vec4(y, y, w, x)', () => expect(v.yywx).toBeVec(v[1], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.yywx; + const sw = v.yywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yywy', () => { it('should return Vec4(y, y, w, y)', () => expect(v.yywy).toBeVec(v[1], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.yywy; + const sw = v.yywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yywz', () => { it('should return Vec4(y, y, w, z)', () => expect(v.yywz).toBeVec(v[1], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.yywz; + const sw = v.yywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyww', () => { it('should return Vec4(y, y, w, w)', () => expect(v.yyww).toBeVec(v[1], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yyww; + const sw = v.yyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxx', () => { it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yzxx; + const sw = v.yzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxy', () => { it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yzxy; + const sw = v.yzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxz', () => { it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yzxz; + const sw = v.yzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxw', () => { it('should return Vec4(y, z, x, w)', () => expect(v.yzxw).toBeVec(v[1], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yzxw; + const sw = v.yzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyx', () => { it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yzyx; + const sw = v.yzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyy', () => { it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yzyy; + const sw = v.yzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyz', () => { it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yzyz; + const sw = v.yzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyw', () => { it('should return Vec4(y, z, y, w)', () => expect(v.yzyw).toBeVec(v[1], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yzyw; + const sw = v.yzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzx', () => { it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzzx; + const sw = v.yzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzy', () => { it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzzy; + const sw = v.yzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzz', () => { it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzzz; + const sw = v.yzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzw', () => { it('should return Vec4(y, z, z, w)', () => expect(v.yzzw).toBeVec(v[1], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yzzw; + const sw = v.yzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzwx', () => { it('should return Vec4(y, z, w, x)', () => expect(v.yzwx).toBeVec(v[1], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.yzwx; + const sw = v.yzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzwy', () => { it('should return Vec4(y, z, w, y)', () => expect(v.yzwy).toBeVec(v[1], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.yzwy; + const sw = v.yzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzwz', () => { it('should return Vec4(y, z, w, z)', () => expect(v.yzwz).toBeVec(v[1], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.yzwz; + const sw = v.yzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzww', () => { it('should return Vec4(y, z, w, w)', () => expect(v.yzww).toBeVec(v[1], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yzww; + const sw = v.yzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxx', () => { it('should return Vec4(y, w, x, x)', () => expect(v.ywxx).toBeVec(v[1], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ywxx; + const sw = v.ywxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxy', () => { it('should return Vec4(y, w, x, y)', () => expect(v.ywxy).toBeVec(v[1], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ywxy; + const sw = v.ywxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxz', () => { it('should return Vec4(y, w, x, z)', () => expect(v.ywxz).toBeVec(v[1], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.ywxz; + const sw = v.ywxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxw', () => { it('should return Vec4(y, w, x, w)', () => expect(v.ywxw).toBeVec(v[1], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.ywxw; + const sw = v.ywxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyx', () => { it('should return Vec4(y, w, y, x)', () => expect(v.ywyx).toBeVec(v[1], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ywyx; + const sw = v.ywyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyy', () => { it('should return Vec4(y, w, y, y)', () => expect(v.ywyy).toBeVec(v[1], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ywyy; + const sw = v.ywyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyz', () => { it('should return Vec4(y, w, y, z)', () => expect(v.ywyz).toBeVec(v[1], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ywyz; + const sw = v.ywyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyw', () => { it('should return Vec4(y, w, y, w)', () => expect(v.ywyw).toBeVec(v[1], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.ywyw; + const sw = v.ywyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzx', () => { it('should return Vec4(y, w, z, x)', () => expect(v.ywzx).toBeVec(v[1], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.ywzx; + const sw = v.ywzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzy', () => { it('should return Vec4(y, w, z, y)', () => expect(v.ywzy).toBeVec(v[1], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.ywzy; + const sw = v.ywzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzz', () => { it('should return Vec4(y, w, z, z)', () => expect(v.ywzz).toBeVec(v[1], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.ywzz; + const sw = v.ywzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzw', () => { it('should return Vec4(y, w, z, w)', () => expect(v.ywzw).toBeVec(v[1], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.ywzw; + const sw = v.ywzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywwx', () => { it('should return Vec4(y, w, w, x)', () => expect(v.ywwx).toBeVec(v[1], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.ywwx; + const sw = v.ywwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywwy', () => { it('should return Vec4(y, w, w, y)', () => expect(v.ywwy).toBeVec(v[1], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.ywwy; + const sw = v.ywwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywwz', () => { it('should return Vec4(y, w, w, z)', () => expect(v.ywwz).toBeVec(v[1], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.ywwz; + const sw = v.ywwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywww', () => { it('should return Vec4(y, w, w, w)', () => expect(v.ywww).toBeVec(v[1], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.ywww; + const sw = v.ywww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxx', () => { it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxxx; + const sw = v.zxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxy', () => { it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxxy; + const sw = v.zxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxz', () => { it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxxz; + const sw = v.zxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxw', () => { it('should return Vec4(z, x, x, w)', () => expect(v.zxxw).toBeVec(v[2], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zxxw; + const sw = v.zxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyx', () => { it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zxyx; + const sw = v.zxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyy', () => { it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zxyy; + const sw = v.zxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyz', () => { it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zxyz; + const sw = v.zxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyw', () => { it('should return Vec4(z, x, y, w)', () => expect(v.zxyw).toBeVec(v[2], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zxyw; + const sw = v.zxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzx', () => { it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zxzx; + const sw = v.zxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzy', () => { it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zxzy; + const sw = v.zxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzz', () => { it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zxzz; + const sw = v.zxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzw', () => { it('should return Vec4(z, x, z, w)', () => expect(v.zxzw).toBeVec(v[2], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zxzw; + const sw = v.zxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxwx', () => { it('should return Vec4(z, x, w, x)', () => expect(v.zxwx).toBeVec(v[2], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zxwx; + const sw = v.zxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxwy', () => { it('should return Vec4(z, x, w, y)', () => expect(v.zxwy).toBeVec(v[2], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zxwy; + const sw = v.zxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxwz', () => { it('should return Vec4(z, x, w, z)', () => expect(v.zxwz).toBeVec(v[2], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zxwz; + const sw = v.zxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxww', () => { it('should return Vec4(z, x, w, w)', () => expect(v.zxww).toBeVec(v[2], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zxww; + const sw = v.zxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxx', () => { it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zyxx; + const sw = v.zyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxy', () => { it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zyxy; + const sw = v.zyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxz', () => { it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zyxz; + const sw = v.zyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxw', () => { it('should return Vec4(z, y, x, w)', () => expect(v.zyxw).toBeVec(v[2], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zyxw; + const sw = v.zyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyx', () => { it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyyx; + const sw = v.zyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyy', () => { it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyyy; + const sw = v.zyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyz', () => { it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyyz; + const sw = v.zyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyw', () => { it('should return Vec4(z, y, y, w)', () => expect(v.zyyw).toBeVec(v[2], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zyyw; + const sw = v.zyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzx', () => { it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zyzx; + const sw = v.zyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzy', () => { it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zyzy; + const sw = v.zyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzz', () => { it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zyzz; + const sw = v.zyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzw', () => { it('should return Vec4(z, y, z, w)', () => expect(v.zyzw).toBeVec(v[2], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zyzw; + const sw = v.zyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zywx', () => { it('should return Vec4(z, y, w, x)', () => expect(v.zywx).toBeVec(v[2], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zywx; + const sw = v.zywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zywy', () => { it('should return Vec4(z, y, w, y)', () => expect(v.zywy).toBeVec(v[2], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zywy; + const sw = v.zywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zywz', () => { it('should return Vec4(z, y, w, z)', () => expect(v.zywz).toBeVec(v[2], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zywz; + const sw = v.zywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyww', () => { it('should return Vec4(z, y, w, w)', () => expect(v.zyww).toBeVec(v[2], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zyww; + const sw = v.zyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxx', () => { it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zzxx; + const sw = v.zzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxy', () => { it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zzxy; + const sw = v.zzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxz', () => { it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zzxz; + const sw = v.zzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxw', () => { it('should return Vec4(z, z, x, w)', () => expect(v.zzxw).toBeVec(v[2], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zzxw; + const sw = v.zzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyx', () => { it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zzyx; + const sw = v.zzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyy', () => { it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zzyy; + const sw = v.zzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyz', () => { it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zzyz; + const sw = v.zzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyw', () => { it('should return Vec4(z, z, y, w)', () => expect(v.zzyw).toBeVec(v[2], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zzyw; + const sw = v.zzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzx', () => { it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzzx; + const sw = v.zzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzy', () => { it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzzy; + const sw = v.zzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzz', () => { it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzzz; + const sw = v.zzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzw', () => { it('should return Vec4(z, z, z, w)', () => expect(v.zzzw).toBeVec(v[2], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zzzw; + const sw = v.zzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzwx', () => { it('should return Vec4(z, z, w, x)', () => expect(v.zzwx).toBeVec(v[2], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zzwx; + const sw = v.zzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzwy', () => { it('should return Vec4(z, z, w, y)', () => expect(v.zzwy).toBeVec(v[2], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zzwy; + const sw = v.zzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzwz', () => { it('should return Vec4(z, z, w, z)', () => expect(v.zzwz).toBeVec(v[2], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zzwz; + const sw = v.zzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzww', () => { it('should return Vec4(z, z, w, w)', () => expect(v.zzww).toBeVec(v[2], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zzww; + const sw = v.zzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxx', () => { it('should return Vec4(z, w, x, x)', () => expect(v.zwxx).toBeVec(v[2], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zwxx; + const sw = v.zwxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxy', () => { it('should return Vec4(z, w, x, y)', () => expect(v.zwxy).toBeVec(v[2], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zwxy; + const sw = v.zwxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxz', () => { it('should return Vec4(z, w, x, z)', () => expect(v.zwxz).toBeVec(v[2], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zwxz; + const sw = v.zwxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxw', () => { it('should return Vec4(z, w, x, w)', () => expect(v.zwxw).toBeVec(v[2], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zwxw; + const sw = v.zwxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyx', () => { it('should return Vec4(z, w, y, x)', () => expect(v.zwyx).toBeVec(v[2], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zwyx; + const sw = v.zwyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyy', () => { it('should return Vec4(z, w, y, y)', () => expect(v.zwyy).toBeVec(v[2], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zwyy; + const sw = v.zwyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyz', () => { it('should return Vec4(z, w, y, z)', () => expect(v.zwyz).toBeVec(v[2], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zwyz; + const sw = v.zwyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyw', () => { it('should return Vec4(z, w, y, w)', () => expect(v.zwyw).toBeVec(v[2], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zwyw; + const sw = v.zwyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzx', () => { it('should return Vec4(z, w, z, x)', () => expect(v.zwzx).toBeVec(v[2], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zwzx; + const sw = v.zwzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzy', () => { it('should return Vec4(z, w, z, y)', () => expect(v.zwzy).toBeVec(v[2], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zwzy; + const sw = v.zwzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzz', () => { it('should return Vec4(z, w, z, z)', () => expect(v.zwzz).toBeVec(v[2], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zwzz; + const sw = v.zwzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzw', () => { it('should return Vec4(z, w, z, w)', () => expect(v.zwzw).toBeVec(v[2], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zwzw; + const sw = v.zwzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwwx', () => { it('should return Vec4(z, w, w, x)', () => expect(v.zwwx).toBeVec(v[2], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zwwx; + const sw = v.zwwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwwy', () => { it('should return Vec4(z, w, w, y)', () => expect(v.zwwy).toBeVec(v[2], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zwwy; + const sw = v.zwwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwwz', () => { it('should return Vec4(z, w, w, z)', () => expect(v.zwwz).toBeVec(v[2], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zwwz; + const sw = v.zwwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwww', () => { it('should return Vec4(z, w, w, w)', () => expect(v.zwww).toBeVec(v[2], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zwww; + const sw = v.zwww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxx', () => { it('should return Vec4(w, x, x, x)', () => expect(v.wxxx).toBeVec(v[3], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wxxx; + const sw = v.wxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxy', () => { it('should return Vec4(w, x, x, y)', () => expect(v.wxxy).toBeVec(v[3], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wxxy; + const sw = v.wxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxz', () => { it('should return Vec4(w, x, x, z)', () => expect(v.wxxz).toBeVec(v[3], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wxxz; + const sw = v.wxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxw', () => { it('should return Vec4(w, x, x, w)', () => expect(v.wxxw).toBeVec(v[3], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wxxw; + const sw = v.wxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyx', () => { it('should return Vec4(w, x, y, x)', () => expect(v.wxyx).toBeVec(v[3], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wxyx; + const sw = v.wxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyy', () => { it('should return Vec4(w, x, y, y)', () => expect(v.wxyy).toBeVec(v[3], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wxyy; + const sw = v.wxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyz', () => { it('should return Vec4(w, x, y, z)', () => expect(v.wxyz).toBeVec(v[3], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wxyz; + const sw = v.wxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyw', () => { it('should return Vec4(w, x, y, w)', () => expect(v.wxyw).toBeVec(v[3], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wxyw; + const sw = v.wxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzx', () => { it('should return Vec4(w, x, z, x)', () => expect(v.wxzx).toBeVec(v[3], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wxzx; + const sw = v.wxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzy', () => { it('should return Vec4(w, x, z, y)', () => expect(v.wxzy).toBeVec(v[3], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wxzy; + const sw = v.wxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzz', () => { it('should return Vec4(w, x, z, z)', () => expect(v.wxzz).toBeVec(v[3], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wxzz; + const sw = v.wxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzw', () => { it('should return Vec4(w, x, z, w)', () => expect(v.wxzw).toBeVec(v[3], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wxzw; + const sw = v.wxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxwx', () => { it('should return Vec4(w, x, w, x)', () => expect(v.wxwx).toBeVec(v[3], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wxwx; + const sw = v.wxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxwy', () => { it('should return Vec4(w, x, w, y)', () => expect(v.wxwy).toBeVec(v[3], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wxwy; + const sw = v.wxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxwz', () => { it('should return Vec4(w, x, w, z)', () => expect(v.wxwz).toBeVec(v[3], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wxwz; + const sw = v.wxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxww', () => { it('should return Vec4(w, x, w, w)', () => expect(v.wxww).toBeVec(v[3], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wxww; + const sw = v.wxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxx', () => { it('should return Vec4(w, y, x, x)', () => expect(v.wyxx).toBeVec(v[3], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wyxx; + const sw = v.wyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxy', () => { it('should return Vec4(w, y, x, y)', () => expect(v.wyxy).toBeVec(v[3], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wyxy; + const sw = v.wyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxz', () => { it('should return Vec4(w, y, x, z)', () => expect(v.wyxz).toBeVec(v[3], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wyxz; + const sw = v.wyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxw', () => { it('should return Vec4(w, y, x, w)', () => expect(v.wyxw).toBeVec(v[3], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wyxw; + const sw = v.wyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyx', () => { it('should return Vec4(w, y, y, x)', () => expect(v.wyyx).toBeVec(v[3], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wyyx; + const sw = v.wyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyy', () => { it('should return Vec4(w, y, y, y)', () => expect(v.wyyy).toBeVec(v[3], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wyyy; + const sw = v.wyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyz', () => { it('should return Vec4(w, y, y, z)', () => expect(v.wyyz).toBeVec(v[3], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wyyz; + const sw = v.wyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyw', () => { it('should return Vec4(w, y, y, w)', () => expect(v.wyyw).toBeVec(v[3], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wyyw; + const sw = v.wyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzx', () => { it('should return Vec4(w, y, z, x)', () => expect(v.wyzx).toBeVec(v[3], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wyzx; + const sw = v.wyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzy', () => { it('should return Vec4(w, y, z, y)', () => expect(v.wyzy).toBeVec(v[3], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wyzy; + const sw = v.wyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzz', () => { it('should return Vec4(w, y, z, z)', () => expect(v.wyzz).toBeVec(v[3], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wyzz; + const sw = v.wyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzw', () => { it('should return Vec4(w, y, z, w)', () => expect(v.wyzw).toBeVec(v[3], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wyzw; + const sw = v.wyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wywx', () => { it('should return Vec4(w, y, w, x)', () => expect(v.wywx).toBeVec(v[3], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wywx; + const sw = v.wywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wywy', () => { it('should return Vec4(w, y, w, y)', () => expect(v.wywy).toBeVec(v[3], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wywy; + const sw = v.wywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wywz', () => { it('should return Vec4(w, y, w, z)', () => expect(v.wywz).toBeVec(v[3], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wywz; + const sw = v.wywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyww', () => { it('should return Vec4(w, y, w, w)', () => expect(v.wyww).toBeVec(v[3], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wyww; + const sw = v.wyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxx', () => { it('should return Vec4(w, z, x, x)', () => expect(v.wzxx).toBeVec(v[3], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wzxx; + const sw = v.wzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxy', () => { it('should return Vec4(w, z, x, y)', () => expect(v.wzxy).toBeVec(v[3], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wzxy; + const sw = v.wzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxz', () => { it('should return Vec4(w, z, x, z)', () => expect(v.wzxz).toBeVec(v[3], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wzxz; + const sw = v.wzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxw', () => { it('should return Vec4(w, z, x, w)', () => expect(v.wzxw).toBeVec(v[3], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wzxw; + const sw = v.wzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyx', () => { it('should return Vec4(w, z, y, x)', () => expect(v.wzyx).toBeVec(v[3], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wzyx; + const sw = v.wzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyy', () => { it('should return Vec4(w, z, y, y)', () => expect(v.wzyy).toBeVec(v[3], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wzyy; + const sw = v.wzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyz', () => { it('should return Vec4(w, z, y, z)', () => expect(v.wzyz).toBeVec(v[3], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wzyz; + const sw = v.wzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyw', () => { it('should return Vec4(w, z, y, w)', () => expect(v.wzyw).toBeVec(v[3], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wzyw; + const sw = v.wzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzx', () => { it('should return Vec4(w, z, z, x)', () => expect(v.wzzx).toBeVec(v[3], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wzzx; + const sw = v.wzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzy', () => { it('should return Vec4(w, z, z, y)', () => expect(v.wzzy).toBeVec(v[3], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wzzy; + const sw = v.wzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzz', () => { it('should return Vec4(w, z, z, z)', () => expect(v.wzzz).toBeVec(v[3], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wzzz; + const sw = v.wzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzw', () => { it('should return Vec4(w, z, z, w)', () => expect(v.wzzw).toBeVec(v[3], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wzzw; + const sw = v.wzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzwx', () => { it('should return Vec4(w, z, w, x)', () => expect(v.wzwx).toBeVec(v[3], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wzwx; + const sw = v.wzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzwy', () => { it('should return Vec4(w, z, w, y)', () => expect(v.wzwy).toBeVec(v[3], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wzwy; + const sw = v.wzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzwz', () => { it('should return Vec4(w, z, w, z)', () => expect(v.wzwz).toBeVec(v[3], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wzwz; + const sw = v.wzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzww', () => { it('should return Vec4(w, z, w, w)', () => expect(v.wzww).toBeVec(v[3], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wzww; + const sw = v.wzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxx', () => { it('should return Vec4(w, w, x, x)', () => expect(v.wwxx).toBeVec(v[3], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wwxx; + const sw = v.wwxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxy', () => { it('should return Vec4(w, w, x, y)', () => expect(v.wwxy).toBeVec(v[3], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wwxy; + const sw = v.wwxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxz', () => { it('should return Vec4(w, w, x, z)', () => expect(v.wwxz).toBeVec(v[3], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wwxz; + const sw = v.wwxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxw', () => { it('should return Vec4(w, w, x, w)', () => expect(v.wwxw).toBeVec(v[3], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wwxw; + const sw = v.wwxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyx', () => { it('should return Vec4(w, w, y, x)', () => expect(v.wwyx).toBeVec(v[3], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wwyx; + const sw = v.wwyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyy', () => { it('should return Vec4(w, w, y, y)', () => expect(v.wwyy).toBeVec(v[3], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wwyy; + const sw = v.wwyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyz', () => { it('should return Vec4(w, w, y, z)', () => expect(v.wwyz).toBeVec(v[3], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wwyz; + const sw = v.wwyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyw', () => { it('should return Vec4(w, w, y, w)', () => expect(v.wwyw).toBeVec(v[3], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wwyw; + const sw = v.wwyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzx', () => { it('should return Vec4(w, w, z, x)', () => expect(v.wwzx).toBeVec(v[3], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wwzx; + const sw = v.wwzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzy', () => { it('should return Vec4(w, w, z, y)', () => expect(v.wwzy).toBeVec(v[3], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wwzy; + const sw = v.wwzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzz', () => { it('should return Vec4(w, w, z, z)', () => expect(v.wwzz).toBeVec(v[3], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wwzz; + const sw = v.wwzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzw', () => { it('should return Vec4(w, w, z, w)', () => expect(v.wwzw).toBeVec(v[3], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wwzw; + const sw = v.wwzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwwx', () => { it('should return Vec4(w, w, w, x)', () => expect(v.wwwx).toBeVec(v[3], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wwwx; + const sw = v.wwwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwwy', () => { it('should return Vec4(w, w, w, y)', () => expect(v.wwwy).toBeVec(v[3], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wwwy; + const sw = v.wwwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwwz', () => { it('should return Vec4(w, w, w, z)', () => expect(v.wwwz).toBeVec(v[3], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wwwz; + const sw = v.wwwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwww', () => { it('should return Vec4(w, w, w, w)', () => expect(v.wwww).toBeVec(v[3], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wwww; + const sw = v.wwww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rr', () => { it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.rr; + const sw = v.rr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rg', () => { it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.rg; + const sw = v.rg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rb', () => { it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.rb; + const sw = v.rb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ra', () => { it('should return Vec2(r, a)', () => expect(v.ra).toBeVec(v[0], v[3])); it('should be return a copy', () => { - let sw = v.ra; + const sw = v.ra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gr', () => { it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.gr; + const sw = v.gr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gg', () => { it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.gg; + const sw = v.gg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gb', () => { it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.gb; + const sw = v.gb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ga', () => { it('should return Vec2(g, a)', () => expect(v.ga).toBeVec(v[1], v[3])); it('should be return a copy', () => { - let sw = v.ga; + const sw = v.ga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().br', () => { it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.br; + const sw = v.br; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bg', () => { it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.bg; + const sw = v.bg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bb', () => { it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.bb; + const sw = v.bb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ba', () => { it('should return Vec2(b, a)', () => expect(v.ba).toBeVec(v[2], v[3])); it('should be return a copy', () => { - let sw = v.ba; + const sw = v.ba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ar', () => { it('should return Vec2(a, r)', () => expect(v.ar).toBeVec(v[3], v[0])); it('should be return a copy', () => { - let sw = v.ar; + const sw = v.ar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ag', () => { it('should return Vec2(a, g)', () => expect(v.ag).toBeVec(v[3], v[1])); it('should be return a copy', () => { - let sw = v.ag; + const sw = v.ag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ab', () => { it('should return Vec2(a, b)', () => expect(v.ab).toBeVec(v[3], v[2])); it('should be return a copy', () => { - let sw = v.ab; + const sw = v.ab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aa', () => { it('should return Vec2(a, a)', () => expect(v.aa).toBeVec(v[3], v[3])); it('should be return a copy', () => { - let sw = v.aa; + const sw = v.aa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrr', () => { it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrr; + const sw = v.rrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrg', () => { it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrg; + const sw = v.rrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrb', () => { it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrb; + const sw = v.rrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rra', () => { it('should return Vec3(r, r, a)', () => expect(v.rra).toBeVec(v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rra; + const sw = v.rra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgr', () => { it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rgr; + const sw = v.rgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgg', () => { it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rgg; + const sw = v.rgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgb', () => { it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rgb; + const sw = v.rgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rga', () => { it('should return Vec3(r, g, a)', () => expect(v.rga).toBeVec(v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rga; + const sw = v.rga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbr', () => { it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbr; + const sw = v.rbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbg', () => { it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbg; + const sw = v.rbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbb', () => { it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbb; + const sw = v.rbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rba', () => { it('should return Vec3(r, b, a)', () => expect(v.rba).toBeVec(v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rba; + const sw = v.rba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rar', () => { it('should return Vec3(r, a, r)', () => expect(v.rar).toBeVec(v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rar; + const sw = v.rar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rag', () => { it('should return Vec3(r, a, g)', () => expect(v.rag).toBeVec(v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rag; + const sw = v.rag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rab', () => { it('should return Vec3(r, a, b)', () => expect(v.rab).toBeVec(v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rab; + const sw = v.rab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raa', () => { it('should return Vec3(r, a, a)', () => expect(v.raa).toBeVec(v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.raa; + const sw = v.raa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grr', () => { it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grr; + const sw = v.grr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grg', () => { it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grg; + const sw = v.grg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grb', () => { it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grb; + const sw = v.grb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gra', () => { it('should return Vec3(g, r, a)', () => expect(v.gra).toBeVec(v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.gra; + const sw = v.gra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggr', () => { it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ggr; + const sw = v.ggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggg', () => { it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ggg; + const sw = v.ggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggb', () => { it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ggb; + const sw = v.ggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gga', () => { it('should return Vec3(g, g, a)', () => expect(v.gga).toBeVec(v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.gga; + const sw = v.gga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbr', () => { it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbr; + const sw = v.gbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbg', () => { it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbg; + const sw = v.gbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbb', () => { it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbb; + const sw = v.gbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gba', () => { it('should return Vec3(g, b, a)', () => expect(v.gba).toBeVec(v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.gba; + const sw = v.gba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gar', () => { it('should return Vec3(g, a, r)', () => expect(v.gar).toBeVec(v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.gar; + const sw = v.gar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gag', () => { it('should return Vec3(g, a, g)', () => expect(v.gag).toBeVec(v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.gag; + const sw = v.gag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gab', () => { it('should return Vec3(g, a, b)', () => expect(v.gab).toBeVec(v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.gab; + const sw = v.gab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaa', () => { it('should return Vec3(g, a, a)', () => expect(v.gaa).toBeVec(v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.gaa; + const sw = v.gaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brr', () => { it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brr; + const sw = v.brr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brg', () => { it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brg; + const sw = v.brg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brb', () => { it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brb; + const sw = v.brb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bra', () => { it('should return Vec3(b, r, a)', () => expect(v.bra).toBeVec(v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bra; + const sw = v.bra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgr', () => { it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bgr; + const sw = v.bgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgg', () => { it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bgg; + const sw = v.bgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgb', () => { it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bgb; + const sw = v.bgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bga', () => { it('should return Vec3(b, g, a)', () => expect(v.bga).toBeVec(v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.bga; + const sw = v.bga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbr', () => { it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbr; + const sw = v.bbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbg', () => { it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbg; + const sw = v.bbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbb', () => { it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbb; + const sw = v.bbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bba', () => { it('should return Vec3(b, b, a)', () => expect(v.bba).toBeVec(v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.bba; + const sw = v.bba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bar', () => { it('should return Vec3(b, a, r)', () => expect(v.bar).toBeVec(v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.bar; + const sw = v.bar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bag', () => { it('should return Vec3(b, a, g)', () => expect(v.bag).toBeVec(v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.bag; + const sw = v.bag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bab', () => { it('should return Vec3(b, a, b)', () => expect(v.bab).toBeVec(v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.bab; + const sw = v.bab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baa', () => { it('should return Vec3(b, a, a)', () => expect(v.baa).toBeVec(v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.baa; + const sw = v.baa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arr', () => { it('should return Vec3(a, r, r)', () => expect(v.arr).toBeVec(v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.arr; + const sw = v.arr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arg', () => { it('should return Vec3(a, r, g)', () => expect(v.arg).toBeVec(v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.arg; + const sw = v.arg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arb', () => { it('should return Vec3(a, r, b)', () => expect(v.arb).toBeVec(v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.arb; + const sw = v.arb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ara', () => { it('should return Vec3(a, r, a)', () => expect(v.ara).toBeVec(v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.ara; + const sw = v.ara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agr', () => { it('should return Vec3(a, g, r)', () => expect(v.agr).toBeVec(v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.agr; + const sw = v.agr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agg', () => { it('should return Vec3(a, g, g)', () => expect(v.agg).toBeVec(v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.agg; + const sw = v.agg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agb', () => { it('should return Vec3(a, g, b)', () => expect(v.agb).toBeVec(v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.agb; + const sw = v.agb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aga', () => { it('should return Vec3(a, g, a)', () => expect(v.aga).toBeVec(v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.aga; + const sw = v.aga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abr', () => { it('should return Vec3(a, b, r)', () => expect(v.abr).toBeVec(v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.abr; + const sw = v.abr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abg', () => { it('should return Vec3(a, b, g)', () => expect(v.abg).toBeVec(v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.abg; + const sw = v.abg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abb', () => { it('should return Vec3(a, b, b)', () => expect(v.abb).toBeVec(v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.abb; + const sw = v.abb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aba', () => { it('should return Vec3(a, b, a)', () => expect(v.aba).toBeVec(v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.aba; + const sw = v.aba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aar', () => { it('should return Vec3(a, a, r)', () => expect(v.aar).toBeVec(v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.aar; + const sw = v.aar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aag', () => { it('should return Vec3(a, a, g)', () => expect(v.aag).toBeVec(v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.aag; + const sw = v.aag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aab', () => { it('should return Vec3(a, a, b)', () => expect(v.aab).toBeVec(v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.aab; + const sw = v.aab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaa', () => { it('should return Vec3(a, a, a)', () => expect(v.aaa).toBeVec(v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.aaa; + const sw = v.aaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrrr', () => { it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrrr; + const sw = v.rrrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrrg', () => { it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrrg; + const sw = v.rrrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrrb', () => { it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrrb; + const sw = v.rrrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrra', () => { it('should return Vec4(r, r, r, a)', () => expect(v.rrra).toBeVec(v[0], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rrra; + const sw = v.rrra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrgr', () => { it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rrgr; + const sw = v.rrgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrgg', () => { it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rrgg; + const sw = v.rrgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrgb', () => { it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rrgb; + const sw = v.rrgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrga', () => { it('should return Vec4(r, r, g, a)', () => expect(v.rrga).toBeVec(v[0], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rrga; + const sw = v.rrga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrbr', () => { it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rrbr; + const sw = v.rrbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrbg', () => { it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rrbg; + const sw = v.rrbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrbb', () => { it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rrbb; + const sw = v.rrbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrba', () => { it('should return Vec4(r, r, b, a)', () => expect(v.rrba).toBeVec(v[0], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rrba; + const sw = v.rrba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrar', () => { it('should return Vec4(r, r, a, r)', () => expect(v.rrar).toBeVec(v[0], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rrar; + const sw = v.rrar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrag', () => { it('should return Vec4(r, r, a, g)', () => expect(v.rrag).toBeVec(v[0], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rrag; + const sw = v.rrag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrab', () => { it('should return Vec4(r, r, a, b)', () => expect(v.rrab).toBeVec(v[0], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rrab; + const sw = v.rrab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rraa', () => { it('should return Vec4(r, r, a, a)', () => expect(v.rraa).toBeVec(v[0], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.rraa; + const sw = v.rraa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgrr', () => { it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rgrr; + const sw = v.rgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgrg', () => { it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rgrg; + const sw = v.rgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgrb', () => { it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rgrb; + const sw = v.rgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgra', () => { it('should return Vec4(r, g, r, a)', () => expect(v.rgra).toBeVec(v[0], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rgra; + const sw = v.rgra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rggr', () => { it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rggr; + const sw = v.rggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rggg', () => { it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rggg; + const sw = v.rggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rggb', () => { it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rggb; + const sw = v.rggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgga', () => { it('should return Vec4(r, g, g, a)', () => expect(v.rgga).toBeVec(v[0], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rgga; + const sw = v.rgga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgbr', () => { it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rgbr; + const sw = v.rgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgbg', () => { it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rgbg; + const sw = v.rgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgbb', () => { it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rgbb; + const sw = v.rgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgba', () => { it('should return Vec4(r, g, b, a)', () => expect(v.rgba).toBeVec(v[0], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rgba; + const sw = v.rgba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgar', () => { it('should return Vec4(r, g, a, r)', () => expect(v.rgar).toBeVec(v[0], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rgar; + const sw = v.rgar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgag', () => { it('should return Vec4(r, g, a, g)', () => expect(v.rgag).toBeVec(v[0], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rgag; + const sw = v.rgag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgab', () => { it('should return Vec4(r, g, a, b)', () => expect(v.rgab).toBeVec(v[0], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rgab; + const sw = v.rgab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgaa', () => { it('should return Vec4(r, g, a, a)', () => expect(v.rgaa).toBeVec(v[0], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.rgaa; + const sw = v.rgaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbrr', () => { it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rbrr; + const sw = v.rbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbrg', () => { it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rbrg; + const sw = v.rbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbrb', () => { it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rbrb; + const sw = v.rbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbra', () => { it('should return Vec4(r, b, r, a)', () => expect(v.rbra).toBeVec(v[0], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rbra; + const sw = v.rbra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbgr', () => { it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rbgr; + const sw = v.rbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbgg', () => { it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rbgg; + const sw = v.rbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbgb', () => { it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rbgb; + const sw = v.rbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbga', () => { it('should return Vec4(r, b, g, a)', () => expect(v.rbga).toBeVec(v[0], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rbga; + const sw = v.rbga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbbr', () => { it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbbr; + const sw = v.rbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbbg', () => { it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbbg; + const sw = v.rbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbbb', () => { it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbbb; + const sw = v.rbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbba', () => { it('should return Vec4(r, b, b, a)', () => expect(v.rbba).toBeVec(v[0], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rbba; + const sw = v.rbba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbar', () => { it('should return Vec4(r, b, a, r)', () => expect(v.rbar).toBeVec(v[0], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rbar; + const sw = v.rbar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbag', () => { it('should return Vec4(r, b, a, g)', () => expect(v.rbag).toBeVec(v[0], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rbag; + const sw = v.rbag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbab', () => { it('should return Vec4(r, b, a, b)', () => expect(v.rbab).toBeVec(v[0], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rbab; + const sw = v.rbab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbaa', () => { it('should return Vec4(r, b, a, a)', () => expect(v.rbaa).toBeVec(v[0], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.rbaa; + const sw = v.rbaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rarr', () => { it('should return Vec4(r, a, r, r)', () => expect(v.rarr).toBeVec(v[0], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rarr; + const sw = v.rarr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rarg', () => { it('should return Vec4(r, a, r, g)', () => expect(v.rarg).toBeVec(v[0], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rarg; + const sw = v.rarg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rarb', () => { it('should return Vec4(r, a, r, b)', () => expect(v.rarb).toBeVec(v[0], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rarb; + const sw = v.rarb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rara', () => { it('should return Vec4(r, a, r, a)', () => expect(v.rara).toBeVec(v[0], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rara; + const sw = v.rara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ragr', () => { it('should return Vec4(r, a, g, r)', () => expect(v.ragr).toBeVec(v[0], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ragr; + const sw = v.ragr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ragg', () => { it('should return Vec4(r, a, g, g)', () => expect(v.ragg).toBeVec(v[0], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ragg; + const sw = v.ragg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ragb', () => { it('should return Vec4(r, a, g, b)', () => expect(v.ragb).toBeVec(v[0], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ragb; + const sw = v.ragb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raga', () => { it('should return Vec4(r, a, g, a)', () => expect(v.raga).toBeVec(v[0], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.raga; + const sw = v.raga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rabr', () => { it('should return Vec4(r, a, b, r)', () => expect(v.rabr).toBeVec(v[0], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rabr; + const sw = v.rabr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rabg', () => { it('should return Vec4(r, a, b, g)', () => expect(v.rabg).toBeVec(v[0], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rabg; + const sw = v.rabg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rabb', () => { it('should return Vec4(r, a, b, b)', () => expect(v.rabb).toBeVec(v[0], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rabb; + const sw = v.rabb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raba', () => { it('should return Vec4(r, a, b, a)', () => expect(v.raba).toBeVec(v[0], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.raba; + const sw = v.raba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raar', () => { it('should return Vec4(r, a, a, r)', () => expect(v.raar).toBeVec(v[0], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.raar; + const sw = v.raar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raag', () => { it('should return Vec4(r, a, a, g)', () => expect(v.raag).toBeVec(v[0], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.raag; + const sw = v.raag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raab', () => { it('should return Vec4(r, a, a, b)', () => expect(v.raab).toBeVec(v[0], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.raab; + const sw = v.raab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raaa', () => { it('should return Vec4(r, a, a, a)', () => expect(v.raaa).toBeVec(v[0], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.raaa; + const sw = v.raaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grrr', () => { it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grrr; + const sw = v.grrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grrg', () => { it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grrg; + const sw = v.grrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grrb', () => { it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grrb; + const sw = v.grrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grra', () => { it('should return Vec4(g, r, r, a)', () => expect(v.grra).toBeVec(v[1], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.grra; + const sw = v.grra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grgr', () => { it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.grgr; + const sw = v.grgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grgg', () => { it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.grgg; + const sw = v.grgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grgb', () => { it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.grgb; + const sw = v.grgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grga', () => { it('should return Vec4(g, r, g, a)', () => expect(v.grga).toBeVec(v[1], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.grga; + const sw = v.grga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grbr', () => { it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.grbr; + const sw = v.grbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grbg', () => { it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.grbg; + const sw = v.grbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grbb', () => { it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.grbb; + const sw = v.grbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grba', () => { it('should return Vec4(g, r, b, a)', () => expect(v.grba).toBeVec(v[1], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.grba; + const sw = v.grba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grar', () => { it('should return Vec4(g, r, a, r)', () => expect(v.grar).toBeVec(v[1], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.grar; + const sw = v.grar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grag', () => { it('should return Vec4(g, r, a, g)', () => expect(v.grag).toBeVec(v[1], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.grag; + const sw = v.grag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grab', () => { it('should return Vec4(g, r, a, b)', () => expect(v.grab).toBeVec(v[1], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.grab; + const sw = v.grab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().graa', () => { it('should return Vec4(g, r, a, a)', () => expect(v.graa).toBeVec(v[1], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.graa; + const sw = v.graa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggrr', () => { it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ggrr; + const sw = v.ggrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggrg', () => { it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ggrg; + const sw = v.ggrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggrb', () => { it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.ggrb; + const sw = v.ggrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggra', () => { it('should return Vec4(g, g, r, a)', () => expect(v.ggra).toBeVec(v[1], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.ggra; + const sw = v.ggra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gggr', () => { it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gggr; + const sw = v.gggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gggg', () => { it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gggg; + const sw = v.gggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gggb', () => { it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gggb; + const sw = v.gggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggga', () => { it('should return Vec4(g, g, g, a)', () => expect(v.ggga).toBeVec(v[1], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.ggga; + const sw = v.ggga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggbr', () => { it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.ggbr; + const sw = v.ggbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggbg', () => { it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.ggbg; + const sw = v.ggbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggbb', () => { it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.ggbb; + const sw = v.ggbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggba', () => { it('should return Vec4(g, g, b, a)', () => expect(v.ggba).toBeVec(v[1], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.ggba; + const sw = v.ggba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggar', () => { it('should return Vec4(g, g, a, r)', () => expect(v.ggar).toBeVec(v[1], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.ggar; + const sw = v.ggar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggag', () => { it('should return Vec4(g, g, a, g)', () => expect(v.ggag).toBeVec(v[1], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.ggag; + const sw = v.ggag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggab', () => { it('should return Vec4(g, g, a, b)', () => expect(v.ggab).toBeVec(v[1], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.ggab; + const sw = v.ggab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggaa', () => { it('should return Vec4(g, g, a, a)', () => expect(v.ggaa).toBeVec(v[1], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.ggaa; + const sw = v.ggaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbrr', () => { it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.gbrr; + const sw = v.gbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbrg', () => { it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.gbrg; + const sw = v.gbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbrb', () => { it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.gbrb; + const sw = v.gbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbra', () => { it('should return Vec4(g, b, r, a)', () => expect(v.gbra).toBeVec(v[1], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.gbra; + const sw = v.gbra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbgr', () => { it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gbgr; + const sw = v.gbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbgg', () => { it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gbgg; + const sw = v.gbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbgb', () => { it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gbgb; + const sw = v.gbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbga', () => { it('should return Vec4(g, b, g, a)', () => expect(v.gbga).toBeVec(v[1], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.gbga; + const sw = v.gbga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbbr', () => { it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbbr; + const sw = v.gbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbbg', () => { it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbbg; + const sw = v.gbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbbb', () => { it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbbb; + const sw = v.gbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbba', () => { it('should return Vec4(g, b, b, a)', () => expect(v.gbba).toBeVec(v[1], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.gbba; + const sw = v.gbba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbar', () => { it('should return Vec4(g, b, a, r)', () => expect(v.gbar).toBeVec(v[1], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.gbar; + const sw = v.gbar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbag', () => { it('should return Vec4(g, b, a, g)', () => expect(v.gbag).toBeVec(v[1], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.gbag; + const sw = v.gbag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbab', () => { it('should return Vec4(g, b, a, b)', () => expect(v.gbab).toBeVec(v[1], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.gbab; + const sw = v.gbab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbaa', () => { it('should return Vec4(g, b, a, a)', () => expect(v.gbaa).toBeVec(v[1], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.gbaa; + const sw = v.gbaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().garr', () => { it('should return Vec4(g, a, r, r)', () => expect(v.garr).toBeVec(v[1], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.garr; + const sw = v.garr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().garg', () => { it('should return Vec4(g, a, r, g)', () => expect(v.garg).toBeVec(v[1], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.garg; + const sw = v.garg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().garb', () => { it('should return Vec4(g, a, r, b)', () => expect(v.garb).toBeVec(v[1], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.garb; + const sw = v.garb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gara', () => { it('should return Vec4(g, a, r, a)', () => expect(v.gara).toBeVec(v[1], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.gara; + const sw = v.gara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gagr', () => { it('should return Vec4(g, a, g, r)', () => expect(v.gagr).toBeVec(v[1], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gagr; + const sw = v.gagr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gagg', () => { it('should return Vec4(g, a, g, g)', () => expect(v.gagg).toBeVec(v[1], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gagg; + const sw = v.gagg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gagb', () => { it('should return Vec4(g, a, g, b)', () => expect(v.gagb).toBeVec(v[1], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gagb; + const sw = v.gagb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaga', () => { it('should return Vec4(g, a, g, a)', () => expect(v.gaga).toBeVec(v[1], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.gaga; + const sw = v.gaga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gabr', () => { it('should return Vec4(g, a, b, r)', () => expect(v.gabr).toBeVec(v[1], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gabr; + const sw = v.gabr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gabg', () => { it('should return Vec4(g, a, b, g)', () => expect(v.gabg).toBeVec(v[1], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gabg; + const sw = v.gabg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gabb', () => { it('should return Vec4(g, a, b, b)', () => expect(v.gabb).toBeVec(v[1], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gabb; + const sw = v.gabb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaba', () => { it('should return Vec4(g, a, b, a)', () => expect(v.gaba).toBeVec(v[1], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.gaba; + const sw = v.gaba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaar', () => { it('should return Vec4(g, a, a, r)', () => expect(v.gaar).toBeVec(v[1], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.gaar; + const sw = v.gaar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaag', () => { it('should return Vec4(g, a, a, g)', () => expect(v.gaag).toBeVec(v[1], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.gaag; + const sw = v.gaag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaab', () => { it('should return Vec4(g, a, a, b)', () => expect(v.gaab).toBeVec(v[1], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.gaab; + const sw = v.gaab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaaa', () => { it('should return Vec4(g, a, a, a)', () => expect(v.gaaa).toBeVec(v[1], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.gaaa; + const sw = v.gaaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brrr', () => { it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brrr; + const sw = v.brrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brrg', () => { it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brrg; + const sw = v.brrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brrb', () => { it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brrb; + const sw = v.brrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brra', () => { it('should return Vec4(b, r, r, a)', () => expect(v.brra).toBeVec(v[2], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.brra; + const sw = v.brra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brgr', () => { it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.brgr; + const sw = v.brgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brgg', () => { it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.brgg; + const sw = v.brgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brgb', () => { it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.brgb; + const sw = v.brgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brga', () => { it('should return Vec4(b, r, g, a)', () => expect(v.brga).toBeVec(v[2], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.brga; + const sw = v.brga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brbr', () => { it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.brbr; + const sw = v.brbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brbg', () => { it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.brbg; + const sw = v.brbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brbb', () => { it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.brbb; + const sw = v.brbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brba', () => { it('should return Vec4(b, r, b, a)', () => expect(v.brba).toBeVec(v[2], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.brba; + const sw = v.brba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brar', () => { it('should return Vec4(b, r, a, r)', () => expect(v.brar).toBeVec(v[2], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.brar; + const sw = v.brar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brag', () => { it('should return Vec4(b, r, a, g)', () => expect(v.brag).toBeVec(v[2], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.brag; + const sw = v.brag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brab', () => { it('should return Vec4(b, r, a, b)', () => expect(v.brab).toBeVec(v[2], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.brab; + const sw = v.brab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().braa', () => { it('should return Vec4(b, r, a, a)', () => expect(v.braa).toBeVec(v[2], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.braa; + const sw = v.braa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgrr', () => { it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bgrr; + const sw = v.bgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgrg', () => { it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bgrg; + const sw = v.bgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgrb', () => { it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bgrb; + const sw = v.bgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgra', () => { it('should return Vec4(b, g, r, a)', () => expect(v.bgra).toBeVec(v[2], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bgra; + const sw = v.bgra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bggr', () => { it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bggr; + const sw = v.bggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bggg', () => { it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bggg; + const sw = v.bggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bggb', () => { it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bggb; + const sw = v.bggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgga', () => { it('should return Vec4(b, g, g, a)', () => expect(v.bgga).toBeVec(v[2], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.bgga; + const sw = v.bgga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgbr', () => { it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bgbr; + const sw = v.bgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgbg', () => { it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bgbg; + const sw = v.bgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgbb', () => { it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bgbb; + const sw = v.bgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgba', () => { it('should return Vec4(b, g, b, a)', () => expect(v.bgba).toBeVec(v[2], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.bgba; + const sw = v.bgba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgar', () => { it('should return Vec4(b, g, a, r)', () => expect(v.bgar).toBeVec(v[2], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.bgar; + const sw = v.bgar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgag', () => { it('should return Vec4(b, g, a, g)', () => expect(v.bgag).toBeVec(v[2], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.bgag; + const sw = v.bgag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgab', () => { it('should return Vec4(b, g, a, b)', () => expect(v.bgab).toBeVec(v[2], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.bgab; + const sw = v.bgab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgaa', () => { it('should return Vec4(b, g, a, a)', () => expect(v.bgaa).toBeVec(v[2], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.bgaa; + const sw = v.bgaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbrr', () => { it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bbrr; + const sw = v.bbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbrg', () => { it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bbrg; + const sw = v.bbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbrb', () => { it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bbrb; + const sw = v.bbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbra', () => { it('should return Vec4(b, b, r, a)', () => expect(v.bbra).toBeVec(v[2], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bbra; + const sw = v.bbra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbgr', () => { it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bbgr; + const sw = v.bbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbgg', () => { it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bbgg; + const sw = v.bbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbgb', () => { it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bbgb; + const sw = v.bbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbga', () => { it('should return Vec4(b, b, g, a)', () => expect(v.bbga).toBeVec(v[2], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.bbga; + const sw = v.bbga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbbr', () => { it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbbr; + const sw = v.bbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbbg', () => { it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbbg; + const sw = v.bbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbbb', () => { it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbbb; + const sw = v.bbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbba', () => { it('should return Vec4(b, b, b, a)', () => expect(v.bbba).toBeVec(v[2], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.bbba; + const sw = v.bbba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbar', () => { it('should return Vec4(b, b, a, r)', () => expect(v.bbar).toBeVec(v[2], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.bbar; + const sw = v.bbar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbag', () => { it('should return Vec4(b, b, a, g)', () => expect(v.bbag).toBeVec(v[2], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.bbag; + const sw = v.bbag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbab', () => { it('should return Vec4(b, b, a, b)', () => expect(v.bbab).toBeVec(v[2], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.bbab; + const sw = v.bbab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbaa', () => { it('should return Vec4(b, b, a, a)', () => expect(v.bbaa).toBeVec(v[2], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.bbaa; + const sw = v.bbaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().barr', () => { it('should return Vec4(b, a, r, r)', () => expect(v.barr).toBeVec(v[2], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.barr; + const sw = v.barr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().barg', () => { it('should return Vec4(b, a, r, g)', () => expect(v.barg).toBeVec(v[2], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.barg; + const sw = v.barg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().barb', () => { it('should return Vec4(b, a, r, b)', () => expect(v.barb).toBeVec(v[2], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.barb; + const sw = v.barb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bara', () => { it('should return Vec4(b, a, r, a)', () => expect(v.bara).toBeVec(v[2], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bara; + const sw = v.bara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bagr', () => { it('should return Vec4(b, a, g, r)', () => expect(v.bagr).toBeVec(v[2], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bagr; + const sw = v.bagr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bagg', () => { it('should return Vec4(b, a, g, g)', () => expect(v.bagg).toBeVec(v[2], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bagg; + const sw = v.bagg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bagb', () => { it('should return Vec4(b, a, g, b)', () => expect(v.bagb).toBeVec(v[2], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bagb; + const sw = v.bagb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baga', () => { it('should return Vec4(b, a, g, a)', () => expect(v.baga).toBeVec(v[2], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.baga; + const sw = v.baga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().babr', () => { it('should return Vec4(b, a, b, r)', () => expect(v.babr).toBeVec(v[2], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.babr; + const sw = v.babr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().babg', () => { it('should return Vec4(b, a, b, g)', () => expect(v.babg).toBeVec(v[2], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.babg; + const sw = v.babg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().babb', () => { it('should return Vec4(b, a, b, b)', () => expect(v.babb).toBeVec(v[2], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.babb; + const sw = v.babb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baba', () => { it('should return Vec4(b, a, b, a)', () => expect(v.baba).toBeVec(v[2], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.baba; + const sw = v.baba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baar', () => { it('should return Vec4(b, a, a, r)', () => expect(v.baar).toBeVec(v[2], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.baar; + const sw = v.baar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baag', () => { it('should return Vec4(b, a, a, g)', () => expect(v.baag).toBeVec(v[2], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.baag; + const sw = v.baag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baab', () => { it('should return Vec4(b, a, a, b)', () => expect(v.baab).toBeVec(v[2], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.baab; + const sw = v.baab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baaa', () => { it('should return Vec4(b, a, a, a)', () => expect(v.baaa).toBeVec(v[2], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.baaa; + const sw = v.baaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arrr', () => { it('should return Vec4(a, r, r, r)', () => expect(v.arrr).toBeVec(v[3], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.arrr; + const sw = v.arrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arrg', () => { it('should return Vec4(a, r, r, g)', () => expect(v.arrg).toBeVec(v[3], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.arrg; + const sw = v.arrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arrb', () => { it('should return Vec4(a, r, r, b)', () => expect(v.arrb).toBeVec(v[3], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.arrb; + const sw = v.arrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arra', () => { it('should return Vec4(a, r, r, a)', () => expect(v.arra).toBeVec(v[3], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.arra; + const sw = v.arra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().argr', () => { it('should return Vec4(a, r, g, r)', () => expect(v.argr).toBeVec(v[3], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.argr; + const sw = v.argr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().argg', () => { it('should return Vec4(a, r, g, g)', () => expect(v.argg).toBeVec(v[3], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.argg; + const sw = v.argg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().argb', () => { it('should return Vec4(a, r, g, b)', () => expect(v.argb).toBeVec(v[3], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.argb; + const sw = v.argb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arga', () => { it('should return Vec4(a, r, g, a)', () => expect(v.arga).toBeVec(v[3], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.arga; + const sw = v.arga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arbr', () => { it('should return Vec4(a, r, b, r)', () => expect(v.arbr).toBeVec(v[3], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.arbr; + const sw = v.arbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arbg', () => { it('should return Vec4(a, r, b, g)', () => expect(v.arbg).toBeVec(v[3], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.arbg; + const sw = v.arbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arbb', () => { it('should return Vec4(a, r, b, b)', () => expect(v.arbb).toBeVec(v[3], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.arbb; + const sw = v.arbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arba', () => { it('should return Vec4(a, r, b, a)', () => expect(v.arba).toBeVec(v[3], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.arba; + const sw = v.arba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arar', () => { it('should return Vec4(a, r, a, r)', () => expect(v.arar).toBeVec(v[3], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.arar; + const sw = v.arar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arag', () => { it('should return Vec4(a, r, a, g)', () => expect(v.arag).toBeVec(v[3], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.arag; + const sw = v.arag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arab', () => { it('should return Vec4(a, r, a, b)', () => expect(v.arab).toBeVec(v[3], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.arab; + const sw = v.arab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().araa', () => { it('should return Vec4(a, r, a, a)', () => expect(v.araa).toBeVec(v[3], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.araa; + const sw = v.araa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agrr', () => { it('should return Vec4(a, g, r, r)', () => expect(v.agrr).toBeVec(v[3], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.agrr; + const sw = v.agrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agrg', () => { it('should return Vec4(a, g, r, g)', () => expect(v.agrg).toBeVec(v[3], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.agrg; + const sw = v.agrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agrb', () => { it('should return Vec4(a, g, r, b)', () => expect(v.agrb).toBeVec(v[3], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.agrb; + const sw = v.agrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agra', () => { it('should return Vec4(a, g, r, a)', () => expect(v.agra).toBeVec(v[3], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.agra; + const sw = v.agra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aggr', () => { it('should return Vec4(a, g, g, r)', () => expect(v.aggr).toBeVec(v[3], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.aggr; + const sw = v.aggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aggg', () => { it('should return Vec4(a, g, g, g)', () => expect(v.aggg).toBeVec(v[3], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.aggg; + const sw = v.aggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aggb', () => { it('should return Vec4(a, g, g, b)', () => expect(v.aggb).toBeVec(v[3], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.aggb; + const sw = v.aggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agga', () => { it('should return Vec4(a, g, g, a)', () => expect(v.agga).toBeVec(v[3], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.agga; + const sw = v.agga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agbr', () => { it('should return Vec4(a, g, b, r)', () => expect(v.agbr).toBeVec(v[3], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.agbr; + const sw = v.agbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agbg', () => { it('should return Vec4(a, g, b, g)', () => expect(v.agbg).toBeVec(v[3], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.agbg; + const sw = v.agbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agbb', () => { it('should return Vec4(a, g, b, b)', () => expect(v.agbb).toBeVec(v[3], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.agbb; + const sw = v.agbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agba', () => { it('should return Vec4(a, g, b, a)', () => expect(v.agba).toBeVec(v[3], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.agba; + const sw = v.agba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agar', () => { it('should return Vec4(a, g, a, r)', () => expect(v.agar).toBeVec(v[3], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.agar; + const sw = v.agar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agag', () => { it('should return Vec4(a, g, a, g)', () => expect(v.agag).toBeVec(v[3], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.agag; + const sw = v.agag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agab', () => { it('should return Vec4(a, g, a, b)', () => expect(v.agab).toBeVec(v[3], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.agab; + const sw = v.agab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agaa', () => { it('should return Vec4(a, g, a, a)', () => expect(v.agaa).toBeVec(v[3], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.agaa; + const sw = v.agaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abrr', () => { it('should return Vec4(a, b, r, r)', () => expect(v.abrr).toBeVec(v[3], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.abrr; + const sw = v.abrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abrg', () => { it('should return Vec4(a, b, r, g)', () => expect(v.abrg).toBeVec(v[3], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.abrg; + const sw = v.abrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abrb', () => { it('should return Vec4(a, b, r, b)', () => expect(v.abrb).toBeVec(v[3], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.abrb; + const sw = v.abrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abra', () => { it('should return Vec4(a, b, r, a)', () => expect(v.abra).toBeVec(v[3], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.abra; + const sw = v.abra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abgr', () => { it('should return Vec4(a, b, g, r)', () => expect(v.abgr).toBeVec(v[3], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.abgr; + const sw = v.abgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abgg', () => { it('should return Vec4(a, b, g, g)', () => expect(v.abgg).toBeVec(v[3], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.abgg; + const sw = v.abgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abgb', () => { it('should return Vec4(a, b, g, b)', () => expect(v.abgb).toBeVec(v[3], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.abgb; + const sw = v.abgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abga', () => { it('should return Vec4(a, b, g, a)', () => expect(v.abga).toBeVec(v[3], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.abga; + const sw = v.abga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abbr', () => { it('should return Vec4(a, b, b, r)', () => expect(v.abbr).toBeVec(v[3], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.abbr; + const sw = v.abbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abbg', () => { it('should return Vec4(a, b, b, g)', () => expect(v.abbg).toBeVec(v[3], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.abbg; + const sw = v.abbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abbb', () => { it('should return Vec4(a, b, b, b)', () => expect(v.abbb).toBeVec(v[3], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.abbb; + const sw = v.abbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abba', () => { it('should return Vec4(a, b, b, a)', () => expect(v.abba).toBeVec(v[3], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.abba; + const sw = v.abba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abar', () => { it('should return Vec4(a, b, a, r)', () => expect(v.abar).toBeVec(v[3], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.abar; + const sw = v.abar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abag', () => { it('should return Vec4(a, b, a, g)', () => expect(v.abag).toBeVec(v[3], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.abag; + const sw = v.abag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abab', () => { it('should return Vec4(a, b, a, b)', () => expect(v.abab).toBeVec(v[3], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.abab; + const sw = v.abab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abaa', () => { it('should return Vec4(a, b, a, a)', () => expect(v.abaa).toBeVec(v[3], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.abaa; + const sw = v.abaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aarr', () => { it('should return Vec4(a, a, r, r)', () => expect(v.aarr).toBeVec(v[3], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.aarr; + const sw = v.aarr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aarg', () => { it('should return Vec4(a, a, r, g)', () => expect(v.aarg).toBeVec(v[3], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.aarg; + const sw = v.aarg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aarb', () => { it('should return Vec4(a, a, r, b)', () => expect(v.aarb).toBeVec(v[3], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.aarb; + const sw = v.aarb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aara', () => { it('should return Vec4(a, a, r, a)', () => expect(v.aara).toBeVec(v[3], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.aara; + const sw = v.aara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aagr', () => { it('should return Vec4(a, a, g, r)', () => expect(v.aagr).toBeVec(v[3], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.aagr; + const sw = v.aagr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aagg', () => { it('should return Vec4(a, a, g, g)', () => expect(v.aagg).toBeVec(v[3], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.aagg; + const sw = v.aagg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aagb', () => { it('should return Vec4(a, a, g, b)', () => expect(v.aagb).toBeVec(v[3], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.aagb; + const sw = v.aagb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaga', () => { it('should return Vec4(a, a, g, a)', () => expect(v.aaga).toBeVec(v[3], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.aaga; + const sw = v.aaga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aabr', () => { it('should return Vec4(a, a, b, r)', () => expect(v.aabr).toBeVec(v[3], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.aabr; + const sw = v.aabr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aabg', () => { it('should return Vec4(a, a, b, g)', () => expect(v.aabg).toBeVec(v[3], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.aabg; + const sw = v.aabg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aabb', () => { it('should return Vec4(a, a, b, b)', () => expect(v.aabb).toBeVec(v[3], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.aabb; + const sw = v.aabb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaba', () => { it('should return Vec4(a, a, b, a)', () => expect(v.aaba).toBeVec(v[3], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.aaba; + const sw = v.aaba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaar', () => { it('should return Vec4(a, a, a, r)', () => expect(v.aaar).toBeVec(v[3], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.aaar; + const sw = v.aaar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaag', () => { it('should return Vec4(a, a, a, g)', () => expect(v.aaag).toBeVec(v[3], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.aaag; + const sw = v.aaag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaab', () => { it('should return Vec4(a, a, a, b)', () => expect(v.aaab).toBeVec(v[3], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.aaab; + const sw = v.aaab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaaa', () => { it('should return Vec4(a, a, a, a)', () => expect(v.aaaa).toBeVec(v[3], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.aaaa; + const sw = v.aaaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + // [/Swizzle Autogen] }); diff --git a/tests/f32/Vec4.spec.ts b/tests/f32/Vec4.spec.ts index 6d32c142..19a3d75a 100644 --- a/tests/f32/Vec4.spec.ts +++ b/tests/f32/Vec4.spec.ts @@ -24,12 +24,12 @@ describe('Vec4', () => { }); it('should return Vec4(x, y, z, w) if called with (Vec4(x, y, z, w))', () => { - let v = new Vec4(3.4, 5.6, 7.8, 9); + const v = new Vec4(3.4, 5.6, 7.8, 9); expect(new Vec4(v)).toBeVec(v); }); it('should return Vec4(x, y, z, w) if called with (Float32Array([x, y, z, w]))', () => { - let arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); + const arr = new Float32Array([1.2, 3.4, 5.6, 7.8]); expect(new Vec4(arr)).toBeVec(arr); }); }); @@ -38,7 +38,7 @@ describe('Vec4', () => { let out: Vec4Like; let vecA: Vec4Like; let vecB: Vec4Like; - let result: any; + let result: Vec4Like | number; beforeEach(() => { vecA = new Vec4(1, 2, 3, 4); @@ -406,7 +406,7 @@ describe('Vec4', () => { describe('with a separate output vector', () => { beforeEach(() => { result = Vec4.inverse(out, vecA); }); - it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3, 1/4)); + it('should place values into out', () => expect(out).toBeVec(1, 1 / 2, 1 / 3, 1 / 4)); it('should return out', () => expect(result).toBe(out)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); }); @@ -414,7 +414,7 @@ describe('Vec4', () => { describe('when vecA is the output vector', () => { beforeEach(() => { result = Vec4.inverse(vecA, vecA); }); - it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3, 1/4)); + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1 / 2, 1 / 3, 1 / 4)); it('should return vecA', () => expect(result).toBe(vecA)); }); }); @@ -491,7 +491,8 @@ describe('Vec4', () => { }); }); - /*describe('random', () => { + /* + describe('random', () => { describe('with no scale', () => { beforeEach(() => { result = Vec4.random(out); }); @@ -517,7 +518,7 @@ describe('Vec4', () => { }); describe('with a separate output vector', () => { - beforeEach(() => { result = Vec4.cross(out, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(out, vecA, vecB, vecC); }); it('should place values into out', () => expect(out).toBeVec(0, 0, 0, -1)); it('should return out', () => expect(result).toBe(out)); @@ -527,32 +528,33 @@ describe('Vec4', () => { }); describe('when vecA is the output vector', () => { - beforeEach(() => { result = Vec4.cross(vecA, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(vecA, vecA, vecB, vecC); }); - it('should place values into vecA', () => expect(vecA).toBeVec(0, 0, 0,-1)); + it('should place values into vecA', () => expect(vecA).toBeVec(0, 0, 0, -1)); it('should return vecA', () => expect(result).toBe(vecA)); it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); }); describe('when vecB is the output vector', () => { - beforeEach(() => { result = Vec4.cross(vecB, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(vecB, vecA, vecB, vecC); }); - it('should place values into vecB', () => expect(vecB).toBeVec(0, 0, 0,-1)); + it('should place values into vecB', () => expect(vecB).toBeVec(0, 0, 0, -1)); it('should return vecB', () => expect(result).toBe(vecB)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); }); describe('when vecC is the output vector', () => { - beforeEach(() => { result = Vec4.cross(vecC, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(vecC, vecA, vecB, vecC); }); - it('should place values into vecC', () => expect(vecC).toBeVec(0, 0, 0,-1)); + it('should place values into vecC', () => expect(vecC).toBeVec(0, 0, 0, -1)); it('should return vecC', () => expect(result).toBe(vecC)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); }); }); - /*describe('forEach', () => { + /* + describe('forEach', () => { let vecArray; beforeEach(() => { @@ -648,7 +650,7 @@ describe('Vec4', () => { describe('str', () => { it('should return a string representation of the vector', - () => expect(Vec4.str(vecA)).toEqual('Vec4(1, 2, 3, 4)')); + () => expect(Vec4.str(vecA)).toEqual('Vec4(1, 2, 3, 4)')); }); describe('exactEquals', () => { diff --git a/tests/f32/util.spec.ts b/tests/f32/util.spec.ts index 534dc745..30043e51 100644 --- a/tests/f32/util.spec.ts +++ b/tests/f32/util.spec.ts @@ -5,15 +5,15 @@ import { toDegree, toRadian } from '#gl-matrix/util'; describe('Common', () => { describe('toRadian', () => { it('should return a value of 0 when passed 0', () => expect(toRadian(0)).toBeCloseTo(0)); - it('should return a value of Math.PI/2 when passed 90', () => expect(toRadian(90)).toBeCloseTo(Math.PI/2)); + it('should return a value of Math.PI/2 when passed 90', () => expect(toRadian(90)).toBeCloseTo(Math.PI / 2)); it('should return a value of Math.PI when passed 180', () => expect(toRadian(180)).toBeCloseTo(Math.PI)); - it('should return a value of Math.PI*2 when passed 360', () => expect(toRadian(360)).toBeCloseTo(Math.PI*2)); + it('should return a value of Math.PI*2 when passed 360', () => expect(toRadian(360)).toBeCloseTo(Math.PI * 2)); }); describe('toDegree', () => { it('should return a value of 0 when passed 0', () => expect(toDegree(0)).toBeCloseTo(0)); - it('should return a value of 90 when passed Math.PI/2', () => expect(toDegree(Math.PI/2)).toBeCloseTo(90)); + it('should return a value of 90 when passed Math.PI/2', () => expect(toDegree(Math.PI / 2)).toBeCloseTo(90)); it('should return a value of 180 when passed Math.PI', () => expect(toDegree(Math.PI)).toBeCloseTo(180)); - it('should return a value of 360 when passed Math.PI*2', () => expect(toDegree(Math.PI*2)).toBeCloseTo(360)); + it('should return a value of 360 when passed Math.PI*2', () => expect(toDegree(Math.PI * 2)).toBeCloseTo(360)); }); }); diff --git a/tests/f64/Mat2.spec.ts b/tests/f64/Mat2.spec.ts index f058d4db..a064fd9e 100644 --- a/tests/f64/Mat2.spec.ts +++ b/tests/f64/Mat2.spec.ts @@ -2,20 +2,22 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat2 } from '#gl-matrix/f64'; +import type { FloatArray, Mat2Like, Vec2Like } from '#gl-matrix/types'; + describe('Mat2', () => { describe('constructor', () => { it('should return an identity Mat2 if called with no arguments', () => { expect(new Mat2()).toBeVec( 1, 0, - 0, 1) + 0, 1); }); it('should return Mat2(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { expect(new Mat2( 1, 2, 3, 4)).toBeVec( - 1, 2, - 3, 4); + 1, 2, + 3, 4); }); it('should return Mat2(x, x, x, ...) if called with (x)', () => { @@ -33,14 +35,14 @@ describe('Mat2', () => { }); it('should return Mat2(m0, m1, ...m8) if called with (Mat4(m0, m1, ...m9))', () => { - let v = new Mat2( + const v = new Mat2( 1, 2, 3, 4); expect(new Mat2(v)).toBeVec(v); }); it('should return Mat2(m0, m1, ...m8) if called with (Float64Array([m0, m1, ...m8]))', () => { - let arr = new Float64Array([ + const arr = new Float64Array([ 1, 2, 3, 4]); expect(new Mat2(arr)).toBeVec(arr); @@ -48,7 +50,8 @@ describe('Mat2', () => { }); describe('static', () => { - let out, matA, matB, identity, result; + let out: Mat2Like, matA: Mat2Like, matB: Mat2Like, identity: Mat2Like, + result: [Mat2Like, Readonly, Mat2Like] | FloatArray | Mat2Like | null | number | string; beforeEach(() => { matA = new Float64Array([1, 2, 3, 4]); @@ -61,7 +64,7 @@ describe('Mat2', () => { beforeEach(() => { result = Mat2.create(); }); it('should return a 4 element array initialized to a 2x2 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -147,10 +150,10 @@ describe('Mat2', () => { describe('with a separate output matrix', () => { beforeEach(() => { result = Mat2.multiply(out, matA, matB); }); - it('should place values into out', () => expect(out).toBeVec(23, 34, 31, 46)); - it('should return out', () => expect(result).toBe(out)); - it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); - it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + it('should place values into out', () => expect(out).toBeVec(23, 34, 31, 46)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); }); describe('when matA is the output matrix', () => { @@ -188,7 +191,7 @@ describe('Mat2', () => { }); describe('scale', () => { - let vecA; + let vecA: Vec2Like; beforeEach(() => { vecA = [2, 3]; }); @@ -217,17 +220,17 @@ describe('Mat2', () => { describe('frob', () => { beforeEach(() => { result = Mat2.frob(matA); }); it('should return the Frobenius Norm of the matrix', - () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2)))); + () => expect(result).toEqual(Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2)))); }); describe('LDU', () => { - let L, D, U, L_result, D_result, U_result; + let L: Mat2, D: Mat2, U: Mat2, L_result: Mat2, D_result: Mat2, U_result: Mat2; beforeEach(() => { L = Mat2.create(); D = Mat2.create(); U = Mat2.create(); - result = Mat2.LDU(L, D, U, [4,3,6,3]); + result = Mat2.LDU(L, D, U, [4, 3, 6, 3]); L_result = Mat2.create(); L_result[2] = 1.5; D_result = Mat2.create(); U_result = Mat2.create(); @@ -235,20 +238,23 @@ describe('Mat2', () => { }); it('should return a lower triangular, a diagonal and an upper triangular matrix', () => { + // @ts-expect-error Not null expect(result[0]).toBeVec(L_result); + // @ts-expect-error Not null expect(result[1]).toBeVec(D_result); + // @ts-expect-error Not null expect(result[2]).toBeVec(U_result); }); - }); + }); describe('add', () => { describe('with a separate output matrix', () => { beforeEach(() => { result = Mat2.add(out, matA, matB); }); - it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); - it('should return out', () => expect(result).toBe(out)); - it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); - it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); + it('should place values into out', () => expect(out).toBeVec(6, 8, 10, 12)); + it('should return out', () => expect(result).toBe(out)); + it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4)); + it('should not modify matB', () => expect(matB).toBeVec(5, 6, 7, 8)); }); describe('when matA is the output matrix', () => { @@ -355,7 +361,7 @@ describe('Mat2', () => { }); describe('exactEquals', () => { - let matC, r0, r1, r2; + let matC: Mat2Like, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3]; @@ -372,7 +378,7 @@ describe('Mat2', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat2Like, matD: Mat2Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3]; diff --git a/tests/f64/Mat2d.spec.ts b/tests/f64/Mat2d.spec.ts index f8702e20..409c04cb 100644 --- a/tests/f64/Mat2d.spec.ts +++ b/tests/f64/Mat2d.spec.ts @@ -2,13 +2,15 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat2d } from '#gl-matrix/f64'; +import type { Mat2dLike, Vec2Like } from '#gl-matrix/types'; + describe('Mat2d', () => { describe('constructor', () => { it('should return an identity Mat2d if called with no arguments', () => { expect(new Mat2d()).toBeVec( 1, 0, 0, 1, - 0, 0) + 0, 0); }); it('should return Mat2d(m0, m1, ...m5) if called with (m0, m1, ...m5)', () => { @@ -16,9 +18,9 @@ describe('Mat2d', () => { 1, 2, 3, 4, 5, 6)).toBeVec( - 1, 2, - 3, 4, - 5, 6); + 1, 2, + 3, 4, + 5, 6); }); it('should return Mat2d(x, x, x, ...) if called with (x)', () => { @@ -39,7 +41,7 @@ describe('Mat2d', () => { }); it('should return Mat2d(m0, m1, ...m8) if called with (Mat2d(m0, m1, ...m9))', () => { - let v = new Mat2d( + const v = new Mat2d( 1, 2, 3, 4, 5, 6); @@ -47,7 +49,7 @@ describe('Mat2d', () => { }); it('should return Mat2d(m0, m1, ...m8) if called with (Float64Array([m0, m1, ...m8]))', () => { - let arr = new Float64Array([ + const arr = new Float64Array([ 1, 2, 3, 4, 5, 6]); @@ -56,7 +58,8 @@ describe('Mat2d', () => { }); describe('static', () => { - let out, matA, matB, oldA, oldB, identity, result; + let out: Mat2dLike, matA: Mat2dLike, matB: Mat2dLike, oldA: Mat2dLike, oldB: Mat2dLike, + identity: Mat2dLike, result: Mat2dLike | null | number | string; beforeEach(() => { matA = new Float64Array([1, 2, @@ -79,7 +82,7 @@ describe('Mat2d', () => { 0, 0, 0, 0]); - identity = new Float64Array([1, 0, + identity = new Float64Array([1, 0, 0, 1, 0, 0]); }); @@ -88,7 +91,7 @@ describe('Mat2d', () => { beforeEach(() => { result = Mat2d.create(); }); it('should return a 6 element array initialized to a 2x3 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -115,7 +118,7 @@ describe('Mat2d', () => { describe('with a separate output matrix', () => { beforeEach(() => { result = Mat2d.invert(out, matA); }); - it('should place values into out', () => expect(out).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should place values into out', () => expect(out).toBeVec(-2, 1, 1.5, -0.5, 1, -2)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(oldA)); }); @@ -123,7 +126,7 @@ describe('Mat2d', () => { describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat2d.invert(matA, matA); }); - it('should place values into matA', () => expect(matA).toBeVec( -2, 1, 1.5, -0.5, 1, -2 )); + it('should place values into matA', () => expect(matA).toBeVec(-2, 1, 1.5, -0.5, 1, -2)); it('should return matA', () => expect(result).toBe(matA)); }); }); @@ -181,7 +184,7 @@ describe('Mat2d', () => { }); describe('scale', () => { - let vecA; + let vecA: Vec2Like; beforeEach(() => { vecA = [2, 3]; }); describe('with a separate output matrix', () => { @@ -201,7 +204,7 @@ describe('Mat2d', () => { }); describe('translate', () => { - let vecA; + let vecA: Vec2Like; beforeEach(() => { vecA = [2, 3]; }); describe('with a separate output matrix', () => { @@ -224,7 +227,7 @@ describe('Mat2d', () => { beforeEach(() => { result = Mat2d.str(matA); }); it('should return a string representation of the matrix', - () => expect(result).toEqual('Mat2d(1, 2, 3, 4, 5, 6)')); + () => expect(result).toEqual('Mat2d(1, 2, 3, 4, 5, 6)')); }); describe('frob', () => { @@ -294,7 +297,7 @@ describe('Mat2d', () => { beforeEach(() => { result = Mat2d.fromValues(1, 2, 3, 4, 5, 6); }); it('should return a 6 element array initialized to the values passed', - () => expect(result).toBeVec(1, 2, 3, 4, 5, 6)); + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6)); }); describe('set', () => { @@ -349,7 +352,7 @@ describe('Mat2d', () => { }); describe('exactEquals', () => { - let matC, r0, r1; + let matC: Mat2dLike, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5]; matB = [0, 1, 2, 3, 4, 5]; @@ -365,7 +368,7 @@ describe('Mat2d', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat2dLike, matD: Mat2dLike, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5]; diff --git a/tests/f64/Mat3.spec.ts b/tests/f64/Mat3.spec.ts index f67e01ad..ac9835b6 100644 --- a/tests/f64/Mat3.spec.ts +++ b/tests/f64/Mat3.spec.ts @@ -2,13 +2,15 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat3, Mat4, Vec3 } from '#gl-matrix/f64'; +import type { Mat3Like, Mat4Like, Vec4Like } from '#gl-matrix/types'; + describe('Mat3', () => { describe('constructor', () => { it('should return an identity Mat3 if called with no arguments', () => { expect(new Mat3()).toBeVec( 1, 0, 0, 0, 1, 0, - 0, 0, 1) + 0, 0, 1); }); it('should return Mat3(m0, m1, ...m8) if called with (m0, m1, ...m8)', () => { @@ -39,7 +41,7 @@ describe('Mat3', () => { }); it('should return Mat3(m0, m1, ...m8) if called with (Mat3(m0, m1, ...m9))', () => { - let v = new Mat3( + const v = new Mat3( 1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -47,7 +49,7 @@ describe('Mat3', () => { }); it('should return Mat3(m0, m1, ...m8) if called with (Float64Array([m0, m1, ...m8]))', () => { - let arr = new Float64Array([ + const arr = new Float64Array([ 1, 2, 3, 4, 5, 6, 7, 8, 9]); @@ -56,7 +58,8 @@ describe('Mat3', () => { }); describe('static', () => { - let out, matA, matB, identity, result; + let out: Mat3Like, matA: Mat3Like, matB: Mat3Like, mat4: Mat4Like, identity: Mat3Like, + result: Mat3Like | null | number | string; beforeEach(() => { matA = new Float64Array([1, 0, 0, @@ -78,90 +81,95 @@ describe('Mat3', () => { describe('normalFromMat4', () => { beforeEach(() => { - matA = new Float64Array([1, 0, 0, 0, + mat4 = new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); - result = Mat3.normalFromMat4(out, matA); + result = Mat3.normalFromMat4(out, mat4); }); it('should return out', () => expect(result).toBe(out)); describe('with translation and rotation', () => { beforeEach(() => { - Mat4.translate(matA, matA, [2, 4, 6]); - Mat4.rotateX(matA, matA, Math.PI / 2); + Mat4.translate(mat4, mat4, [2, 4, 6]); + Mat4.rotateX(mat4, mat4, Math.PI / 2); - result = Mat3.normalFromMat4(out, matA); + result = Mat3.normalFromMat4(out, mat4); }); it('should give rotated matrix', () => { - expect(result).toBeVec(1, 0, 0, - 0, 0, 1, - 0,-1, 0); + expect(result).toBeVec( + 1, 0, 0, + 0, 0, 1, + 0, -1, 0); }); describe('and scale', () => { beforeEach(() => { - Mat4.scale(matA, matA, [2, 3, 4]); + Mat4.scale(mat4, mat4, [2, 3, 4]); - result = Mat3.normalFromMat4(out, matA); + result = Mat3.normalFromMat4(out, mat4); }); it('should give rotated matrix', () => { - expect(result).toBeVec(0.5, 0, 0, - 0, 0, 0.333333, - 0, -0.25, 0); + expect(result).toBeVec( + 0.5, 0, 0, + 0, 0, 0.333333, + 0, -0.25, 0); }); }); }); }); describe('fromQuat', () => { - let q; + let q: Vec4Like; beforeEach(() => { - q = [ 0, -0.7071067811865475, 0, 0.7071067811865475 ]; + q = [0, -0.7071067811865475, 0, 0.7071067811865475]; result = Mat3.fromQuat(out, q); }); it('should return out', () => expect(result).toBe(out)); it('should rotate a vector the same as the original quat', () => { - let vecOut = new Vec3(); - Vec3.transformQuat(vecOut, [0,0,-1], q); - expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(vecOut); + const vecOut = new Vec3(); + Vec3.transformQuat(vecOut, [0, 0, -1], q); + expect(Vec3.transformMat3([0, 0, 0], [0, 0, -1], out)).toBeVec(vecOut); }); it('should rotate a vector by PI/2 radians', - () => expect(Vec3.transformMat3([0, 0, 0], [0,0,-1], out)).toBeVec(1,0,0)); + () => expect(Vec3.transformMat3([0, 0, 0], [0, 0, -1], out)).toBeVec(1, 0, 0)); }); describe('fromMat4', () => { beforeEach(() => { - result = Mat3.fromMat4(out, [ 1, 2, 3, 4, - 5, 6, 7, 8, - 9,10,11,12, - 13,14,15,16]); + result = Mat3.fromMat4(out, [ + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16]); }); it('should return out', () => expect(result).toBe(out)); it('should calculate proper Mat3', () => { - expect(out).toBeVec( 1, 2, 3, - 5, 6, 7, - 9,10,11); + expect(out).toBeVec( + 1, 2, 3, + 5, 6, 7, + 9, 10, 11); }); }); describe('scale', () => { - beforeEach(() => { result = Mat3.scale(out, matA, [2,2]); }); + beforeEach(() => { result = Mat3.scale(out, matA, [2, 2]); }); it('should return out', () => expect(result).toBe(out)); it('should place proper values in out', () => { - expect(out).toBeVec( 2, 0, 0, - 0, 2, 0, - 1, 2, 1); + expect(out).toBeVec( + 2, 0, 0, + 0, 2, 0, + 1, 2, 1); }); }); @@ -169,7 +177,7 @@ describe('Mat3', () => { beforeEach(() => { result = Mat3.create(); }); it('should return a 9 element array initialized to a 3x3 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -378,13 +386,13 @@ describe('Mat3', () => { beforeEach(() => { result = Mat3.str(matA); }); it('should return a string representation of the matrix', - () => expect(result).toEqual('Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)')); + () => expect(result).toEqual('Mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)')); }); describe('frob', () => { beforeEach(() => { result = Mat3.frob(matA); }); - it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + + it('should return the Frobenius Norm of the matrix', () => expect(result).toEqual(Math.sqrt(Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(1, 2)))); }); @@ -459,7 +467,7 @@ describe('Mat3', () => { beforeEach(() => { result = Mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); }); it('should return a 9 element array initialized to the values passed', - () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9)); }); describe('set', () => { @@ -526,14 +534,15 @@ describe('Mat3', () => { it('should return out', () => expect(result).toBe(out)); it('should give projection matrix', () => { - expect(result).toBeVec(0.02, 0, 0, - 0, -0.01, 0, - -1, 1, 1); + expect(result).toBeVec( + 0.02, 0, 0, + 0, -0.01, 0, + -1, 1, 1); }); }); describe('exactEquals', () => { - let matC, r0, r1; + let matC: Mat3Like, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; @@ -550,7 +559,7 @@ describe('Mat3', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat3Like, matD: Mat3Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; diff --git a/tests/f64/Mat4.spec.ts b/tests/f64/Mat4.spec.ts index 52f91b8c..79f7728c 100644 --- a/tests/f64/Mat4.spec.ts +++ b/tests/f64/Mat4.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat4, Quat, Vec3 } from '#gl-matrix/f64'; -import type { Vec3Like } from '#gl-matrix/types'; +import type { FloatArray, Mat4Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; describe('Mat4', () => { describe('constructor', () => { @@ -47,7 +47,7 @@ describe('Mat4', () => { }); it('should return Mat4(m0, m1, ...m15) if called with (Mat4(m0, m1, ...m15))', () => { - let v = new Mat4( + const v = new Mat4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -56,7 +56,7 @@ describe('Mat4', () => { }); it('should return Mat4(m0, m1, ...m15) if called with (Float64Array([m0, m1, ...m15]))', () => { - let arr = new Float64Array([ + const arr = new Float64Array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -66,7 +66,8 @@ describe('Mat4', () => { }); describe('static', () => { - let out, matA, matB, identity, result; + let out: Mat4Like, matA: Mat4Like, matB: Mat4Like, identity: Mat4Like, + result: Mat4Like | Vec3Like | Vec4Like | null | number | string; beforeEach(() => { // Attempting to portray a semi-realistic transform matrix @@ -103,7 +104,7 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.create(); }); it('should return a 16 element array initialized to a 4x4 identity matrix', - () => expect(result).toBeVec(identity)); + () => expect(result).toBeVec(identity)); }); describe('clone', () => { @@ -358,8 +359,8 @@ describe('Mat4', () => { }); describe('rotate', () => { - let rad = Math.PI * 0.5; - let axis: Vec3Like = [1, 0, 0]; + const rad = Math.PI * 0.5; + const axis: Vec3Like = [1, 0, 0]; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotate(out, matA, rad, axis); }); @@ -393,7 +394,7 @@ describe('Mat4', () => { }); describe('rotateX', () => { - let rad = Math.PI * 0.5; + const rad = Math.PI * 0.5; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotateX(out, matA, rad); }); @@ -427,7 +428,7 @@ describe('Mat4', () => { }); describe('rotateY', () => { - let rad = Math.PI * 0.5; + const rad = Math.PI * 0.5; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotateY(out, matA, rad); }); @@ -461,7 +462,7 @@ describe('Mat4', () => { }); describe('rotateZ', () => { - let rad = Math.PI * 0.5; + const rad = Math.PI * 0.5; describe('with a separate output matrix', () => { beforeEach(() => { result = Mat4.rotateZ(out, matA, rad); }); @@ -498,10 +499,11 @@ describe('Mat4', () => { describe('normalFromMat4', () => { beforeEach(() => { - matA = new Float64Array([1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1]); + matA = new Float64Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); result = Mat4.normalFromMat4(out, matA); }); @@ -516,10 +518,10 @@ describe('Mat4', () => { }); it('should give rotated matrix', () => expect(result).toBeVec( - 1, 0, 0, 0, - 0, 0, 1, 0, - 0,-1, 0, 0, - 0, 0, 0, 1 + 1, 0, 0, 0, + 0, 0, 1, 0, + 0, -1, 0, 0, + 0, 0, 0, 1 )); describe('and scale', () => { @@ -563,8 +565,8 @@ describe('Mat4', () => { describe('from a translation and rotation matrix', () => { beforeEach(() => { - let q = new Quat(); - let v = new Vec3(5, 6, 7); + const q = new Quat(); + const v = new Vec3(5, 6, 7); Quat.setAxisAngle(q, [0.26726124, 0.534522474, 0.8017837], 0.55); Mat4.fromRotationTranslation(out, q, v); @@ -590,8 +592,8 @@ describe('Mat4', () => { describe('from a scale-only matrix', () => { beforeEach(() => { - let v = new Vec3(4, 5, 6); - result = new Vec3(1, 2, 3) + const v = new Vec3(4, 5, 6); + result = new Vec3(1, 2, 3); out = new Vec3(1, 2, 3); Mat4.fromScaling(matA, v); result = Mat4.getScaling(out, matA); @@ -603,7 +605,7 @@ describe('Mat4', () => { describe('from a translation and rotation matrix', () => { beforeEach(() => { let q = Quat.create(); - let v = Vec3.fromValues(5, 6, 7); + const v = Vec3.fromValues(5, 6, 7); q = Quat.setAxisAngle(q, [1, 0, 0], 0.5) as Quat; Mat4.fromRotationTranslation(out, q, v); @@ -617,8 +619,8 @@ describe('Mat4', () => { describe('from a translation, rotation and scale matrix', () => { beforeEach(() => { let q = Quat.create(); - let t = Vec3.fromValues(1, 2, 3); - let s = Vec3.fromValues(5, 6, 7); + const t = Vec3.fromValues(1, 2, 3); + const s = Vec3.fromValues(5, 6, 7); q = Quat.setAxisAngle(q, [0, 1, 0], 0.7) as Quat; Mat4.fromRotationTranslationScale(out, q, t, s); result = Vec3.fromValues(5, 6, 7); @@ -639,7 +641,7 @@ describe('Mat4', () => { it('should place result both in result and out', () => expect(result).toBe(out)); it('should return the unit quaternion', () => { - let unitQuat = Quat.create(); + const unitQuat = Quat.create(); Quat.identity(unitQuat); expect(result).toBeVec(unitQuat); }); @@ -653,7 +655,7 @@ describe('Mat4', () => { }); it('should return the unit quaternion', () => { - let unitQuat = Quat.create(); + const unitQuat = Quat.create(); Quat.identity(unitQuat); expect(result).toBeVec(unitQuat); }); @@ -662,9 +664,9 @@ describe('Mat4', () => { describe('from a translation and rotation matrix', () => { it('should keep the same rotation as when created', () => { let q = Quat.create(); - let outVec = Vec3.fromValues(5, 6, 7); - let testVec = Vec3.fromValues(1, 5, 2); - let ang = 0.78972; + const outVec = Vec3.fromValues(5, 6, 7); + const testVec = Vec3.fromValues(1, 5, 2); + const ang = 0.78972; Vec3.normalize(testVec, testVec); q = Quat.setAxisAngle(q, testVec, ang) as Quat; @@ -672,8 +674,8 @@ describe('Mat4', () => { result = Quat.fromValues(2, 3, 4, 6); Mat4.getRotation(result, out); - let outaxis = Vec3.create(); - let outangle = Quat.getAxisAngle(outaxis, result); + const outaxis = Vec3.create(); + const outangle = Quat.getAxisAngle(outaxis, result); expect(outaxis).toBeVec(testVec); expect(outangle).toBeCloseTo(ang); @@ -732,7 +734,7 @@ describe('Mat4', () => { describe('perspectiveNO', () => { it('should have an alias called `perspective`', () => expect(Mat4.perspectiveNO).toEqual(Mat4.perspective)); - let fovy = Math.PI * 0.5; + const fovy = Math.PI * 0.5; beforeEach(() => { result = Mat4.perspectiveNO(out, fovy, 1, 0, 1); }); it('should place values into out', () => expect(result).toBeVec( @@ -744,7 +746,7 @@ describe('Mat4', () => { it('should return out', () => expect(result).toBe(out)); describe('with nonzero near, 45deg fovy, and realistic aspect ratio', () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, 200); }); + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640 / 480, 0.1, 200); }); it('should calculate correct matrix', () => expect(result).toBeVec( 1.81066, 0, 0, 0, @@ -755,7 +757,7 @@ describe('Mat4', () => { }); describe('with no far plane, 45deg fovy, and realistic aspect ratio', () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1); }); + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640 / 480, 0.1); }); it('should calculate correct matrix', () => expect(result).toBeVec( 1.81066, 0, 0, 0, @@ -766,7 +768,7 @@ describe('Mat4', () => { }); describe('with infinite far plane, 45deg fovy, and realistic aspect ratio', () => { - beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640/480, 0.1, Infinity); }); + beforeEach(() => { result = Mat4.perspectiveNO(out, 45 * Math.PI / 180.0, 640 / 480, 0.1, Infinity); }); it('should calculate correct matrix', () => expect(result).toBeVec( 1.81066, 0, 0, 0, @@ -791,10 +793,10 @@ describe('Mat4', () => { }); describe('lookAt', () => { - let eye = new Float64Array([0, 0, 1]); - let center = new Float64Array([0, 0, -1]); - let up = new Float64Array([0, 1, 0]); - let view, right; + let eye: FloatArray = new Float64Array([0, 0, 1]); + let center: FloatArray = new Float64Array([0, 0, -1]); + let up: FloatArray = new Float64Array([0, 1, 0]); + let view: FloatArray, right: FloatArray; beforeEach(() => { eye = new Float64Array([0, 0, 1]); @@ -805,9 +807,9 @@ describe('Mat4', () => { describe('looking down', () => { beforeEach(() => { - view = new Float64Array([0, -1, 0]); - up = new Float64Array([0, 0, -1]); - right= new Float64Array([1, 0, 0]); + view = new Float64Array([0, -1, 0]); + up = new Float64Array([0, 0, -1]); + right = new Float64Array([1, 0, 0]); result = Mat4.lookAt(out, [0, 0, 0], view, up); }); @@ -832,9 +834,9 @@ describe('Mat4', () => { describe('#74', () => { beforeEach(() => { Mat4.lookAt(out, - new Float64Array([0,2,0]), - new Float64Array([0,0.6,0]), - new Float64Array([0,0,-1])); + new Float64Array([0, 2, 0]), + new Float64Array([0, 0.6, 0]), + new Float64Array([0, 0, -1])); }); it('should transform a point `above` into local +Y', () => { @@ -863,10 +865,10 @@ describe('Mat4', () => { }); describe('targetTo', () => { - let eye = new Float64Array([0, 0, 1]); - let center = new Float64Array([0, 0, -1]); - let up = new Float64Array([0, 1, 0]); - let view: Float64Array, right: Float64Array; + let eye: FloatArray = new Float64Array([0, 0, 1]); + let center: FloatArray = new Float64Array([0, 0, -1]); + let up: FloatArray = new Float64Array([0, 1, 0]); + let view: FloatArray, right: FloatArray; beforeEach(() => { eye = new Float64Array([0, 0, 1]); @@ -877,9 +879,9 @@ describe('Mat4', () => { describe('looking down', () => { beforeEach(() => { - view = new Float64Array([0, -1, 0]); - up = new Float64Array([0, 0, -1]); - right= new Float64Array([1, 0, 0]); + view = new Float64Array([0, -1, 0]); + up = new Float64Array([0, 0, -1]); + right = new Float64Array([1, 0, 0]); result = Mat4.targetTo(out, [0, 0, 0], view, up); }); @@ -901,7 +903,7 @@ describe('Mat4', () => { it('should return out', () => expect(result).toBe(out)); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float64Array(3), out); + const scaling = Mat4.getScaling(new Float64Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -909,9 +911,9 @@ describe('Mat4', () => { describe('#74', () => { beforeEach(() => { Mat4.targetTo(out, - new Float64Array([0,2,0]), - new Float64Array([0,0.6,0]), - new Float64Array([0,0,-1])); + new Float64Array([0, 2, 0]), + new Float64Array([0, 0.6, 0]), + new Float64Array([0, 0, -1])); }); it('should transform a point `above` into local +Y', () => { @@ -930,7 +932,7 @@ describe('Mat4', () => { }); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float64Array(3), out); + const scaling = Mat4.getScaling(new Float64Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -938,13 +940,13 @@ describe('Mat4', () => { describe('scaling test', () => { beforeEach(() => { Mat4.targetTo(out, - new Float64Array([0,1,0]), - new Float64Array([0,0,1]), - new Float64Array([0,0,-1])); + new Float64Array([0, 1, 0]), + new Float64Array([0, 0, 1]), + new Float64Array([0, 0, -1])); }); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float64Array(3), out); + const scaling = Mat4.getScaling(new Float64Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -957,7 +959,7 @@ describe('Mat4', () => { )); it('should return out', () => expect(result).toBe(out)); it('scaling should be [1, 1, 1]', () => { - let scaling = Mat4.getScaling(new Float64Array(3), out); + const scaling = Mat4.getScaling(new Float64Array(3), out); expect(scaling).toBeVec(1, 1, 1); }); }); @@ -966,14 +968,14 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.str(matA); }); it('should return a string representation of the matrix', - () => expect(result).toEqual('Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)')); + () => expect(result).toEqual('Mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)')); }); describe('frob', () => { beforeEach(() => { result = Mat4.frob(matA); }); - it('should return the Frobenius Norm of the matrix', () => expect(result).toBeCloseTo( Math.sqrt(Math.pow(1, 2) + - Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) ))); + it('should return the Frobenius Norm of the matrix', () => expect(result).toBeCloseTo(Math.sqrt(Math.pow(1, 2) + + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2)))); }); describe('add', () => { @@ -986,28 +988,28 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.add(out, matA, matB); }); it('should place values into out', - () => expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + () => expect(out).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat4.add(matA, matA, matB); }); it('should place values into matA', - () => expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + () => expect(matA).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); it('should return matA', () => expect(result).toBe(matA)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matB is the output matrix', () => { beforeEach(() => { result = Mat4.add(matB, matA, matB); }); it('should place values into matB', - () => expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); + () => expect(matB).toBeVec(18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48)); it('should return matB', () => expect(result).toBe(matB)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); @@ -1025,28 +1027,28 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.subtract(out, matA, matB); }); it('should place values into out', - () => expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + () => expect(out).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat4.subtract(matA, matA, matB); }); it('should place values into matA', - () => expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + () => expect(matA).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); it('should return matA', () => expect(result).toBe(matA)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matB is the output matrix', () => { beforeEach(() => { result = Mat4.subtract(matB, matA, matB); }); it('should place values into matB', - () => expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); + () => expect(matB).toBeVec(-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16)); it('should return matB', () => expect(result).toBe(matB)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); @@ -1056,14 +1058,14 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); it('should return a 16 element array initialized to the values passed', - () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + () => expect(result).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); describe('set', () => { beforeEach(() => { result = Mat4.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); it('should place values into out', - () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); + () => expect(out).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should return out', () => expect(result).toBe(out)); }); @@ -1074,7 +1076,7 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.multiplyScalar(out, matA, 2); }); it('should place values into out', - () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + () => expect(out).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); @@ -1083,7 +1085,7 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.multiplyScalar(matA, matA, 2); }); it('should place values into matA', - () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); + () => expect(matA).toBeVec(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)); it('should return matA', () => expect(result).toBe(matA)); }); }); @@ -1098,35 +1100,35 @@ describe('Mat4', () => { beforeEach(() => { result = Mat4.multiplyScalarAndAdd(out, matA, matB, 0.5); }); it('should place values into out', - () => expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + () => expect(out).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); it('should return out', () => expect(result).toBe(out)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matA is the output matrix', () => { beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); it('should place values into matA', - () => expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + () => expect(matA).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); it('should return matA', () => expect(result).toBe(matA)); it('should not modify matB', - () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); + () => expect(matB).toBeVec(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)); }); describe('when matB is the output matrix', () => { beforeEach(() => { result = Mat4.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); it('should place values into matB', - () => expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); + () => expect(matB).toBeVec(9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32)); it('should return matB', () => expect(result).toBe(matB)); it('should not modify matA', () => expect(matA).toBeVec(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); }); }); describe('exactEquals', () => { - let matC, r0, r1; + let matC: Mat4Like, r0: boolean, r1: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; @@ -1143,7 +1145,7 @@ describe('Mat4', () => { }); describe('equals', () => { - let matC, matD, r0, r1, r2; + let matC: Mat4Like, matD: Mat4Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; diff --git a/tests/f64/Quat.spec.ts b/tests/f64/Quat.spec.ts index 5c0d0473..848293cd 100644 --- a/tests/f64/Quat.spec.ts +++ b/tests/f64/Quat.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Quat, Vec3 } from '#gl-matrix/f64'; -import type { Vec3Like, QuatLike } from '#gl-matrix/types'; +import type { Vec3Like, Vec4Like, QuatLike } from '#gl-matrix/types'; describe('Quat', () => { describe('constructor', () => { @@ -24,21 +24,21 @@ describe('Quat', () => { }); it('should return Quat(x, y, z, w) if called with (Quat(x, y, z, w))', () => { - let v = new Quat(3.4, 5.6, 7.8, 9); + const v = new Quat(3.4, 5.6, 7.8, 9); expect(new Quat(v)).toBeVec(v); }); it('should return Quat(x, y, z, w) if called with (Float64Array([x, y, z, w]))', () => { - let arr = new Float64Array([1.2, 3.4, 5.6, 7.8]); + const arr = new Float64Array([1.2, 3.4, 5.6, 7.8]); expect(new Quat(arr)).toBeVec(arr); }); }); describe('static', () => { - let out: Quat + let out: Quat; let quatA: QuatLike; let quatB: QuatLike; - let result: any; + let result: Vec4Like | number | string; let vec: Vec3Like; const id = new Quat(0, 0, 0, 1); @@ -68,11 +68,11 @@ describe('Quat', () => { describe('where theta == 180deg', () => { beforeEach(() => { - Quat.rotateX(quatA, [1,0,0,0], Math.PI); // 180 deg - result = Quat.slerp(out, [1,0,0,0], quatA, 1); + Quat.rotateX(quatA, [1, 0, 0, 0], Math.PI); // 180 deg + result = Quat.slerp(out, [1, 0, 0, 0], quatA, 1); }); - it('should calculate proper quat', () => expect(result).toBeVec(0,0,0,-1)); + it('should calculate proper quat', () => expect(result).toBeVec(0, 0, 0, -1)); }); describe('where a == -b', () => { @@ -99,7 +99,7 @@ describe('Quat', () => { }); it('should be the identity', () => expect(result).toBeVec(quatA)); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); describe('squared', () => { @@ -110,11 +110,11 @@ describe('Quat', () => { }); it('should be the square', () => { - let reference = Quat.multiply(Quat.create(), quatA, quatA); + const reference = Quat.multiply(Quat.create(), quatA, quatA); expect(result).toBeVec(reference); }); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); describe('conjugate', () => { @@ -125,23 +125,23 @@ describe('Quat', () => { }); it('should be the conjugate', () => { - let reference = Quat.conjugate(Quat.create(), quatA); + const reference = Quat.conjugate(Quat.create(), quatA); expect(result).toBeVec(reference); }); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); describe('reversible', () => { beforeEach(() => { Quat.normalize(quatA, quatA); - let b = 2.1; // random number + const b = 2.1; // random number result = Quat.pow(out, quatA, b); - result = Quat.pow(out, result, 1/b); + result = Quat.pow(out, result, 1 / b); }); it('should be reverted', () => expect(result).toBeVec(quatA)); - it('should be normalized', () => expect(Quat.length(result)).toBeCloseTo(1)); + it('should be normalized', () => expect(Quat.length(result as Vec4Like)).toBeCloseTo(1)); }); }); @@ -150,7 +150,7 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should transform vec accordingly', () => { - Vec3.transformQuat(vec, [0,0,-1], out); + Vec3.transformQuat(vec, [0, 0, -1], out); expect(vec).toBeVec(0, 1, 0); }); }); @@ -160,7 +160,7 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should transform vec accordingly', () => { - Vec3.transformQuat(vec, [0,0,-1], out); + Vec3.transformQuat(vec, [0, 0, -1], out); expect(vec).toBeVec(-1, 0, 0); }); }); @@ -170,12 +170,13 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should transform vec accordingly', () => { - Vec3.transformQuat(vec, [0,1,0], out); + Vec3.transformQuat(vec, [0, 1, 0], out); expect(vec).toBeVec(-1, 0, 0); }); }); - /*describe('fromMat3', () => { + /* + describe('fromMat3', () => { let matr; describe('legacy', () => { @@ -259,11 +260,12 @@ describe('Quat', () => { it('should return out', () => expect(result).toBe(out)); it('should produce the correct transformation', - () => expect(Vec3.transformQuat([0, 0, 0], [0,1,0], out)).toBeVec(0,0,-1)); + () => expect(Vec3.transformQuat([0, 0, 0], [0, 1, 0], out)).toBeVec(0, 0, -1)); }); }); - /*describe('setAxes', () => { + /* + describe('setAxes', () => { let r; beforeEach(() => { r = Vec3.create(); }); @@ -317,7 +319,7 @@ describe('Quat', () => { });*/ describe('rotationTo', () => { - let r; + let r: Vec3; beforeEach(() => { r = Vec3.create(); }); @@ -361,7 +363,7 @@ describe('Quat', () => { beforeEach(() => { result = Quat.create(); }); it('should return a 4 element array initialized to an identity quaternion', - () => expect(result).toBeVec(0, 0, 0, 1)); + () => expect(result).toBeVec(0, 0, 0, 1)); }); describe('clone', () => { @@ -411,7 +413,7 @@ describe('Quat', () => { beforeEach(() => { result = Quat.setAxisAngle(out, [0, 1, 0], 0.0); angle = Quat.getAxisAngle(vec, out); }); it('should return a multiple of 2*PI as the angle component', - () => expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0)); + () => expect(angle % (Math.PI * 2.0)).toBeCloseTo(0.0)); }); describe('for a simple rotation about X axis', () => { @@ -490,10 +492,10 @@ describe('Quat', () => { it('should be equalish', () => { // compute reference value as axisAngle of quatA^{-1} * quatB - let quatAInv = Quat.conjugate(Quat.create(), quatA); - let quatAB = Quat.multiply(quatAInv, quatAInv, quatB); - let dummy = Vec3.create(); - let reference = Quat.getAxisAngle(dummy, quatAB); + const quatAInv = Quat.conjugate(Quat.create(), quatA); + const quatAB = Quat.multiply(quatAInv, quatAInv, quatB); + const dummy = Vec3.create(); + const reference = Quat.getAxisAngle(dummy, quatAB); expect(Quat.getAngle(quatA, quatB)).toBeCloseTo(reference); }); @@ -660,7 +662,8 @@ describe('Quat', () => { }); }); - /*describe('random', () => { + /* + describe('random', () => { beforeEach(() => { result = Quat.random(out); }); it('should result in a normalized quaternion', () => { @@ -711,7 +714,7 @@ describe('Quat', () => { }); describe('exactEquals', () => { - let quatC, r0, r1; + let quatC: Vec4Like, r0: boolean, r1: boolean; beforeEach(() => { quatA = [0, 1, 2, 3]; @@ -728,7 +731,7 @@ describe('Quat', () => { }); describe('equals', () => { - let quatC, quatD, r0, r1, r2; + let quatC: Vec4Like, quatD: Vec4Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { quatA = [0, 1, 2, 3]; diff --git a/tests/f64/Quat2.spec.ts b/tests/f64/Quat2.spec.ts index a818af2c..3c01a056 100644 --- a/tests/f64/Quat2.spec.ts +++ b/tests/f64/Quat2.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Mat4, Quat, Quat2, Vec3 } from '#gl-matrix/f64'; -import type { QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types'; +import type { QuatLike, Quat2Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; describe('Quat2', () => { describe('constructor', () => { @@ -12,7 +12,8 @@ describe('Quat2', () => { it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (x, y, z, w, x2, y2, z2, w2)', () => { expect(new Quat2(1, 2, 3, 4, 5, 6, 7, 8)).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + expect(new Quat2(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15)).toBeVec( + -3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); }); it('should return Quat(x, x, x, x, x, x, x, x) if called with (x)', () => { @@ -22,18 +23,20 @@ describe('Quat2', () => { it('should return Quat(x, y, z, w) if called with ([x, y, z, w])', () => { expect(new Quat2([1, 2, 3, 4, 5, 6, 7, 8])).toBeVec(1, 2, 3, 4, 5, 6, 7, 8); - expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec(-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); + expect(new Quat2([-3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15])).toBeVec( + -3, 4.4, -5.6, 7.8, 9.0, -10.11, 12.13, -14.15); }); it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Quat(x, y, z, w, x2, y2, z2, w2))', () => { - let v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); + const v = new Quat2(1, 2, 3, 4, 5, 6, 7, 8); expect(new Quat2(v)).toBeVec(v); }); - it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float64Array([x, y, z, w, x2, y2, z2, w2]))', () => { - let arr = new Float64Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); - expect(new Quat2(arr)).toBeVec(arr); - }); + it('should return Quat(x, y, z, w, x2, y2, z2, w2) if called with (Float64Array([x, y, z, w, x2, y2, z2, w2]))', + () => { + const arr = new Float64Array([1.2, 3.4, 5.6, 7.8, 9.10, 11.12, 13.14, 15.16]); + expect(new Quat2(arr)).toBeVec(arr); + }); }); describe('static', () => { @@ -41,7 +44,7 @@ describe('Quat2', () => { let outVec: Vec3; let quat2A: Quat2Like; let quat2B: Quat2Like; - let result: any; + let result: Vec4Like | Quat2Like | number | string; let resultVec: Vec3Like; let outQuat: QuatLike; let vec: Vec3Like; @@ -56,11 +59,11 @@ describe('Quat2', () => { }); describe('translate', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]); Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -68,7 +71,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.translate(out, quat2A, vec); - //Same thing with a matrix + // Same thing with a matrix Mat4.translate(matOut, matrixA, vec); Quat2.fromMat4(quatOut, matOut); }); @@ -76,13 +79,13 @@ describe('Quat2', () => { it('should place values into out', () => expect(out).toBeQuat2(quatOut)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(quat2B)); - it('should not modify vec', () => expect(vec).toBeVec(1,1,-1)); + it('should not modify vec', () => expect(vec).toBeVec(1, 1, -1)); }); describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.translate(quat2A, quat2A, vec); - //Same thing with a matrix + // Same thing with a matrix Mat4.translate(matOut, matrixA, vec); Quat2.fromMat4(quatOut, matOut); }); @@ -93,13 +96,13 @@ describe('Quat2', () => { }); describe('rotateAroundAxis', () => { - let matrixA = new Mat4(); - let matOut = new Mat4(); - let ax: Vec3Like = [1,4,2]; + const matrixA = new Mat4(); + const matOut = new Mat4(); + const ax: Vec3Like = [1, 4, 2]; beforeEach(() => { - //quat2A only seems to work when created using this function? - Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + // quat2A only seems to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]); Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -108,7 +111,7 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.rotateAroundAxis(out, quat2A, ax, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotate(matOut, matrixA, 5, ax); Quat2.fromMat4(quat2B, matOut); }); @@ -125,7 +128,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateAroundAxis(quat2A, quat2A, ax, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotate(matOut, matrixA, 5, ax); Quat2.fromMat4(quat2B, matOut); @@ -138,8 +141,8 @@ describe('Quat2', () => { }); describe('rotateByQuatAppend', () => { - let correctResult = Quat2.create(); - let rotationQuat = Quat2.create(); + const correctResult = Quat2.create(); + const rotationQuat = Quat2.create(); beforeEach(() => { rotationQuat[0] = 2; @@ -155,7 +158,7 @@ describe('Quat2', () => { it('should place values into out', () => expect(out).toBeQuat2(correctResult)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); describe('when quat2A is the output quaternion', () => { @@ -163,13 +166,13 @@ describe('Quat2', () => { it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); it('should return quat2A', () => expect(result).toBe(quat2A)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); }); describe('rotateByQuatPrepend', () => { - let correctResult = Quat2.create(); - let rotationQuat = Quat2.create(); + const correctResult = Quat2.create(); + const rotationQuat = Quat2.create(); beforeEach(() => { rotationQuat[0] = 2; @@ -185,7 +188,7 @@ describe('Quat2', () => { it('should place values into out', () => expect(out).toBeQuat2(correctResult)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); describe('when quat2A is the output quaternion', () => { @@ -193,16 +196,16 @@ describe('Quat2', () => { it('should place values into quat2A', () => expect(quat2A).toBeQuat2(correctResult)); it('should return quat2A', () => expect(result).toBe(quat2A)); - it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2,5,2,-10,0,0,0,0)); + it('should not modify the rotation quaternion', () => expect(rotationQuat).toBeQuat2(2, 5, 2, -10, 0, 0, 0, 0)); }); }); describe('rotateX', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]) as Quat2; + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]) as Quat2; Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -210,7 +213,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.rotateX(out, quat2A, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateX(matOut, matrixA, 5); Quat2.fromMat4(quatOut, matOut); }); @@ -223,7 +226,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateX(quat2A, quat2A, 5); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateX(matOut, matrixA, 5); Quat2.fromMat4(quatOut, matOut); }); @@ -234,11 +237,11 @@ describe('Quat2', () => { }); describe('rotateY', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [5, 4, -10]) as Quat2; + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [5, 4, -10]) as Quat2; Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -246,7 +249,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.rotateY(out, quat2A, -2); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateY(matOut, matrixA, -2); Quat2.fromMat4(quatOut, matOut); }); @@ -259,7 +262,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateY(quat2A, quat2A, -2); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateY(matOut, matrixA, -2); Quat2.fromMat4(quatOut, matOut); }); @@ -270,11 +273,11 @@ describe('Quat2', () => { }); describe('rotateZ', () => { - let matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A only seems to work when created using this function? - quat2B = Quat2.fromRotationTranslation(quat2A, [1,0,3,-4], [0, -4, -10]) as Quat2; + // quat2A only seems to work when created using this function? + quat2B = Quat2.fromRotationTranslation(quat2A, [1, 0, 3, -4], [0, -4, -10]) as Quat2; Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); }); @@ -282,7 +285,7 @@ describe('Quat2', () => { describe('with a separate output quaternion', () => { beforeEach(() => { result = Quat2.rotateZ(out, quat2A, 1); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateZ(matOut, matrixA, 1); Quat2.fromMat4(quatOut, matOut); }); @@ -295,7 +298,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.rotateZ(quat2A, quat2A, 1); - //Same thing with a matrix + // Same thing with a matrix Mat4.rotateZ(matOut, matrixA, 1); Quat2.fromMat4(quatOut, matOut); }); @@ -306,14 +309,15 @@ describe('Quat2', () => { }); describe('from/toMat4', () => { - let matRes = Mat4.create(), matOut = Mat4.create(); - let rotationQuat = Quat.create(); + let matRes = Mat4.create(); + const matOut = Mat4.create(); + const rotationQuat = Quat.create(); describe('quat to matrix and back', () => { beforeEach(() => { - Quat.normalize(rotationQuat, [1,2,3,4]); + Quat.normalize(rotationQuat, [1, 2, 3, 4]); - Quat2.fromRotationTranslation(quat2A, rotationQuat, [1,-5,3]); + Quat2.fromRotationTranslation(quat2A, rotationQuat, [1, -5, 3]); matRes = Mat4.fromQuat2(matOut, quat2A) as Mat4; result = Quat2.fromMat4(out, matRes); @@ -322,8 +326,8 @@ describe('Quat2', () => { it('should return out', () => expect(result).toBe(out)); it('should return matOut', () => expect(matRes).toBe(matOut)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(0.18257418, 0.36514836, 0.54772257, 0.73029673, - -1.5518806, -1.82574184, 1.73445473, 0 )); - it('should be equal to the starting dual quat', () => expect(quat2A).toBeQuat2(result)); + -1.5518806, -1.82574184, 1.73445473, 0)); + it('should be equal to the starting dual quat', () => expect(quat2A).toBeQuat2(result as Quat2Like)); }); }); @@ -331,21 +335,21 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.create(); }); it('should return 2 4 element arrays initialized to an identity dual quaternion', - () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); + () => expect(result).toBeQuat2(0, 0, 0, 1, 0, 0, 0, 0)); }); describe('clone', () => { beforeEach(() => { result = Quat2.clone(quat2A); }); it('should return 2 4 element arrays initialized to the values in quat2A', - () => expect(result).toBeQuat2(quat2A)); + () => expect(result).toBeQuat2(quat2A)); }); describe('fromValues', () => { beforeEach(() => { result = Quat2.fromValues(1, 2, 3, 4, 5, 7, 8, -2); }); it('should return 2 4 element arrays initialized to the values passedd to the values passed', - () => expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2)); + () => expect(result).toBeQuat2(1, 2, 3, 4, 5, 7, 8, -2)); }); describe('copy', () => { @@ -411,7 +415,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.multiply(quat2A, quat2A, quat2B); }); - it('should place values into quat2A', () => expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157 )); + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(24, 48, 48, -6, 25, 89, 23, -157)); it('should return quat2A', () => expect(result).toBe(quat2A)); it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); }); @@ -425,12 +429,12 @@ describe('Quat2', () => { }); describe('same as matrix multiplication', () => { - let matrixA = Mat4.create(), matrixB = Mat4.create(); - let matOut = Mat4.create(), quatOut = Quat2.create(); + const matrixA = Mat4.create(), matrixB = Mat4.create(); + const matOut = Mat4.create(), quatOut = Quat2.create(); beforeEach(() => { - //quat2A and quat2B only seem to work when created using this function? - Quat2.fromRotationTranslation(quat2A, [1,2,3,4], [-5, 4, 10]); + // quat2A and quat2B only seem to work when created using this function? + Quat2.fromRotationTranslation(quat2A, [1, 2, 3, 4], [-5, 4, 10]); Quat2.normalize(quat2A, quat2A); Mat4.fromQuat2(matrixA, quat2A); @@ -440,7 +444,7 @@ describe('Quat2', () => { }); it('the matrices should be equal to the dual quaternions', () => { - let testQuat = Quat2.create(); + const testQuat = Quat2.create(); Quat2.fromMat4(testQuat, matrixA); expect(testQuat).toBeQuat2(...quat2A); @@ -515,7 +519,7 @@ describe('Quat2', () => { it('should not modify the quaternion', () => expect(Quat2.getReal(outQuat, quat2A)).toBeVec(1, 2, 3, 4)); it('should not modify the vector', () => expect(vec).toBeVec(1, 2, 3)); it('should have a translation that can be retrieved with getTranslation', () => { - let t: Vec3Like = [0, 0, 0]; + const t: Vec3Like = [0, 0, 0]; Quat2.normalize(out, out); Quat2.getTranslation(t, out); @@ -524,14 +528,14 @@ describe('Quat2', () => { }); describe('fromRotationTranslationValues', () => { - beforeEach(() => { result = Quat2.fromRotationTranslationValues(1,2,3,4, 1,2,3); }); + beforeEach(() => { result = Quat2.fromRotationTranslationValues(1, 2, 3, 4, 1, 2, 3); }); it('should return the correct result', () => expect(result).toBeQuat2(1, 2, 3, 4, 2, 4, 6, -7)); it('should have a translation that can be retrieved with getTranslation', () => { - let t: Vec3Like = [0, 0, 0]; + const t: Vec3Like = [0, 0, 0]; - Quat2.normalize(result, result); - Quat2.getTranslation(t, result); + Quat2.normalize(result as Quat2Like, result as Quat2Like); + Quat2.getTranslation(t, result as Quat2Like); expect(t).toBeVec(1, 2, 3); }); }); @@ -539,7 +543,7 @@ describe('Quat2', () => { describe('getTranslation', () => { describe('without a real part', () => { beforeEach(() => { - Quat2.fromTranslation(out, [1,2,3]); + Quat2.fromTranslation(out, [1, 2, 3]); resultVec = Quat2.getTranslation(outVec, out); }); @@ -584,8 +588,8 @@ describe('Quat2', () => { Quat2.normalize(out, quat2A); }); - it('both parts should have been normalized', () => expect(out).toBeQuat2(1/5.4772255, 2/5.4772255, - 3/5.4772255, 4/5.4772255, 0.231260, 0.6450954, 0.693781,-0.9006993)); + it('both parts should have been normalized', () => expect(out).toBeQuat2(1 / 5.4772255, 2 / 5.4772255, + 3 / 5.4772255, 4 / 5.4772255, 0.231260, 0.6450954, 0.693781, -0.9006993)); }); beforeEach(() => { quat2A = [5, 0, 0, 0, 0, 0, 0, 0]; }); @@ -628,7 +632,7 @@ describe('Quat2', () => { describe('when quat2A is the output quaternion', () => { beforeEach(() => { result = Quat2.lerp(quat2A, quat2A, quat2B, 0.5); }); - it('should place values into quat2A', () => expect(quat2A).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should place values into quat2A', () => expect(quat2A).toBeQuat2(3, 4, 5, 6, 5.5, 6.5, 6, -3)); it('should return quat2A', () => expect(result).toBe(quat2A)); it('should not modify quat2B', () => expect(quat2B).toBeQuat2(5, 6, 7, 8, 9, 8, 6, -4)); }); @@ -636,7 +640,7 @@ describe('Quat2', () => { describe('when quat2B is the output quaternion', () => { beforeEach(() => { result = Quat2.lerp(quat2B, quat2A, quat2B, 0.5); }); - it('should place values into quat2B', () => expect(quat2B).toBeQuat2(3, 4, 5, 6,5.5, 6.5, 6, -3)); + it('should place values into quat2B', () => expect(quat2B).toBeQuat2(3, 4, 5, 6, 5.5, 6.5, 6, -3)); it('should return quat2B', () => expect(result).toBe(quat2B)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); }); @@ -644,7 +648,7 @@ describe('Quat2', () => { describe('shortest path', () => { beforeEach(() => { result = Quat2.lerp(out, [1, 2, 3, -4, 2, 5, 6, -2], [5, -6, 7, 8, 9, 8, 6, -4], 0.4); }); - it('should pick the shorter path', () => expect(out).toBeQuat2( -1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4 )); + it('should pick the shorter path', () => expect(out).toBeQuat2(-1.4, 3.6, -1, -5.6, -2.4, -0.2, 1.2, 0.4)); }); }); @@ -663,7 +667,7 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.invert(out, quat2A); }); it('should place values into out', () => expect(out).toBeQuat2( - -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2 / 30, -5 / 30, -6 / 30, -2 / 30)); it('should return out', () => expect(result).toBe(out)); it('should not modify quat2A', () => expect(quat2A).toBeQuat2(1, 2, 3, 4, 2, 5, 6, -2)); it('the real part should be equal to a inverted quaternion', () => { @@ -676,7 +680,7 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.invert(quat2A, quat2A); }); it('should place values into quat2A', () => expect(quat2A).toBeVec( - -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2/30, -5/30, -6/30, -2/30)); + -0.0333333333, -0.06666666666, -0.1, 0.13333333333, -2 / 30, -5 / 30, -6 / 30, -2 / 30)); it('should return quat2A', () => expect(result).toBe(quat2A)); }); }); @@ -744,11 +748,11 @@ describe('Quat2', () => { beforeEach(() => { result = Quat2.str(quat2A); }); it('should return a string representation of the quaternion', - () => expect(result).toEqual('Quat2(1, 2, 3, 4, 2, 5, 6, -2)')); + () => expect(result).toEqual('Quat2(1, 2, 3, 4, 2, 5, 6, -2)')); }); describe('exactEquals', () => { - let quat2C, r0, r1; + let quat2C: Quat2Like, r0: boolean, r1: boolean; beforeEach(() => { quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; @@ -765,7 +769,7 @@ describe('Quat2', () => { }); describe('equals', () => { - let quat2C, quat2D, r0, r1, r2; + let quat2C: Quat2Like, quat2D: Quat2Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { quat2A = [0, 1, 2, 3, 4, 5, 6, 7]; diff --git a/tests/f64/Vec2-swizzle.spec.ts b/tests/f64/Vec2-swizzle.spec.ts index 34b810ea..428b15c2 100644 --- a/tests/f64/Vec2-swizzle.spec.ts +++ b/tests/f64/Vec2-swizzle.spec.ts @@ -16,506 +16,506 @@ describe('Vec2 Swizzles', () => { describe('Vec2().xx', () => { it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.xx; + const sw = v.xx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xy', () => { it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.xy; + const sw = v.xy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yx', () => { it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.yx; + const sw = v.yx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yy', () => { it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.yy; + const sw = v.yy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxx', () => { it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxx; + const sw = v.xxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxy', () => { it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxy; + const sw = v.xxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyx', () => { it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyx; + const sw = v.xyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyy', () => { it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyy; + const sw = v.xyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxx', () => { it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxx; + const sw = v.yxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxy', () => { it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxy; + const sw = v.yxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyx', () => { it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyx; + const sw = v.yyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyy', () => { it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyy; + const sw = v.yyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxxx', () => { it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxxx; + const sw = v.xxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxxy', () => { it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxxy; + const sw = v.xxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxyx', () => { it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xxyx; + const sw = v.xxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xxyy', () => { it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xxyy; + const sw = v.xxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyxx', () => { it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xyxx; + const sw = v.xyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyxy', () => { it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xyxy; + const sw = v.xyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyyx', () => { it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyyx; + const sw = v.xyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().xyyy', () => { it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyyy; + const sw = v.xyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxxx', () => { it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxxx; + const sw = v.yxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxxy', () => { it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxxy; + const sw = v.yxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxyx', () => { it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yxyx; + const sw = v.yxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yxyy', () => { it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yxyy; + const sw = v.yxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyxx', () => { it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yyxx; + const sw = v.yyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyxy', () => { it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yyxy; + const sw = v.yyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyyx', () => { it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyyx; + const sw = v.yyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().yyyy', () => { it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyyy; + const sw = v.yyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rr', () => { it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.rr; + const sw = v.rr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rg', () => { it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.rg; + const sw = v.rg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gr', () => { it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.gr; + const sw = v.gr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gg', () => { it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.gg; + const sw = v.gg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrr', () => { it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrr; + const sw = v.rrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrg', () => { it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrg; + const sw = v.rrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgr', () => { it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rgr; + const sw = v.rgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgg', () => { it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rgg; + const sw = v.rgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grr', () => { it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grr; + const sw = v.grr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grg', () => { it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grg; + const sw = v.grg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggr', () => { it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ggr; + const sw = v.ggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggg', () => { it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ggg; + const sw = v.ggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrrr', () => { it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrrr; + const sw = v.rrrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrrg', () => { it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrrg; + const sw = v.rrrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrgr', () => { it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rrgr; + const sw = v.rrgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rrgg', () => { it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rrgg; + const sw = v.rrgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgrr', () => { it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rgrr; + const sw = v.rgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rgrg', () => { it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rgrg; + const sw = v.rgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rggr', () => { it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rggr; + const sw = v.rggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().rggg', () => { it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rggg; + const sw = v.rggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grrr', () => { it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grrr; + const sw = v.grrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grrg', () => { it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grrg; + const sw = v.grrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grgr', () => { it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.grgr; + const sw = v.grgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().grgg', () => { it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.grgg; + const sw = v.grgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggrr', () => { it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ggrr; + const sw = v.ggrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().ggrg', () => { it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ggrg; + const sw = v.ggrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gggr', () => { it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gggr; + const sw = v.gggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec2().gggg', () => { it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gggg; + const sw = v.gggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + // [/Swizzle Autogen] }); diff --git a/tests/f64/Vec2.spec.ts b/tests/f64/Vec2.spec.ts index 11d4270d..9ae1dcaa 100644 --- a/tests/f64/Vec2.spec.ts +++ b/tests/f64/Vec2.spec.ts @@ -2,7 +2,7 @@ import { expect, describe, it, beforeEach } from 'vitest'; import { Vec2 } from '#gl-matrix/f64'; -import type { Vec2Like } from '#gl-matrix/types'; +import type { Mat2Like, Mat2dLike, Vec2Like, Vec3Like } from '#gl-matrix/types'; describe('Vec2', () => { let vecA: Vec2; @@ -34,12 +34,12 @@ describe('Vec2', () => { }); it('should return Vec2(x, y) if called with (Vec2(x, y))', () => { - let v = new Vec2(3.4, 5.6); + const v = new Vec2(3.4, 5.6); expect(new Vec2(v)).toBeVec(v); }); it('should return Vec2(x, y) if called with (Float64Array([x, y]))', () => { - let arr = new Float64Array([1.2, 3.4]); + const arr = new Float64Array([1.2, 3.4]); expect(new Vec2(arr)).toBeVec(arr); }); }); @@ -78,7 +78,7 @@ describe('Vec2', () => { }); describe('with raw array as the output', () => { - let outArray: Vec2Like = [0, 0]; + const outArray: Vec2Like = [0, 0]; beforeEach(() => { result = Vec2.add(outArray, vecA, vecB); }); it('should place values into out', () => expect(outArray).toBeVec(4, 6)); @@ -95,7 +95,7 @@ describe('Vec2', () => { }); describe('static', () => { - let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: any; + let out: Vec2Like, vecA: Vec2Like, vecB: Vec2Like, result: Vec2Like | number; beforeEach(() => { vecA = new Vec2(1, 2); @@ -457,7 +457,7 @@ describe('Vec2', () => { describe('with a separate output vector', () => { beforeEach(() => { result = Vec2.inverse(out, vecA); }); - it('should place values into out', () => expect(out).toBeVec(1, 1/2)); + it('should place values into out', () => expect(out).toBeVec(1, 1 / 2)); it('should return out', () => expect(result).toBe(out)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 2)); }); @@ -465,7 +465,7 @@ describe('Vec2', () => { describe('when vecA is the output vector', () => { beforeEach(() => { result = Vec2.inverse(vecA, vecA); }); - it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2)); + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1 / 2)); it('should return vecA', () => expect(result).toBe(vecA)); }); }); @@ -516,11 +516,11 @@ describe('Vec2', () => { }); describe('cross', () => { - let out3; + let out3: Vec3Like; beforeEach(() => { out3 = [0, 0, 0]; - result = Vec2.cross(out3, vecA, vecB); + result = Vec2.cross(out3 as unknown as Vec2Like, vecA, vecB); }); it('should place values into out', () => expect(out3).toBeVec(0, 0, -2)); @@ -556,7 +556,8 @@ describe('Vec2', () => { }); }); - /*describe('random', () => { + /* + describe('random', () => { describe('with no scale', () => { beforeEach(() => { result = Vec2.random(out); }); @@ -573,7 +574,7 @@ describe('Vec2', () => { });*/ describe('transformMat2', () => { - let matA; + let matA: Mat2Like; beforeEach(() => { matA = [1, 2, 3, 4]; }); @@ -596,7 +597,7 @@ describe('Vec2', () => { }); describe('transformMat2d', () => { - let matA; + let matA: Mat2dLike; beforeEach(() => { matA = [1, 2, 3, 4, 5, 6]; }); @@ -618,7 +619,8 @@ describe('Vec2', () => { }); }); - /*describe('forEach', () => { + /* + describe('forEach', () => { let vecArray; beforeEach(() => { @@ -736,8 +738,8 @@ describe('Vec2', () => { describe('angle', () => { beforeEach(() => { - vecA = [1,0]; - vecB = [1,2]; + vecA = [1, 0]; + vecB = [1, 2]; result = Vec2.angle(vecA, vecB); }); @@ -751,7 +753,7 @@ describe('Vec2', () => { }); describe('exactEquals', () => { - let vecC, r0, r1; + let vecC: Vec2Like, r0: boolean, r1: boolean; beforeEach(() => { vecA = [0, 1]; @@ -768,7 +770,7 @@ describe('Vec2', () => { }); describe('equals', () => { - let vecC, vecD, r0, r1, r2; + let vecC: Vec2Like, vecD: Vec2Like, r0: boolean, r1: boolean, r2: boolean; beforeEach(() => { vecA = [0, 1]; diff --git a/tests/f64/Vec3-swizzle.spec.ts b/tests/f64/Vec3-swizzle.spec.ts index e6b388a2..9c21af43 100644 --- a/tests/f64/Vec3-swizzle.spec.ts +++ b/tests/f64/Vec3-swizzle.spec.ts @@ -16,2108 +16,2108 @@ describe('Vec3 Swizzles', () => { describe('Vec3().xx', () => { it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.xx; + const sw = v.xx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xy', () => { it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.xy; + const sw = v.xy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xz', () => { it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.xz; + const sw = v.xz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yx', () => { it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.yx; + const sw = v.yx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yy', () => { it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.yy; + const sw = v.yy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yz', () => { it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.yz; + const sw = v.yz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zx', () => { it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.zx; + const sw = v.zx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zy', () => { it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.zy; + const sw = v.zy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zz', () => { it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.zz; + const sw = v.zz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxx', () => { it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxx; + const sw = v.xxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxy', () => { it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxy; + const sw = v.xxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxz', () => { it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxz; + const sw = v.xxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyx', () => { it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyx; + const sw = v.xyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyy', () => { it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyy; + const sw = v.xyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyz', () => { it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyz; + const sw = v.xyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzx', () => { it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzx; + const sw = v.xzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzy', () => { it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzy; + const sw = v.xzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzz', () => { it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzz; + const sw = v.xzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxx', () => { it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxx; + const sw = v.yxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxy', () => { it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxy; + const sw = v.yxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxz', () => { it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxz; + const sw = v.yxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyx', () => { it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyx; + const sw = v.yyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyy', () => { it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyy; + const sw = v.yyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyz', () => { it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyz; + const sw = v.yyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzx', () => { it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzx; + const sw = v.yzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzy', () => { it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzy; + const sw = v.yzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzz', () => { it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzz; + const sw = v.yzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxx', () => { it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxx; + const sw = v.zxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxy', () => { it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxy; + const sw = v.zxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxz', () => { it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxz; + const sw = v.zxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyx', () => { it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyx; + const sw = v.zyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyy', () => { it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyy; + const sw = v.zyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyz', () => { it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyz; + const sw = v.zyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzx', () => { it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzx; + const sw = v.zzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzy', () => { it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzy; + const sw = v.zzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzz', () => { it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzz; + const sw = v.zzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxxx', () => { it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxxx; + const sw = v.xxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxxy', () => { it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxxy; + const sw = v.xxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxxz', () => { it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxxz; + const sw = v.xxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxyx', () => { it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xxyx; + const sw = v.xxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxyy', () => { it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xxyy; + const sw = v.xxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxyz', () => { it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xxyz; + const sw = v.xxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxzx', () => { it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xxzx; + const sw = v.xxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxzy', () => { it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xxzy; + const sw = v.xxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xxzz', () => { it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xxzz; + const sw = v.xxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyxx', () => { it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xyxx; + const sw = v.xyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyxy', () => { it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xyxy; + const sw = v.xyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyxz', () => { it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xyxz; + const sw = v.xyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyyx', () => { it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyyx; + const sw = v.xyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyyy', () => { it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyyy; + const sw = v.xyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyyz', () => { it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyyz; + const sw = v.xyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyzx', () => { it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xyzx; + const sw = v.xyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyzy', () => { it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xyzy; + const sw = v.xyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xyzz', () => { it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xyzz; + const sw = v.xyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzxx', () => { it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xzxx; + const sw = v.xzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzxy', () => { it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xzxy; + const sw = v.xzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzxz', () => { it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xzxz; + const sw = v.xzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzyx', () => { it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xzyx; + const sw = v.xzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzyy', () => { it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xzyy; + const sw = v.xzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzyz', () => { it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xzyz; + const sw = v.xzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzzx', () => { it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzzx; + const sw = v.xzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzzy', () => { it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzzy; + const sw = v.xzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().xzzz', () => { it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzzz; + const sw = v.xzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxxx', () => { it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxxx; + const sw = v.yxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxxy', () => { it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxxy; + const sw = v.yxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxxz', () => { it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxxz; + const sw = v.yxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxyx', () => { it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yxyx; + const sw = v.yxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxyy', () => { it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yxyy; + const sw = v.yxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxyz', () => { it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yxyz; + const sw = v.yxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxzx', () => { it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yxzx; + const sw = v.yxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxzy', () => { it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yxzy; + const sw = v.yxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yxzz', () => { it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yxzz; + const sw = v.yxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyxx', () => { it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yyxx; + const sw = v.yyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyxy', () => { it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yyxy; + const sw = v.yyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyxz', () => { it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yyxz; + const sw = v.yyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyyx', () => { it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyyx; + const sw = v.yyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyyy', () => { it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyyy; + const sw = v.yyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyyz', () => { it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyyz; + const sw = v.yyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyzx', () => { it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yyzx; + const sw = v.yyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyzy', () => { it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yyzy; + const sw = v.yyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yyzz', () => { it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yyzz; + const sw = v.yyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzxx', () => { it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yzxx; + const sw = v.yzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzxy', () => { it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yzxy; + const sw = v.yzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzxz', () => { it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yzxz; + const sw = v.yzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzyx', () => { it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yzyx; + const sw = v.yzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzyy', () => { it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yzyy; + const sw = v.yzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzyz', () => { it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yzyz; + const sw = v.yzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzzx', () => { it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzzx; + const sw = v.yzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzzy', () => { it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzzy; + const sw = v.yzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().yzzz', () => { it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzzz; + const sw = v.yzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxxx', () => { it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxxx; + const sw = v.zxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxxy', () => { it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxxy; + const sw = v.zxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxxz', () => { it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxxz; + const sw = v.zxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxyx', () => { it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zxyx; + const sw = v.zxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxyy', () => { it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zxyy; + const sw = v.zxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxyz', () => { it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zxyz; + const sw = v.zxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxzx', () => { it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zxzx; + const sw = v.zxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxzy', () => { it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zxzy; + const sw = v.zxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zxzz', () => { it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zxzz; + const sw = v.zxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyxx', () => { it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zyxx; + const sw = v.zyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyxy', () => { it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zyxy; + const sw = v.zyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyxz', () => { it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zyxz; + const sw = v.zyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyyx', () => { it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyyx; + const sw = v.zyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyyy', () => { it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyyy; + const sw = v.zyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyyz', () => { it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyyz; + const sw = v.zyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyzx', () => { it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zyzx; + const sw = v.zyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyzy', () => { it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zyzy; + const sw = v.zyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zyzz', () => { it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zyzz; + const sw = v.zyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzxx', () => { it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zzxx; + const sw = v.zzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzxy', () => { it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zzxy; + const sw = v.zzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzxz', () => { it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zzxz; + const sw = v.zzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzyx', () => { it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zzyx; + const sw = v.zzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzyy', () => { it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zzyy; + const sw = v.zzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzyz', () => { it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zzyz; + const sw = v.zzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzzx', () => { it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzzx; + const sw = v.zzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzzy', () => { it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzzy; + const sw = v.zzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().zzzz', () => { it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzzz; + const sw = v.zzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rr', () => { it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.rr; + const sw = v.rr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rg', () => { it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.rg; + const sw = v.rg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rb', () => { it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.rb; + const sw = v.rb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gr', () => { it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.gr; + const sw = v.gr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gg', () => { it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.gg; + const sw = v.gg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gb', () => { it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.gb; + const sw = v.gb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().br', () => { it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.br; + const sw = v.br; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bg', () => { it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.bg; + const sw = v.bg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bb', () => { it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.bb; + const sw = v.bb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrr', () => { it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrr; + const sw = v.rrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrg', () => { it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrg; + const sw = v.rrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrb', () => { it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrb; + const sw = v.rrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgr', () => { it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rgr; + const sw = v.rgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgg', () => { it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rgg; + const sw = v.rgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgb', () => { it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rgb; + const sw = v.rgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbr', () => { it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbr; + const sw = v.rbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbg', () => { it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbg; + const sw = v.rbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbb', () => { it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbb; + const sw = v.rbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grr', () => { it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grr; + const sw = v.grr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grg', () => { it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grg; + const sw = v.grg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grb', () => { it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grb; + const sw = v.grb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggr', () => { it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ggr; + const sw = v.ggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggg', () => { it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ggg; + const sw = v.ggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggb', () => { it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ggb; + const sw = v.ggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbr', () => { it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbr; + const sw = v.gbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbg', () => { it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbg; + const sw = v.gbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbb', () => { it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbb; + const sw = v.gbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brr', () => { it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brr; + const sw = v.brr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brg', () => { it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brg; + const sw = v.brg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brb', () => { it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brb; + const sw = v.brb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgr', () => { it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bgr; + const sw = v.bgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgg', () => { it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bgg; + const sw = v.bgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgb', () => { it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bgb; + const sw = v.bgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbr', () => { it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbr; + const sw = v.bbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbg', () => { it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbg; + const sw = v.bbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbb', () => { it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbb; + const sw = v.bbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrrr', () => { it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrrr; + const sw = v.rrrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrrg', () => { it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrrg; + const sw = v.rrrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrrb', () => { it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrrb; + const sw = v.rrrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrgr', () => { it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rrgr; + const sw = v.rrgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrgg', () => { it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rrgg; + const sw = v.rrgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrgb', () => { it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rrgb; + const sw = v.rrgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrbr', () => { it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rrbr; + const sw = v.rrbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrbg', () => { it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rrbg; + const sw = v.rrbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rrbb', () => { it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rrbb; + const sw = v.rrbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgrr', () => { it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rgrr; + const sw = v.rgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgrg', () => { it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rgrg; + const sw = v.rgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgrb', () => { it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rgrb; + const sw = v.rgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rggr', () => { it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rggr; + const sw = v.rggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rggg', () => { it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rggg; + const sw = v.rggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rggb', () => { it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rggb; + const sw = v.rggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgbr', () => { it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rgbr; + const sw = v.rgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgbg', () => { it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rgbg; + const sw = v.rgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rgbb', () => { it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rgbb; + const sw = v.rgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbrr', () => { it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rbrr; + const sw = v.rbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbrg', () => { it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rbrg; + const sw = v.rbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbrb', () => { it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rbrb; + const sw = v.rbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbgr', () => { it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rbgr; + const sw = v.rbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbgg', () => { it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rbgg; + const sw = v.rbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbgb', () => { it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rbgb; + const sw = v.rbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbbr', () => { it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbbr; + const sw = v.rbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbbg', () => { it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbbg; + const sw = v.rbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().rbbb', () => { it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbbb; + const sw = v.rbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grrr', () => { it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grrr; + const sw = v.grrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grrg', () => { it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grrg; + const sw = v.grrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grrb', () => { it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grrb; + const sw = v.grrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grgr', () => { it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.grgr; + const sw = v.grgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grgg', () => { it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.grgg; + const sw = v.grgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grgb', () => { it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.grgb; + const sw = v.grgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grbr', () => { it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.grbr; + const sw = v.grbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grbg', () => { it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.grbg; + const sw = v.grbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().grbb', () => { it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.grbb; + const sw = v.grbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggrr', () => { it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ggrr; + const sw = v.ggrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggrg', () => { it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ggrg; + const sw = v.ggrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggrb', () => { it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.ggrb; + const sw = v.ggrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gggr', () => { it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gggr; + const sw = v.gggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gggg', () => { it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gggg; + const sw = v.gggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gggb', () => { it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gggb; + const sw = v.gggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggbr', () => { it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.ggbr; + const sw = v.ggbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggbg', () => { it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.ggbg; + const sw = v.ggbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().ggbb', () => { it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.ggbb; + const sw = v.ggbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbrr', () => { it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.gbrr; + const sw = v.gbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbrg', () => { it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.gbrg; + const sw = v.gbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbrb', () => { it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.gbrb; + const sw = v.gbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbgr', () => { it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gbgr; + const sw = v.gbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbgg', () => { it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gbgg; + const sw = v.gbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbgb', () => { it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gbgb; + const sw = v.gbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbbr', () => { it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbbr; + const sw = v.gbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbbg', () => { it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbbg; + const sw = v.gbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().gbbb', () => { it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbbb; + const sw = v.gbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brrr', () => { it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brrr; + const sw = v.brrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brrg', () => { it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brrg; + const sw = v.brrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brrb', () => { it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brrb; + const sw = v.brrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brgr', () => { it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.brgr; + const sw = v.brgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brgg', () => { it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.brgg; + const sw = v.brgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brgb', () => { it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.brgb; + const sw = v.brgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brbr', () => { it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.brbr; + const sw = v.brbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brbg', () => { it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.brbg; + const sw = v.brbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().brbb', () => { it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.brbb; + const sw = v.brbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgrr', () => { it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bgrr; + const sw = v.bgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgrg', () => { it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bgrg; + const sw = v.bgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgrb', () => { it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bgrb; + const sw = v.bgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bggr', () => { it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bggr; + const sw = v.bggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bggg', () => { it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bggg; + const sw = v.bggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bggb', () => { it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bggb; + const sw = v.bggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgbr', () => { it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bgbr; + const sw = v.bgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgbg', () => { it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bgbg; + const sw = v.bgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bgbb', () => { it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bgbb; + const sw = v.bgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbrr', () => { it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bbrr; + const sw = v.bbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbrg', () => { it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bbrg; + const sw = v.bbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbrb', () => { it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bbrb; + const sw = v.bbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbgr', () => { it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bbgr; + const sw = v.bbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbgg', () => { it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bbgg; + const sw = v.bbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbgb', () => { it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bbgb; + const sw = v.bbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbbr', () => { it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbbr; + const sw = v.bbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbbg', () => { it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbbg; + const sw = v.bbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec3().bbbb', () => { it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbbb; + const sw = v.bbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + // [/Swizzle Autogen] }); diff --git a/tests/f64/Vec3.spec.ts b/tests/f64/Vec3.spec.ts index f707da47..b5474f7f 100644 --- a/tests/f64/Vec3.spec.ts +++ b/tests/f64/Vec3.spec.ts @@ -24,12 +24,12 @@ describe('Vec3', () => { }); it('should return Vec3(x, y, z) if called with (Vec3(x, y, z))', () => { - let v = new Vec3(3.4, 5.6, 7.8); + const v = new Vec3(3.4, 5.6, 7.8); expect(new Vec3(v)).toBeVec(v); }); it('should return Vec3(x, y, z) if called with (Float64Array([x, y, z]))', () => { - let arr = new Float64Array([1.2, 3.4, 5.6]); + const arr = new Float64Array([1.2, 3.4, 5.6]); expect(new Vec3(arr)).toBeVec(arr); }); }); @@ -115,7 +115,7 @@ describe('Vec3', () => { describe('with an identity', () => { beforeEach(() => { - matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; + matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; result = Vec3.transformMat4(out, vecA, matr); }); @@ -129,23 +129,25 @@ describe('Vec3', () => { result = Vec3.transformMat4(out, vecA, matr); }); - it('should rotate and translate the input', () => expect(out).toBeVec( 4, -4, -4 )); + it('should rotate and translate the input', () => expect(out).toBeVec(4, -4, -4)); it('should return out', () => expect(result).toBe(out)); }); describe('with a perspective matrix (#92)', () => { it('should transform a point from perspective(pi/2, 4/3, 1, 100)', () => { - matr = [0.750, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, -1.02, -1, - 0, 0, -2.02, 0]; + matr = [ + 0.750, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1.02, -1, + 0, 0, -2.02, 0]; result = Vec3.transformMat4([0, 0, 0], [10, 20, 30], matr); expect(result).toBeVec(-0.25, -0.666666, 1.087333); }); }); }); - /*describe('transformMat3', () => { + /* + describe('transformMat3', () => { let matr; describe('with an identity', () => { @@ -193,11 +195,11 @@ describe('Vec3', () => { describe('transformQuat', () => { beforeEach(() => { result = Vec3.transformQuat(out, vecA, - [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); + [0.18257418567011074, 0.3651483713402215, 0.5477225570103322, 0.730296742680443]); }); it('should rotate the input vector', () => expect(out).toBeVec(1, 2, 3)); - it('should return out', () => expect(result).not.toBe([1,2,3,4])); + it('should return out', () => expect(result).not.toBe([1, 2, 3, 4])); }); describe('create', () => { @@ -442,7 +444,8 @@ describe('Vec3', () => { }); }); - /*describe('round', () => { + /* + describe('round', () => { beforeEach(() => { vecA = [Math.E, Math.PI, Math.SQRT2]; }); describe('with a separate output vector', () => { @@ -546,7 +549,7 @@ describe('Vec3', () => { describe('with a separate output vector', () => { beforeEach(() => { result = Vec3.inverse(out, vecA); }); - it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3)); + it('should place values into out', () => expect(out).toBeVec(1, 1 / 2, 1 / 3)); it('should return out', () => expect(result).toBe(out)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3)); }); @@ -554,7 +557,7 @@ describe('Vec3', () => { describe('when vecA is the output vector', () => { beforeEach(() => { result = Vec3.inverse(vecA, vecA); }); - it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3)); + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1 / 2, 1 / 3)); it('should return vecA', () => expect(result).toBe(vecA)); }); }); @@ -693,10 +696,10 @@ describe('Vec3', () => { describe('equals', () => { let vecC: Vec3Like, - vecD: Vec3Like, - r0: boolean, - r1: boolean, - r2: boolean; + vecD: Vec3Like, + r0: boolean, + r1: boolean, + r2: boolean; beforeEach(() => { vecA = [0, 1, 2]; diff --git a/tests/f64/Vec4-swizzle.spec.ts b/tests/f64/Vec4-swizzle.spec.ts index 94fac599..d989ac14 100644 --- a/tests/f64/Vec4-swizzle.spec.ts +++ b/tests/f64/Vec4-swizzle.spec.ts @@ -16,6050 +16,6050 @@ describe('Vec4 Swizzles', () => { describe('Vec4().xx', () => { it('should return Vec2(x, x)', () => expect(v.xx).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.xx; + const sw = v.xx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xy', () => { it('should return Vec2(x, y)', () => expect(v.xy).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.xy; + const sw = v.xy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xz', () => { it('should return Vec2(x, z)', () => expect(v.xz).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.xz; + const sw = v.xz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xw', () => { it('should return Vec2(x, w)', () => expect(v.xw).toBeVec(v[0], v[3])); it('should be return a copy', () => { - let sw = v.xw; + const sw = v.xw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yx', () => { it('should return Vec2(y, x)', () => expect(v.yx).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.yx; + const sw = v.yx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yy', () => { it('should return Vec2(y, y)', () => expect(v.yy).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.yy; + const sw = v.yy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yz', () => { it('should return Vec2(y, z)', () => expect(v.yz).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.yz; + const sw = v.yz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yw', () => { it('should return Vec2(y, w)', () => expect(v.yw).toBeVec(v[1], v[3])); it('should be return a copy', () => { - let sw = v.yw; + const sw = v.yw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zx', () => { it('should return Vec2(z, x)', () => expect(v.zx).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.zx; + const sw = v.zx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zy', () => { it('should return Vec2(z, y)', () => expect(v.zy).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.zy; + const sw = v.zy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zz', () => { it('should return Vec2(z, z)', () => expect(v.zz).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.zz; + const sw = v.zz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zw', () => { it('should return Vec2(z, w)', () => expect(v.zw).toBeVec(v[2], v[3])); it('should be return a copy', () => { - let sw = v.zw; + const sw = v.zw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wx', () => { it('should return Vec2(w, x)', () => expect(v.wx).toBeVec(v[3], v[0])); it('should be return a copy', () => { - let sw = v.wx; + const sw = v.wx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wy', () => { it('should return Vec2(w, y)', () => expect(v.wy).toBeVec(v[3], v[1])); it('should be return a copy', () => { - let sw = v.wy; + const sw = v.wy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wz', () => { it('should return Vec2(w, z)', () => expect(v.wz).toBeVec(v[3], v[2])); it('should be return a copy', () => { - let sw = v.wz; + const sw = v.wz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ww', () => { it('should return Vec2(w, w)', () => expect(v.ww).toBeVec(v[3], v[3])); it('should be return a copy', () => { - let sw = v.ww; + const sw = v.ww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxx', () => { it('should return Vec3(x, x, x)', () => expect(v.xxx).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxx; + const sw = v.xxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxy', () => { it('should return Vec3(x, x, y)', () => expect(v.xxy).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxy; + const sw = v.xxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxz', () => { it('should return Vec3(x, x, z)', () => expect(v.xxz).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxz; + const sw = v.xxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxw', () => { it('should return Vec3(x, x, w)', () => expect(v.xxw).toBeVec(v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xxw; + const sw = v.xxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyx', () => { it('should return Vec3(x, y, x)', () => expect(v.xyx).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyx; + const sw = v.xyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyy', () => { it('should return Vec3(x, y, y)', () => expect(v.xyy).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyy; + const sw = v.xyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyz', () => { it('should return Vec3(x, y, z)', () => expect(v.xyz).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyz; + const sw = v.xyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyw', () => { it('should return Vec3(x, y, w)', () => expect(v.xyw).toBeVec(v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xyw; + const sw = v.xyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzx', () => { it('should return Vec3(x, z, x)', () => expect(v.xzx).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzx; + const sw = v.xzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzy', () => { it('should return Vec3(x, z, y)', () => expect(v.xzy).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzy; + const sw = v.xzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzz', () => { it('should return Vec3(x, z, z)', () => expect(v.xzz).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzz; + const sw = v.xzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzw', () => { it('should return Vec3(x, z, w)', () => expect(v.xzw).toBeVec(v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xzw; + const sw = v.xzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwx', () => { it('should return Vec3(x, w, x)', () => expect(v.xwx).toBeVec(v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xwx; + const sw = v.xwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwy', () => { it('should return Vec3(x, w, y)', () => expect(v.xwy).toBeVec(v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xwy; + const sw = v.xwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwz', () => { it('should return Vec3(x, w, z)', () => expect(v.xwz).toBeVec(v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xwz; + const sw = v.xwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xww', () => { it('should return Vec3(x, w, w)', () => expect(v.xww).toBeVec(v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xww; + const sw = v.xww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxx', () => { it('should return Vec3(y, x, x)', () => expect(v.yxx).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxx; + const sw = v.yxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxy', () => { it('should return Vec3(y, x, y)', () => expect(v.yxy).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxy; + const sw = v.yxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxz', () => { it('should return Vec3(y, x, z)', () => expect(v.yxz).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxz; + const sw = v.yxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxw', () => { it('should return Vec3(y, x, w)', () => expect(v.yxw).toBeVec(v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yxw; + const sw = v.yxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyx', () => { it('should return Vec3(y, y, x)', () => expect(v.yyx).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyx; + const sw = v.yyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyy', () => { it('should return Vec3(y, y, y)', () => expect(v.yyy).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyy; + const sw = v.yyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyz', () => { it('should return Vec3(y, y, z)', () => expect(v.yyz).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyz; + const sw = v.yyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyw', () => { it('should return Vec3(y, y, w)', () => expect(v.yyw).toBeVec(v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yyw; + const sw = v.yyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzx', () => { it('should return Vec3(y, z, x)', () => expect(v.yzx).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzx; + const sw = v.yzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzy', () => { it('should return Vec3(y, z, y)', () => expect(v.yzy).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzy; + const sw = v.yzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzz', () => { it('should return Vec3(y, z, z)', () => expect(v.yzz).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzz; + const sw = v.yzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzw', () => { it('should return Vec3(y, z, w)', () => expect(v.yzw).toBeVec(v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yzw; + const sw = v.yzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywx', () => { it('should return Vec3(y, w, x)', () => expect(v.ywx).toBeVec(v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.ywx; + const sw = v.ywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywy', () => { it('should return Vec3(y, w, y)', () => expect(v.ywy).toBeVec(v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.ywy; + const sw = v.ywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywz', () => { it('should return Vec3(y, w, z)', () => expect(v.ywz).toBeVec(v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.ywz; + const sw = v.ywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yww', () => { it('should return Vec3(y, w, w)', () => expect(v.yww).toBeVec(v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yww; + const sw = v.yww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxx', () => { it('should return Vec3(z, x, x)', () => expect(v.zxx).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxx; + const sw = v.zxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxy', () => { it('should return Vec3(z, x, y)', () => expect(v.zxy).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxy; + const sw = v.zxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxz', () => { it('should return Vec3(z, x, z)', () => expect(v.zxz).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxz; + const sw = v.zxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxw', () => { it('should return Vec3(z, x, w)', () => expect(v.zxw).toBeVec(v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zxw; + const sw = v.zxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyx', () => { it('should return Vec3(z, y, x)', () => expect(v.zyx).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyx; + const sw = v.zyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyy', () => { it('should return Vec3(z, y, y)', () => expect(v.zyy).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyy; + const sw = v.zyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyz', () => { it('should return Vec3(z, y, z)', () => expect(v.zyz).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyz; + const sw = v.zyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyw', () => { it('should return Vec3(z, y, w)', () => expect(v.zyw).toBeVec(v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zyw; + const sw = v.zyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzx', () => { it('should return Vec3(z, z, x)', () => expect(v.zzx).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzx; + const sw = v.zzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzy', () => { it('should return Vec3(z, z, y)', () => expect(v.zzy).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzy; + const sw = v.zzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzz', () => { it('should return Vec3(z, z, z)', () => expect(v.zzz).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzz; + const sw = v.zzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzw', () => { it('should return Vec3(z, z, w)', () => expect(v.zzw).toBeVec(v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zzw; + const sw = v.zzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwx', () => { it('should return Vec3(z, w, x)', () => expect(v.zwx).toBeVec(v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zwx; + const sw = v.zwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwy', () => { it('should return Vec3(z, w, y)', () => expect(v.zwy).toBeVec(v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zwy; + const sw = v.zwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwz', () => { it('should return Vec3(z, w, z)', () => expect(v.zwz).toBeVec(v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zwz; + const sw = v.zwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zww', () => { it('should return Vec3(z, w, w)', () => expect(v.zww).toBeVec(v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zww; + const sw = v.zww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxx', () => { it('should return Vec3(w, x, x)', () => expect(v.wxx).toBeVec(v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wxx; + const sw = v.wxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxy', () => { it('should return Vec3(w, x, y)', () => expect(v.wxy).toBeVec(v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wxy; + const sw = v.wxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxz', () => { it('should return Vec3(w, x, z)', () => expect(v.wxz).toBeVec(v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wxz; + const sw = v.wxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxw', () => { it('should return Vec3(w, x, w)', () => expect(v.wxw).toBeVec(v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wxw; + const sw = v.wxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyx', () => { it('should return Vec3(w, y, x)', () => expect(v.wyx).toBeVec(v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wyx; + const sw = v.wyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyy', () => { it('should return Vec3(w, y, y)', () => expect(v.wyy).toBeVec(v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wyy; + const sw = v.wyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyz', () => { it('should return Vec3(w, y, z)', () => expect(v.wyz).toBeVec(v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wyz; + const sw = v.wyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyw', () => { it('should return Vec3(w, y, w)', () => expect(v.wyw).toBeVec(v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wyw; + const sw = v.wyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzx', () => { it('should return Vec3(w, z, x)', () => expect(v.wzx).toBeVec(v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wzx; + const sw = v.wzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzy', () => { it('should return Vec3(w, z, y)', () => expect(v.wzy).toBeVec(v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wzy; + const sw = v.wzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzz', () => { it('should return Vec3(w, z, z)', () => expect(v.wzz).toBeVec(v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wzz; + const sw = v.wzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzw', () => { it('should return Vec3(w, z, w)', () => expect(v.wzw).toBeVec(v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wzw; + const sw = v.wzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwx', () => { it('should return Vec3(w, w, x)', () => expect(v.wwx).toBeVec(v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wwx; + const sw = v.wwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwy', () => { it('should return Vec3(w, w, y)', () => expect(v.wwy).toBeVec(v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wwy; + const sw = v.wwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwz', () => { it('should return Vec3(w, w, z)', () => expect(v.wwz).toBeVec(v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wwz; + const sw = v.wwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().www', () => { it('should return Vec3(w, w, w)', () => expect(v.www).toBeVec(v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.www; + const sw = v.www; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxx', () => { it('should return Vec4(x, x, x, x)', () => expect(v.xxxx).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xxxx; + const sw = v.xxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxy', () => { it('should return Vec4(x, x, x, y)', () => expect(v.xxxy).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xxxy; + const sw = v.xxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxz', () => { it('should return Vec4(x, x, x, z)', () => expect(v.xxxz).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xxxz; + const sw = v.xxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxxw', () => { it('should return Vec4(x, x, x, w)', () => expect(v.xxxw).toBeVec(v[0], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xxxw; + const sw = v.xxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyx', () => { it('should return Vec4(x, x, y, x)', () => expect(v.xxyx).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xxyx; + const sw = v.xxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyy', () => { it('should return Vec4(x, x, y, y)', () => expect(v.xxyy).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xxyy; + const sw = v.xxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyz', () => { it('should return Vec4(x, x, y, z)', () => expect(v.xxyz).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xxyz; + const sw = v.xxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxyw', () => { it('should return Vec4(x, x, y, w)', () => expect(v.xxyw).toBeVec(v[0], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xxyw; + const sw = v.xxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzx', () => { it('should return Vec4(x, x, z, x)', () => expect(v.xxzx).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xxzx; + const sw = v.xxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzy', () => { it('should return Vec4(x, x, z, y)', () => expect(v.xxzy).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xxzy; + const sw = v.xxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzz', () => { it('should return Vec4(x, x, z, z)', () => expect(v.xxzz).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xxzz; + const sw = v.xxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxzw', () => { it('should return Vec4(x, x, z, w)', () => expect(v.xxzw).toBeVec(v[0], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xxzw; + const sw = v.xxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxwx', () => { it('should return Vec4(x, x, w, x)', () => expect(v.xxwx).toBeVec(v[0], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xxwx; + const sw = v.xxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxwy', () => { it('should return Vec4(x, x, w, y)', () => expect(v.xxwy).toBeVec(v[0], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xxwy; + const sw = v.xxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxwz', () => { it('should return Vec4(x, x, w, z)', () => expect(v.xxwz).toBeVec(v[0], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xxwz; + const sw = v.xxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xxww', () => { it('should return Vec4(x, x, w, w)', () => expect(v.xxww).toBeVec(v[0], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xxww; + const sw = v.xxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxx', () => { it('should return Vec4(x, y, x, x)', () => expect(v.xyxx).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xyxx; + const sw = v.xyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxy', () => { it('should return Vec4(x, y, x, y)', () => expect(v.xyxy).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xyxy; + const sw = v.xyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxz', () => { it('should return Vec4(x, y, x, z)', () => expect(v.xyxz).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xyxz; + const sw = v.xyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyxw', () => { it('should return Vec4(x, y, x, w)', () => expect(v.xyxw).toBeVec(v[0], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xyxw; + const sw = v.xyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyx', () => { it('should return Vec4(x, y, y, x)', () => expect(v.xyyx).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xyyx; + const sw = v.xyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyy', () => { it('should return Vec4(x, y, y, y)', () => expect(v.xyyy).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xyyy; + const sw = v.xyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyz', () => { it('should return Vec4(x, y, y, z)', () => expect(v.xyyz).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xyyz; + const sw = v.xyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyyw', () => { it('should return Vec4(x, y, y, w)', () => expect(v.xyyw).toBeVec(v[0], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xyyw; + const sw = v.xyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzx', () => { it('should return Vec4(x, y, z, x)', () => expect(v.xyzx).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xyzx; + const sw = v.xyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzy', () => { it('should return Vec4(x, y, z, y)', () => expect(v.xyzy).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xyzy; + const sw = v.xyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzz', () => { it('should return Vec4(x, y, z, z)', () => expect(v.xyzz).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xyzz; + const sw = v.xyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyzw', () => { it('should return Vec4(x, y, z, w)', () => expect(v.xyzw).toBeVec(v[0], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xyzw; + const sw = v.xyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xywx', () => { it('should return Vec4(x, y, w, x)', () => expect(v.xywx).toBeVec(v[0], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xywx; + const sw = v.xywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xywy', () => { it('should return Vec4(x, y, w, y)', () => expect(v.xywy).toBeVec(v[0], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xywy; + const sw = v.xywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xywz', () => { it('should return Vec4(x, y, w, z)', () => expect(v.xywz).toBeVec(v[0], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xywz; + const sw = v.xywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xyww', () => { it('should return Vec4(x, y, w, w)', () => expect(v.xyww).toBeVec(v[0], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xyww; + const sw = v.xyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxx', () => { it('should return Vec4(x, z, x, x)', () => expect(v.xzxx).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xzxx; + const sw = v.xzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxy', () => { it('should return Vec4(x, z, x, y)', () => expect(v.xzxy).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xzxy; + const sw = v.xzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxz', () => { it('should return Vec4(x, z, x, z)', () => expect(v.xzxz).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xzxz; + const sw = v.xzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzxw', () => { it('should return Vec4(x, z, x, w)', () => expect(v.xzxw).toBeVec(v[0], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xzxw; + const sw = v.xzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyx', () => { it('should return Vec4(x, z, y, x)', () => expect(v.xzyx).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xzyx; + const sw = v.xzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyy', () => { it('should return Vec4(x, z, y, y)', () => expect(v.xzyy).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xzyy; + const sw = v.xzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyz', () => { it('should return Vec4(x, z, y, z)', () => expect(v.xzyz).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xzyz; + const sw = v.xzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzyw', () => { it('should return Vec4(x, z, y, w)', () => expect(v.xzyw).toBeVec(v[0], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xzyw; + const sw = v.xzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzx', () => { it('should return Vec4(x, z, z, x)', () => expect(v.xzzx).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xzzx; + const sw = v.xzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzy', () => { it('should return Vec4(x, z, z, y)', () => expect(v.xzzy).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xzzy; + const sw = v.xzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzz', () => { it('should return Vec4(x, z, z, z)', () => expect(v.xzzz).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xzzz; + const sw = v.xzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzzw', () => { it('should return Vec4(x, z, z, w)', () => expect(v.xzzw).toBeVec(v[0], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xzzw; + const sw = v.xzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzwx', () => { it('should return Vec4(x, z, w, x)', () => expect(v.xzwx).toBeVec(v[0], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xzwx; + const sw = v.xzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzwy', () => { it('should return Vec4(x, z, w, y)', () => expect(v.xzwy).toBeVec(v[0], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xzwy; + const sw = v.xzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzwz', () => { it('should return Vec4(x, z, w, z)', () => expect(v.xzwz).toBeVec(v[0], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xzwz; + const sw = v.xzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xzww', () => { it('should return Vec4(x, z, w, w)', () => expect(v.xzww).toBeVec(v[0], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xzww; + const sw = v.xzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxx', () => { it('should return Vec4(x, w, x, x)', () => expect(v.xwxx).toBeVec(v[0], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.xwxx; + const sw = v.xwxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxy', () => { it('should return Vec4(x, w, x, y)', () => expect(v.xwxy).toBeVec(v[0], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.xwxy; + const sw = v.xwxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxz', () => { it('should return Vec4(x, w, x, z)', () => expect(v.xwxz).toBeVec(v[0], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.xwxz; + const sw = v.xwxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwxw', () => { it('should return Vec4(x, w, x, w)', () => expect(v.xwxw).toBeVec(v[0], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.xwxw; + const sw = v.xwxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyx', () => { it('should return Vec4(x, w, y, x)', () => expect(v.xwyx).toBeVec(v[0], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.xwyx; + const sw = v.xwyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyy', () => { it('should return Vec4(x, w, y, y)', () => expect(v.xwyy).toBeVec(v[0], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.xwyy; + const sw = v.xwyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyz', () => { it('should return Vec4(x, w, y, z)', () => expect(v.xwyz).toBeVec(v[0], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.xwyz; + const sw = v.xwyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwyw', () => { it('should return Vec4(x, w, y, w)', () => expect(v.xwyw).toBeVec(v[0], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.xwyw; + const sw = v.xwyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzx', () => { it('should return Vec4(x, w, z, x)', () => expect(v.xwzx).toBeVec(v[0], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.xwzx; + const sw = v.xwzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzy', () => { it('should return Vec4(x, w, z, y)', () => expect(v.xwzy).toBeVec(v[0], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.xwzy; + const sw = v.xwzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzz', () => { it('should return Vec4(x, w, z, z)', () => expect(v.xwzz).toBeVec(v[0], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.xwzz; + const sw = v.xwzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwzw', () => { it('should return Vec4(x, w, z, w)', () => expect(v.xwzw).toBeVec(v[0], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.xwzw; + const sw = v.xwzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwwx', () => { it('should return Vec4(x, w, w, x)', () => expect(v.xwwx).toBeVec(v[0], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.xwwx; + const sw = v.xwwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwwy', () => { it('should return Vec4(x, w, w, y)', () => expect(v.xwwy).toBeVec(v[0], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.xwwy; + const sw = v.xwwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwwz', () => { it('should return Vec4(x, w, w, z)', () => expect(v.xwwz).toBeVec(v[0], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.xwwz; + const sw = v.xwwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().xwww', () => { it('should return Vec4(x, w, w, w)', () => expect(v.xwww).toBeVec(v[0], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.xwww; + const sw = v.xwww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxx', () => { it('should return Vec4(y, x, x, x)', () => expect(v.yxxx).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yxxx; + const sw = v.yxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxy', () => { it('should return Vec4(y, x, x, y)', () => expect(v.yxxy).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yxxy; + const sw = v.yxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxz', () => { it('should return Vec4(y, x, x, z)', () => expect(v.yxxz).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yxxz; + const sw = v.yxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxxw', () => { it('should return Vec4(y, x, x, w)', () => expect(v.yxxw).toBeVec(v[1], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yxxw; + const sw = v.yxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyx', () => { it('should return Vec4(y, x, y, x)', () => expect(v.yxyx).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yxyx; + const sw = v.yxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyy', () => { it('should return Vec4(y, x, y, y)', () => expect(v.yxyy).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yxyy; + const sw = v.yxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyz', () => { it('should return Vec4(y, x, y, z)', () => expect(v.yxyz).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yxyz; + const sw = v.yxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxyw', () => { it('should return Vec4(y, x, y, w)', () => expect(v.yxyw).toBeVec(v[1], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yxyw; + const sw = v.yxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzx', () => { it('should return Vec4(y, x, z, x)', () => expect(v.yxzx).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yxzx; + const sw = v.yxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzy', () => { it('should return Vec4(y, x, z, y)', () => expect(v.yxzy).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yxzy; + const sw = v.yxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzz', () => { it('should return Vec4(y, x, z, z)', () => expect(v.yxzz).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yxzz; + const sw = v.yxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxzw', () => { it('should return Vec4(y, x, z, w)', () => expect(v.yxzw).toBeVec(v[1], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yxzw; + const sw = v.yxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxwx', () => { it('should return Vec4(y, x, w, x)', () => expect(v.yxwx).toBeVec(v[1], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.yxwx; + const sw = v.yxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxwy', () => { it('should return Vec4(y, x, w, y)', () => expect(v.yxwy).toBeVec(v[1], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.yxwy; + const sw = v.yxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxwz', () => { it('should return Vec4(y, x, w, z)', () => expect(v.yxwz).toBeVec(v[1], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.yxwz; + const sw = v.yxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yxww', () => { it('should return Vec4(y, x, w, w)', () => expect(v.yxww).toBeVec(v[1], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yxww; + const sw = v.yxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxx', () => { it('should return Vec4(y, y, x, x)', () => expect(v.yyxx).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yyxx; + const sw = v.yyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxy', () => { it('should return Vec4(y, y, x, y)', () => expect(v.yyxy).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yyxy; + const sw = v.yyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxz', () => { it('should return Vec4(y, y, x, z)', () => expect(v.yyxz).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yyxz; + const sw = v.yyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyxw', () => { it('should return Vec4(y, y, x, w)', () => expect(v.yyxw).toBeVec(v[1], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yyxw; + const sw = v.yyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyx', () => { it('should return Vec4(y, y, y, x)', () => expect(v.yyyx).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yyyx; + const sw = v.yyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyy', () => { it('should return Vec4(y, y, y, y)', () => expect(v.yyyy).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yyyy; + const sw = v.yyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyz', () => { it('should return Vec4(y, y, y, z)', () => expect(v.yyyz).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yyyz; + const sw = v.yyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyyw', () => { it('should return Vec4(y, y, y, w)', () => expect(v.yyyw).toBeVec(v[1], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yyyw; + const sw = v.yyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzx', () => { it('should return Vec4(y, y, z, x)', () => expect(v.yyzx).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yyzx; + const sw = v.yyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzy', () => { it('should return Vec4(y, y, z, y)', () => expect(v.yyzy).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yyzy; + const sw = v.yyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzz', () => { it('should return Vec4(y, y, z, z)', () => expect(v.yyzz).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yyzz; + const sw = v.yyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyzw', () => { it('should return Vec4(y, y, z, w)', () => expect(v.yyzw).toBeVec(v[1], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yyzw; + const sw = v.yyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yywx', () => { it('should return Vec4(y, y, w, x)', () => expect(v.yywx).toBeVec(v[1], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.yywx; + const sw = v.yywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yywy', () => { it('should return Vec4(y, y, w, y)', () => expect(v.yywy).toBeVec(v[1], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.yywy; + const sw = v.yywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yywz', () => { it('should return Vec4(y, y, w, z)', () => expect(v.yywz).toBeVec(v[1], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.yywz; + const sw = v.yywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yyww', () => { it('should return Vec4(y, y, w, w)', () => expect(v.yyww).toBeVec(v[1], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yyww; + const sw = v.yyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxx', () => { it('should return Vec4(y, z, x, x)', () => expect(v.yzxx).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.yzxx; + const sw = v.yzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxy', () => { it('should return Vec4(y, z, x, y)', () => expect(v.yzxy).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.yzxy; + const sw = v.yzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxz', () => { it('should return Vec4(y, z, x, z)', () => expect(v.yzxz).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.yzxz; + const sw = v.yzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzxw', () => { it('should return Vec4(y, z, x, w)', () => expect(v.yzxw).toBeVec(v[1], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.yzxw; + const sw = v.yzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyx', () => { it('should return Vec4(y, z, y, x)', () => expect(v.yzyx).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.yzyx; + const sw = v.yzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyy', () => { it('should return Vec4(y, z, y, y)', () => expect(v.yzyy).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.yzyy; + const sw = v.yzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyz', () => { it('should return Vec4(y, z, y, z)', () => expect(v.yzyz).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.yzyz; + const sw = v.yzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzyw', () => { it('should return Vec4(y, z, y, w)', () => expect(v.yzyw).toBeVec(v[1], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.yzyw; + const sw = v.yzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzx', () => { it('should return Vec4(y, z, z, x)', () => expect(v.yzzx).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.yzzx; + const sw = v.yzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzy', () => { it('should return Vec4(y, z, z, y)', () => expect(v.yzzy).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.yzzy; + const sw = v.yzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzz', () => { it('should return Vec4(y, z, z, z)', () => expect(v.yzzz).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.yzzz; + const sw = v.yzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzzw', () => { it('should return Vec4(y, z, z, w)', () => expect(v.yzzw).toBeVec(v[1], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.yzzw; + const sw = v.yzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzwx', () => { it('should return Vec4(y, z, w, x)', () => expect(v.yzwx).toBeVec(v[1], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.yzwx; + const sw = v.yzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzwy', () => { it('should return Vec4(y, z, w, y)', () => expect(v.yzwy).toBeVec(v[1], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.yzwy; + const sw = v.yzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzwz', () => { it('should return Vec4(y, z, w, z)', () => expect(v.yzwz).toBeVec(v[1], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.yzwz; + const sw = v.yzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().yzww', () => { it('should return Vec4(y, z, w, w)', () => expect(v.yzww).toBeVec(v[1], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.yzww; + const sw = v.yzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxx', () => { it('should return Vec4(y, w, x, x)', () => expect(v.ywxx).toBeVec(v[1], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ywxx; + const sw = v.ywxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxy', () => { it('should return Vec4(y, w, x, y)', () => expect(v.ywxy).toBeVec(v[1], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ywxy; + const sw = v.ywxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxz', () => { it('should return Vec4(y, w, x, z)', () => expect(v.ywxz).toBeVec(v[1], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.ywxz; + const sw = v.ywxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywxw', () => { it('should return Vec4(y, w, x, w)', () => expect(v.ywxw).toBeVec(v[1], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.ywxw; + const sw = v.ywxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyx', () => { it('should return Vec4(y, w, y, x)', () => expect(v.ywyx).toBeVec(v[1], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ywyx; + const sw = v.ywyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyy', () => { it('should return Vec4(y, w, y, y)', () => expect(v.ywyy).toBeVec(v[1], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ywyy; + const sw = v.ywyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyz', () => { it('should return Vec4(y, w, y, z)', () => expect(v.ywyz).toBeVec(v[1], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ywyz; + const sw = v.ywyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywyw', () => { it('should return Vec4(y, w, y, w)', () => expect(v.ywyw).toBeVec(v[1], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.ywyw; + const sw = v.ywyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzx', () => { it('should return Vec4(y, w, z, x)', () => expect(v.ywzx).toBeVec(v[1], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.ywzx; + const sw = v.ywzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzy', () => { it('should return Vec4(y, w, z, y)', () => expect(v.ywzy).toBeVec(v[1], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.ywzy; + const sw = v.ywzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzz', () => { it('should return Vec4(y, w, z, z)', () => expect(v.ywzz).toBeVec(v[1], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.ywzz; + const sw = v.ywzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywzw', () => { it('should return Vec4(y, w, z, w)', () => expect(v.ywzw).toBeVec(v[1], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.ywzw; + const sw = v.ywzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywwx', () => { it('should return Vec4(y, w, w, x)', () => expect(v.ywwx).toBeVec(v[1], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.ywwx; + const sw = v.ywwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywwy', () => { it('should return Vec4(y, w, w, y)', () => expect(v.ywwy).toBeVec(v[1], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.ywwy; + const sw = v.ywwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywwz', () => { it('should return Vec4(y, w, w, z)', () => expect(v.ywwz).toBeVec(v[1], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.ywwz; + const sw = v.ywwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ywww', () => { it('should return Vec4(y, w, w, w)', () => expect(v.ywww).toBeVec(v[1], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.ywww; + const sw = v.ywww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxx', () => { it('should return Vec4(z, x, x, x)', () => expect(v.zxxx).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zxxx; + const sw = v.zxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxy', () => { it('should return Vec4(z, x, x, y)', () => expect(v.zxxy).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zxxy; + const sw = v.zxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxz', () => { it('should return Vec4(z, x, x, z)', () => expect(v.zxxz).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zxxz; + const sw = v.zxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxxw', () => { it('should return Vec4(z, x, x, w)', () => expect(v.zxxw).toBeVec(v[2], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zxxw; + const sw = v.zxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyx', () => { it('should return Vec4(z, x, y, x)', () => expect(v.zxyx).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zxyx; + const sw = v.zxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyy', () => { it('should return Vec4(z, x, y, y)', () => expect(v.zxyy).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zxyy; + const sw = v.zxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyz', () => { it('should return Vec4(z, x, y, z)', () => expect(v.zxyz).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zxyz; + const sw = v.zxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxyw', () => { it('should return Vec4(z, x, y, w)', () => expect(v.zxyw).toBeVec(v[2], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zxyw; + const sw = v.zxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzx', () => { it('should return Vec4(z, x, z, x)', () => expect(v.zxzx).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zxzx; + const sw = v.zxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzy', () => { it('should return Vec4(z, x, z, y)', () => expect(v.zxzy).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zxzy; + const sw = v.zxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzz', () => { it('should return Vec4(z, x, z, z)', () => expect(v.zxzz).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zxzz; + const sw = v.zxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxzw', () => { it('should return Vec4(z, x, z, w)', () => expect(v.zxzw).toBeVec(v[2], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zxzw; + const sw = v.zxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxwx', () => { it('should return Vec4(z, x, w, x)', () => expect(v.zxwx).toBeVec(v[2], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zxwx; + const sw = v.zxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxwy', () => { it('should return Vec4(z, x, w, y)', () => expect(v.zxwy).toBeVec(v[2], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zxwy; + const sw = v.zxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxwz', () => { it('should return Vec4(z, x, w, z)', () => expect(v.zxwz).toBeVec(v[2], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zxwz; + const sw = v.zxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zxww', () => { it('should return Vec4(z, x, w, w)', () => expect(v.zxww).toBeVec(v[2], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zxww; + const sw = v.zxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxx', () => { it('should return Vec4(z, y, x, x)', () => expect(v.zyxx).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zyxx; + const sw = v.zyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxy', () => { it('should return Vec4(z, y, x, y)', () => expect(v.zyxy).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zyxy; + const sw = v.zyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxz', () => { it('should return Vec4(z, y, x, z)', () => expect(v.zyxz).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zyxz; + const sw = v.zyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyxw', () => { it('should return Vec4(z, y, x, w)', () => expect(v.zyxw).toBeVec(v[2], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zyxw; + const sw = v.zyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyx', () => { it('should return Vec4(z, y, y, x)', () => expect(v.zyyx).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zyyx; + const sw = v.zyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyy', () => { it('should return Vec4(z, y, y, y)', () => expect(v.zyyy).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zyyy; + const sw = v.zyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyz', () => { it('should return Vec4(z, y, y, z)', () => expect(v.zyyz).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zyyz; + const sw = v.zyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyyw', () => { it('should return Vec4(z, y, y, w)', () => expect(v.zyyw).toBeVec(v[2], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zyyw; + const sw = v.zyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzx', () => { it('should return Vec4(z, y, z, x)', () => expect(v.zyzx).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zyzx; + const sw = v.zyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzy', () => { it('should return Vec4(z, y, z, y)', () => expect(v.zyzy).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zyzy; + const sw = v.zyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzz', () => { it('should return Vec4(z, y, z, z)', () => expect(v.zyzz).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zyzz; + const sw = v.zyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyzw', () => { it('should return Vec4(z, y, z, w)', () => expect(v.zyzw).toBeVec(v[2], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zyzw; + const sw = v.zyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zywx', () => { it('should return Vec4(z, y, w, x)', () => expect(v.zywx).toBeVec(v[2], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zywx; + const sw = v.zywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zywy', () => { it('should return Vec4(z, y, w, y)', () => expect(v.zywy).toBeVec(v[2], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zywy; + const sw = v.zywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zywz', () => { it('should return Vec4(z, y, w, z)', () => expect(v.zywz).toBeVec(v[2], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zywz; + const sw = v.zywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zyww', () => { it('should return Vec4(z, y, w, w)', () => expect(v.zyww).toBeVec(v[2], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zyww; + const sw = v.zyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxx', () => { it('should return Vec4(z, z, x, x)', () => expect(v.zzxx).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zzxx; + const sw = v.zzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxy', () => { it('should return Vec4(z, z, x, y)', () => expect(v.zzxy).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zzxy; + const sw = v.zzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxz', () => { it('should return Vec4(z, z, x, z)', () => expect(v.zzxz).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zzxz; + const sw = v.zzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzxw', () => { it('should return Vec4(z, z, x, w)', () => expect(v.zzxw).toBeVec(v[2], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zzxw; + const sw = v.zzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyx', () => { it('should return Vec4(z, z, y, x)', () => expect(v.zzyx).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zzyx; + const sw = v.zzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyy', () => { it('should return Vec4(z, z, y, y)', () => expect(v.zzyy).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zzyy; + const sw = v.zzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyz', () => { it('should return Vec4(z, z, y, z)', () => expect(v.zzyz).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zzyz; + const sw = v.zzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzyw', () => { it('should return Vec4(z, z, y, w)', () => expect(v.zzyw).toBeVec(v[2], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zzyw; + const sw = v.zzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzx', () => { it('should return Vec4(z, z, z, x)', () => expect(v.zzzx).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zzzx; + const sw = v.zzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzy', () => { it('should return Vec4(z, z, z, y)', () => expect(v.zzzy).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zzzy; + const sw = v.zzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzz', () => { it('should return Vec4(z, z, z, z)', () => expect(v.zzzz).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zzzz; + const sw = v.zzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzzw', () => { it('should return Vec4(z, z, z, w)', () => expect(v.zzzw).toBeVec(v[2], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zzzw; + const sw = v.zzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzwx', () => { it('should return Vec4(z, z, w, x)', () => expect(v.zzwx).toBeVec(v[2], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zzwx; + const sw = v.zzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzwy', () => { it('should return Vec4(z, z, w, y)', () => expect(v.zzwy).toBeVec(v[2], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zzwy; + const sw = v.zzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzwz', () => { it('should return Vec4(z, z, w, z)', () => expect(v.zzwz).toBeVec(v[2], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zzwz; + const sw = v.zzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zzww', () => { it('should return Vec4(z, z, w, w)', () => expect(v.zzww).toBeVec(v[2], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zzww; + const sw = v.zzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxx', () => { it('should return Vec4(z, w, x, x)', () => expect(v.zwxx).toBeVec(v[2], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.zwxx; + const sw = v.zwxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxy', () => { it('should return Vec4(z, w, x, y)', () => expect(v.zwxy).toBeVec(v[2], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.zwxy; + const sw = v.zwxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxz', () => { it('should return Vec4(z, w, x, z)', () => expect(v.zwxz).toBeVec(v[2], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.zwxz; + const sw = v.zwxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwxw', () => { it('should return Vec4(z, w, x, w)', () => expect(v.zwxw).toBeVec(v[2], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.zwxw; + const sw = v.zwxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyx', () => { it('should return Vec4(z, w, y, x)', () => expect(v.zwyx).toBeVec(v[2], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.zwyx; + const sw = v.zwyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyy', () => { it('should return Vec4(z, w, y, y)', () => expect(v.zwyy).toBeVec(v[2], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.zwyy; + const sw = v.zwyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyz', () => { it('should return Vec4(z, w, y, z)', () => expect(v.zwyz).toBeVec(v[2], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.zwyz; + const sw = v.zwyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwyw', () => { it('should return Vec4(z, w, y, w)', () => expect(v.zwyw).toBeVec(v[2], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.zwyw; + const sw = v.zwyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzx', () => { it('should return Vec4(z, w, z, x)', () => expect(v.zwzx).toBeVec(v[2], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.zwzx; + const sw = v.zwzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzy', () => { it('should return Vec4(z, w, z, y)', () => expect(v.zwzy).toBeVec(v[2], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.zwzy; + const sw = v.zwzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzz', () => { it('should return Vec4(z, w, z, z)', () => expect(v.zwzz).toBeVec(v[2], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.zwzz; + const sw = v.zwzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwzw', () => { it('should return Vec4(z, w, z, w)', () => expect(v.zwzw).toBeVec(v[2], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.zwzw; + const sw = v.zwzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwwx', () => { it('should return Vec4(z, w, w, x)', () => expect(v.zwwx).toBeVec(v[2], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.zwwx; + const sw = v.zwwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwwy', () => { it('should return Vec4(z, w, w, y)', () => expect(v.zwwy).toBeVec(v[2], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.zwwy; + const sw = v.zwwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwwz', () => { it('should return Vec4(z, w, w, z)', () => expect(v.zwwz).toBeVec(v[2], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.zwwz; + const sw = v.zwwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().zwww', () => { it('should return Vec4(z, w, w, w)', () => expect(v.zwww).toBeVec(v[2], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.zwww; + const sw = v.zwww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxx', () => { it('should return Vec4(w, x, x, x)', () => expect(v.wxxx).toBeVec(v[3], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wxxx; + const sw = v.wxxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxy', () => { it('should return Vec4(w, x, x, y)', () => expect(v.wxxy).toBeVec(v[3], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wxxy; + const sw = v.wxxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxz', () => { it('should return Vec4(w, x, x, z)', () => expect(v.wxxz).toBeVec(v[3], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wxxz; + const sw = v.wxxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxxw', () => { it('should return Vec4(w, x, x, w)', () => expect(v.wxxw).toBeVec(v[3], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wxxw; + const sw = v.wxxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyx', () => { it('should return Vec4(w, x, y, x)', () => expect(v.wxyx).toBeVec(v[3], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wxyx; + const sw = v.wxyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyy', () => { it('should return Vec4(w, x, y, y)', () => expect(v.wxyy).toBeVec(v[3], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wxyy; + const sw = v.wxyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyz', () => { it('should return Vec4(w, x, y, z)', () => expect(v.wxyz).toBeVec(v[3], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wxyz; + const sw = v.wxyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxyw', () => { it('should return Vec4(w, x, y, w)', () => expect(v.wxyw).toBeVec(v[3], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wxyw; + const sw = v.wxyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzx', () => { it('should return Vec4(w, x, z, x)', () => expect(v.wxzx).toBeVec(v[3], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wxzx; + const sw = v.wxzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzy', () => { it('should return Vec4(w, x, z, y)', () => expect(v.wxzy).toBeVec(v[3], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wxzy; + const sw = v.wxzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzz', () => { it('should return Vec4(w, x, z, z)', () => expect(v.wxzz).toBeVec(v[3], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wxzz; + const sw = v.wxzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxzw', () => { it('should return Vec4(w, x, z, w)', () => expect(v.wxzw).toBeVec(v[3], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wxzw; + const sw = v.wxzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxwx', () => { it('should return Vec4(w, x, w, x)', () => expect(v.wxwx).toBeVec(v[3], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wxwx; + const sw = v.wxwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxwy', () => { it('should return Vec4(w, x, w, y)', () => expect(v.wxwy).toBeVec(v[3], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wxwy; + const sw = v.wxwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxwz', () => { it('should return Vec4(w, x, w, z)', () => expect(v.wxwz).toBeVec(v[3], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wxwz; + const sw = v.wxwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wxww', () => { it('should return Vec4(w, x, w, w)', () => expect(v.wxww).toBeVec(v[3], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wxww; + const sw = v.wxww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxx', () => { it('should return Vec4(w, y, x, x)', () => expect(v.wyxx).toBeVec(v[3], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wyxx; + const sw = v.wyxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxy', () => { it('should return Vec4(w, y, x, y)', () => expect(v.wyxy).toBeVec(v[3], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wyxy; + const sw = v.wyxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxz', () => { it('should return Vec4(w, y, x, z)', () => expect(v.wyxz).toBeVec(v[3], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wyxz; + const sw = v.wyxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyxw', () => { it('should return Vec4(w, y, x, w)', () => expect(v.wyxw).toBeVec(v[3], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wyxw; + const sw = v.wyxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyx', () => { it('should return Vec4(w, y, y, x)', () => expect(v.wyyx).toBeVec(v[3], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wyyx; + const sw = v.wyyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyy', () => { it('should return Vec4(w, y, y, y)', () => expect(v.wyyy).toBeVec(v[3], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wyyy; + const sw = v.wyyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyz', () => { it('should return Vec4(w, y, y, z)', () => expect(v.wyyz).toBeVec(v[3], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wyyz; + const sw = v.wyyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyyw', () => { it('should return Vec4(w, y, y, w)', () => expect(v.wyyw).toBeVec(v[3], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wyyw; + const sw = v.wyyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzx', () => { it('should return Vec4(w, y, z, x)', () => expect(v.wyzx).toBeVec(v[3], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wyzx; + const sw = v.wyzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzy', () => { it('should return Vec4(w, y, z, y)', () => expect(v.wyzy).toBeVec(v[3], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wyzy; + const sw = v.wyzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzz', () => { it('should return Vec4(w, y, z, z)', () => expect(v.wyzz).toBeVec(v[3], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wyzz; + const sw = v.wyzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyzw', () => { it('should return Vec4(w, y, z, w)', () => expect(v.wyzw).toBeVec(v[3], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wyzw; + const sw = v.wyzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wywx', () => { it('should return Vec4(w, y, w, x)', () => expect(v.wywx).toBeVec(v[3], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wywx; + const sw = v.wywx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wywy', () => { it('should return Vec4(w, y, w, y)', () => expect(v.wywy).toBeVec(v[3], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wywy; + const sw = v.wywy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wywz', () => { it('should return Vec4(w, y, w, z)', () => expect(v.wywz).toBeVec(v[3], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wywz; + const sw = v.wywz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wyww', () => { it('should return Vec4(w, y, w, w)', () => expect(v.wyww).toBeVec(v[3], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wyww; + const sw = v.wyww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxx', () => { it('should return Vec4(w, z, x, x)', () => expect(v.wzxx).toBeVec(v[3], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wzxx; + const sw = v.wzxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxy', () => { it('should return Vec4(w, z, x, y)', () => expect(v.wzxy).toBeVec(v[3], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wzxy; + const sw = v.wzxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxz', () => { it('should return Vec4(w, z, x, z)', () => expect(v.wzxz).toBeVec(v[3], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wzxz; + const sw = v.wzxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzxw', () => { it('should return Vec4(w, z, x, w)', () => expect(v.wzxw).toBeVec(v[3], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wzxw; + const sw = v.wzxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyx', () => { it('should return Vec4(w, z, y, x)', () => expect(v.wzyx).toBeVec(v[3], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wzyx; + const sw = v.wzyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyy', () => { it('should return Vec4(w, z, y, y)', () => expect(v.wzyy).toBeVec(v[3], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wzyy; + const sw = v.wzyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyz', () => { it('should return Vec4(w, z, y, z)', () => expect(v.wzyz).toBeVec(v[3], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wzyz; + const sw = v.wzyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzyw', () => { it('should return Vec4(w, z, y, w)', () => expect(v.wzyw).toBeVec(v[3], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wzyw; + const sw = v.wzyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzx', () => { it('should return Vec4(w, z, z, x)', () => expect(v.wzzx).toBeVec(v[3], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wzzx; + const sw = v.wzzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzy', () => { it('should return Vec4(w, z, z, y)', () => expect(v.wzzy).toBeVec(v[3], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wzzy; + const sw = v.wzzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzz', () => { it('should return Vec4(w, z, z, z)', () => expect(v.wzzz).toBeVec(v[3], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wzzz; + const sw = v.wzzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzzw', () => { it('should return Vec4(w, z, z, w)', () => expect(v.wzzw).toBeVec(v[3], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wzzw; + const sw = v.wzzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzwx', () => { it('should return Vec4(w, z, w, x)', () => expect(v.wzwx).toBeVec(v[3], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wzwx; + const sw = v.wzwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzwy', () => { it('should return Vec4(w, z, w, y)', () => expect(v.wzwy).toBeVec(v[3], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wzwy; + const sw = v.wzwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzwz', () => { it('should return Vec4(w, z, w, z)', () => expect(v.wzwz).toBeVec(v[3], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wzwz; + const sw = v.wzwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wzww', () => { it('should return Vec4(w, z, w, w)', () => expect(v.wzww).toBeVec(v[3], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wzww; + const sw = v.wzww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxx', () => { it('should return Vec4(w, w, x, x)', () => expect(v.wwxx).toBeVec(v[3], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.wwxx; + const sw = v.wwxx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxy', () => { it('should return Vec4(w, w, x, y)', () => expect(v.wwxy).toBeVec(v[3], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.wwxy; + const sw = v.wwxy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxz', () => { it('should return Vec4(w, w, x, z)', () => expect(v.wwxz).toBeVec(v[3], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.wwxz; + const sw = v.wwxz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwxw', () => { it('should return Vec4(w, w, x, w)', () => expect(v.wwxw).toBeVec(v[3], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.wwxw; + const sw = v.wwxw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyx', () => { it('should return Vec4(w, w, y, x)', () => expect(v.wwyx).toBeVec(v[3], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.wwyx; + const sw = v.wwyx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyy', () => { it('should return Vec4(w, w, y, y)', () => expect(v.wwyy).toBeVec(v[3], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.wwyy; + const sw = v.wwyy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyz', () => { it('should return Vec4(w, w, y, z)', () => expect(v.wwyz).toBeVec(v[3], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.wwyz; + const sw = v.wwyz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwyw', () => { it('should return Vec4(w, w, y, w)', () => expect(v.wwyw).toBeVec(v[3], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.wwyw; + const sw = v.wwyw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzx', () => { it('should return Vec4(w, w, z, x)', () => expect(v.wwzx).toBeVec(v[3], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.wwzx; + const sw = v.wwzx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzy', () => { it('should return Vec4(w, w, z, y)', () => expect(v.wwzy).toBeVec(v[3], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.wwzy; + const sw = v.wwzy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzz', () => { it('should return Vec4(w, w, z, z)', () => expect(v.wwzz).toBeVec(v[3], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.wwzz; + const sw = v.wwzz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwzw', () => { it('should return Vec4(w, w, z, w)', () => expect(v.wwzw).toBeVec(v[3], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.wwzw; + const sw = v.wwzw; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwwx', () => { it('should return Vec4(w, w, w, x)', () => expect(v.wwwx).toBeVec(v[3], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.wwwx; + const sw = v.wwwx; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwwy', () => { it('should return Vec4(w, w, w, y)', () => expect(v.wwwy).toBeVec(v[3], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.wwwy; + const sw = v.wwwy; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwwz', () => { it('should return Vec4(w, w, w, z)', () => expect(v.wwwz).toBeVec(v[3], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.wwwz; + const sw = v.wwwz; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().wwww', () => { it('should return Vec4(w, w, w, w)', () => expect(v.wwww).toBeVec(v[3], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.wwww; + const sw = v.wwww; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rr', () => { it('should return Vec2(r, r)', () => expect(v.rr).toBeVec(v[0], v[0])); it('should be return a copy', () => { - let sw = v.rr; + const sw = v.rr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rg', () => { it('should return Vec2(r, g)', () => expect(v.rg).toBeVec(v[0], v[1])); it('should be return a copy', () => { - let sw = v.rg; + const sw = v.rg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rb', () => { it('should return Vec2(r, b)', () => expect(v.rb).toBeVec(v[0], v[2])); it('should be return a copy', () => { - let sw = v.rb; + const sw = v.rb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ra', () => { it('should return Vec2(r, a)', () => expect(v.ra).toBeVec(v[0], v[3])); it('should be return a copy', () => { - let sw = v.ra; + const sw = v.ra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gr', () => { it('should return Vec2(g, r)', () => expect(v.gr).toBeVec(v[1], v[0])); it('should be return a copy', () => { - let sw = v.gr; + const sw = v.gr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gg', () => { it('should return Vec2(g, g)', () => expect(v.gg).toBeVec(v[1], v[1])); it('should be return a copy', () => { - let sw = v.gg; + const sw = v.gg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gb', () => { it('should return Vec2(g, b)', () => expect(v.gb).toBeVec(v[1], v[2])); it('should be return a copy', () => { - let sw = v.gb; + const sw = v.gb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ga', () => { it('should return Vec2(g, a)', () => expect(v.ga).toBeVec(v[1], v[3])); it('should be return a copy', () => { - let sw = v.ga; + const sw = v.ga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().br', () => { it('should return Vec2(b, r)', () => expect(v.br).toBeVec(v[2], v[0])); it('should be return a copy', () => { - let sw = v.br; + const sw = v.br; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bg', () => { it('should return Vec2(b, g)', () => expect(v.bg).toBeVec(v[2], v[1])); it('should be return a copy', () => { - let sw = v.bg; + const sw = v.bg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bb', () => { it('should return Vec2(b, b)', () => expect(v.bb).toBeVec(v[2], v[2])); it('should be return a copy', () => { - let sw = v.bb; + const sw = v.bb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ba', () => { it('should return Vec2(b, a)', () => expect(v.ba).toBeVec(v[2], v[3])); it('should be return a copy', () => { - let sw = v.ba; + const sw = v.ba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ar', () => { it('should return Vec2(a, r)', () => expect(v.ar).toBeVec(v[3], v[0])); it('should be return a copy', () => { - let sw = v.ar; + const sw = v.ar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ag', () => { it('should return Vec2(a, g)', () => expect(v.ag).toBeVec(v[3], v[1])); it('should be return a copy', () => { - let sw = v.ag; + const sw = v.ag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ab', () => { it('should return Vec2(a, b)', () => expect(v.ab).toBeVec(v[3], v[2])); it('should be return a copy', () => { - let sw = v.ab; + const sw = v.ab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aa', () => { it('should return Vec2(a, a)', () => expect(v.aa).toBeVec(v[3], v[3])); it('should be return a copy', () => { - let sw = v.aa; + const sw = v.aa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrr', () => { it('should return Vec3(r, r, r)', () => expect(v.rrr).toBeVec(v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrr; + const sw = v.rrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrg', () => { it('should return Vec3(r, r, g)', () => expect(v.rrg).toBeVec(v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrg; + const sw = v.rrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrb', () => { it('should return Vec3(r, r, b)', () => expect(v.rrb).toBeVec(v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrb; + const sw = v.rrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rra', () => { it('should return Vec3(r, r, a)', () => expect(v.rra).toBeVec(v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rra; + const sw = v.rra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgr', () => { it('should return Vec3(r, g, r)', () => expect(v.rgr).toBeVec(v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rgr; + const sw = v.rgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgg', () => { it('should return Vec3(r, g, g)', () => expect(v.rgg).toBeVec(v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rgg; + const sw = v.rgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgb', () => { it('should return Vec3(r, g, b)', () => expect(v.rgb).toBeVec(v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rgb; + const sw = v.rgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rga', () => { it('should return Vec3(r, g, a)', () => expect(v.rga).toBeVec(v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rga; + const sw = v.rga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbr', () => { it('should return Vec3(r, b, r)', () => expect(v.rbr).toBeVec(v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbr; + const sw = v.rbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbg', () => { it('should return Vec3(r, b, g)', () => expect(v.rbg).toBeVec(v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbg; + const sw = v.rbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbb', () => { it('should return Vec3(r, b, b)', () => expect(v.rbb).toBeVec(v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbb; + const sw = v.rbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rba', () => { it('should return Vec3(r, b, a)', () => expect(v.rba).toBeVec(v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rba; + const sw = v.rba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rar', () => { it('should return Vec3(r, a, r)', () => expect(v.rar).toBeVec(v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rar; + const sw = v.rar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rag', () => { it('should return Vec3(r, a, g)', () => expect(v.rag).toBeVec(v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rag; + const sw = v.rag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rab', () => { it('should return Vec3(r, a, b)', () => expect(v.rab).toBeVec(v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rab; + const sw = v.rab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raa', () => { it('should return Vec3(r, a, a)', () => expect(v.raa).toBeVec(v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.raa; + const sw = v.raa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grr', () => { it('should return Vec3(g, r, r)', () => expect(v.grr).toBeVec(v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grr; + const sw = v.grr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grg', () => { it('should return Vec3(g, r, g)', () => expect(v.grg).toBeVec(v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grg; + const sw = v.grg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grb', () => { it('should return Vec3(g, r, b)', () => expect(v.grb).toBeVec(v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grb; + const sw = v.grb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gra', () => { it('should return Vec3(g, r, a)', () => expect(v.gra).toBeVec(v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.gra; + const sw = v.gra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggr', () => { it('should return Vec3(g, g, r)', () => expect(v.ggr).toBeVec(v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ggr; + const sw = v.ggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggg', () => { it('should return Vec3(g, g, g)', () => expect(v.ggg).toBeVec(v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ggg; + const sw = v.ggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggb', () => { it('should return Vec3(g, g, b)', () => expect(v.ggb).toBeVec(v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ggb; + const sw = v.ggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gga', () => { it('should return Vec3(g, g, a)', () => expect(v.gga).toBeVec(v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.gga; + const sw = v.gga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbr', () => { it('should return Vec3(g, b, r)', () => expect(v.gbr).toBeVec(v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbr; + const sw = v.gbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbg', () => { it('should return Vec3(g, b, g)', () => expect(v.gbg).toBeVec(v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbg; + const sw = v.gbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbb', () => { it('should return Vec3(g, b, b)', () => expect(v.gbb).toBeVec(v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbb; + const sw = v.gbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gba', () => { it('should return Vec3(g, b, a)', () => expect(v.gba).toBeVec(v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.gba; + const sw = v.gba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gar', () => { it('should return Vec3(g, a, r)', () => expect(v.gar).toBeVec(v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.gar; + const sw = v.gar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gag', () => { it('should return Vec3(g, a, g)', () => expect(v.gag).toBeVec(v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.gag; + const sw = v.gag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gab', () => { it('should return Vec3(g, a, b)', () => expect(v.gab).toBeVec(v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.gab; + const sw = v.gab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaa', () => { it('should return Vec3(g, a, a)', () => expect(v.gaa).toBeVec(v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.gaa; + const sw = v.gaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brr', () => { it('should return Vec3(b, r, r)', () => expect(v.brr).toBeVec(v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brr; + const sw = v.brr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brg', () => { it('should return Vec3(b, r, g)', () => expect(v.brg).toBeVec(v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brg; + const sw = v.brg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brb', () => { it('should return Vec3(b, r, b)', () => expect(v.brb).toBeVec(v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brb; + const sw = v.brb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bra', () => { it('should return Vec3(b, r, a)', () => expect(v.bra).toBeVec(v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bra; + const sw = v.bra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgr', () => { it('should return Vec3(b, g, r)', () => expect(v.bgr).toBeVec(v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bgr; + const sw = v.bgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgg', () => { it('should return Vec3(b, g, g)', () => expect(v.bgg).toBeVec(v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bgg; + const sw = v.bgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgb', () => { it('should return Vec3(b, g, b)', () => expect(v.bgb).toBeVec(v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bgb; + const sw = v.bgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bga', () => { it('should return Vec3(b, g, a)', () => expect(v.bga).toBeVec(v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.bga; + const sw = v.bga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbr', () => { it('should return Vec3(b, b, r)', () => expect(v.bbr).toBeVec(v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbr; + const sw = v.bbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbg', () => { it('should return Vec3(b, b, g)', () => expect(v.bbg).toBeVec(v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbg; + const sw = v.bbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbb', () => { it('should return Vec3(b, b, b)', () => expect(v.bbb).toBeVec(v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbb; + const sw = v.bbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bba', () => { it('should return Vec3(b, b, a)', () => expect(v.bba).toBeVec(v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.bba; + const sw = v.bba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bar', () => { it('should return Vec3(b, a, r)', () => expect(v.bar).toBeVec(v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.bar; + const sw = v.bar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bag', () => { it('should return Vec3(b, a, g)', () => expect(v.bag).toBeVec(v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.bag; + const sw = v.bag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bab', () => { it('should return Vec3(b, a, b)', () => expect(v.bab).toBeVec(v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.bab; + const sw = v.bab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baa', () => { it('should return Vec3(b, a, a)', () => expect(v.baa).toBeVec(v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.baa; + const sw = v.baa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arr', () => { it('should return Vec3(a, r, r)', () => expect(v.arr).toBeVec(v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.arr; + const sw = v.arr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arg', () => { it('should return Vec3(a, r, g)', () => expect(v.arg).toBeVec(v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.arg; + const sw = v.arg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arb', () => { it('should return Vec3(a, r, b)', () => expect(v.arb).toBeVec(v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.arb; + const sw = v.arb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ara', () => { it('should return Vec3(a, r, a)', () => expect(v.ara).toBeVec(v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.ara; + const sw = v.ara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agr', () => { it('should return Vec3(a, g, r)', () => expect(v.agr).toBeVec(v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.agr; + const sw = v.agr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agg', () => { it('should return Vec3(a, g, g)', () => expect(v.agg).toBeVec(v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.agg; + const sw = v.agg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agb', () => { it('should return Vec3(a, g, b)', () => expect(v.agb).toBeVec(v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.agb; + const sw = v.agb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aga', () => { it('should return Vec3(a, g, a)', () => expect(v.aga).toBeVec(v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.aga; + const sw = v.aga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abr', () => { it('should return Vec3(a, b, r)', () => expect(v.abr).toBeVec(v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.abr; + const sw = v.abr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abg', () => { it('should return Vec3(a, b, g)', () => expect(v.abg).toBeVec(v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.abg; + const sw = v.abg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abb', () => { it('should return Vec3(a, b, b)', () => expect(v.abb).toBeVec(v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.abb; + const sw = v.abb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aba', () => { it('should return Vec3(a, b, a)', () => expect(v.aba).toBeVec(v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.aba; + const sw = v.aba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aar', () => { it('should return Vec3(a, a, r)', () => expect(v.aar).toBeVec(v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.aar; + const sw = v.aar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aag', () => { it('should return Vec3(a, a, g)', () => expect(v.aag).toBeVec(v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.aag; + const sw = v.aag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aab', () => { it('should return Vec3(a, a, b)', () => expect(v.aab).toBeVec(v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.aab; + const sw = v.aab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaa', () => { it('should return Vec3(a, a, a)', () => expect(v.aaa).toBeVec(v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.aaa; + const sw = v.aaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrrr', () => { it('should return Vec4(r, r, r, r)', () => expect(v.rrrr).toBeVec(v[0], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rrrr; + const sw = v.rrrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrrg', () => { it('should return Vec4(r, r, r, g)', () => expect(v.rrrg).toBeVec(v[0], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rrrg; + const sw = v.rrrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrrb', () => { it('should return Vec4(r, r, r, b)', () => expect(v.rrrb).toBeVec(v[0], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rrrb; + const sw = v.rrrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrra', () => { it('should return Vec4(r, r, r, a)', () => expect(v.rrra).toBeVec(v[0], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rrra; + const sw = v.rrra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrgr', () => { it('should return Vec4(r, r, g, r)', () => expect(v.rrgr).toBeVec(v[0], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rrgr; + const sw = v.rrgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrgg', () => { it('should return Vec4(r, r, g, g)', () => expect(v.rrgg).toBeVec(v[0], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rrgg; + const sw = v.rrgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrgb', () => { it('should return Vec4(r, r, g, b)', () => expect(v.rrgb).toBeVec(v[0], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rrgb; + const sw = v.rrgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrga', () => { it('should return Vec4(r, r, g, a)', () => expect(v.rrga).toBeVec(v[0], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rrga; + const sw = v.rrga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrbr', () => { it('should return Vec4(r, r, b, r)', () => expect(v.rrbr).toBeVec(v[0], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rrbr; + const sw = v.rrbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrbg', () => { it('should return Vec4(r, r, b, g)', () => expect(v.rrbg).toBeVec(v[0], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rrbg; + const sw = v.rrbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrbb', () => { it('should return Vec4(r, r, b, b)', () => expect(v.rrbb).toBeVec(v[0], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rrbb; + const sw = v.rrbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrba', () => { it('should return Vec4(r, r, b, a)', () => expect(v.rrba).toBeVec(v[0], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rrba; + const sw = v.rrba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrar', () => { it('should return Vec4(r, r, a, r)', () => expect(v.rrar).toBeVec(v[0], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rrar; + const sw = v.rrar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrag', () => { it('should return Vec4(r, r, a, g)', () => expect(v.rrag).toBeVec(v[0], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rrag; + const sw = v.rrag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rrab', () => { it('should return Vec4(r, r, a, b)', () => expect(v.rrab).toBeVec(v[0], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rrab; + const sw = v.rrab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rraa', () => { it('should return Vec4(r, r, a, a)', () => expect(v.rraa).toBeVec(v[0], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.rraa; + const sw = v.rraa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgrr', () => { it('should return Vec4(r, g, r, r)', () => expect(v.rgrr).toBeVec(v[0], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rgrr; + const sw = v.rgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgrg', () => { it('should return Vec4(r, g, r, g)', () => expect(v.rgrg).toBeVec(v[0], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rgrg; + const sw = v.rgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgrb', () => { it('should return Vec4(r, g, r, b)', () => expect(v.rgrb).toBeVec(v[0], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rgrb; + const sw = v.rgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgra', () => { it('should return Vec4(r, g, r, a)', () => expect(v.rgra).toBeVec(v[0], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rgra; + const sw = v.rgra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rggr', () => { it('should return Vec4(r, g, g, r)', () => expect(v.rggr).toBeVec(v[0], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rggr; + const sw = v.rggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rggg', () => { it('should return Vec4(r, g, g, g)', () => expect(v.rggg).toBeVec(v[0], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rggg; + const sw = v.rggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rggb', () => { it('should return Vec4(r, g, g, b)', () => expect(v.rggb).toBeVec(v[0], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rggb; + const sw = v.rggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgga', () => { it('should return Vec4(r, g, g, a)', () => expect(v.rgga).toBeVec(v[0], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rgga; + const sw = v.rgga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgbr', () => { it('should return Vec4(r, g, b, r)', () => expect(v.rgbr).toBeVec(v[0], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rgbr; + const sw = v.rgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgbg', () => { it('should return Vec4(r, g, b, g)', () => expect(v.rgbg).toBeVec(v[0], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rgbg; + const sw = v.rgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgbb', () => { it('should return Vec4(r, g, b, b)', () => expect(v.rgbb).toBeVec(v[0], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rgbb; + const sw = v.rgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgba', () => { it('should return Vec4(r, g, b, a)', () => expect(v.rgba).toBeVec(v[0], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rgba; + const sw = v.rgba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgar', () => { it('should return Vec4(r, g, a, r)', () => expect(v.rgar).toBeVec(v[0], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rgar; + const sw = v.rgar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgag', () => { it('should return Vec4(r, g, a, g)', () => expect(v.rgag).toBeVec(v[0], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rgag; + const sw = v.rgag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgab', () => { it('should return Vec4(r, g, a, b)', () => expect(v.rgab).toBeVec(v[0], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rgab; + const sw = v.rgab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rgaa', () => { it('should return Vec4(r, g, a, a)', () => expect(v.rgaa).toBeVec(v[0], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.rgaa; + const sw = v.rgaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbrr', () => { it('should return Vec4(r, b, r, r)', () => expect(v.rbrr).toBeVec(v[0], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rbrr; + const sw = v.rbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbrg', () => { it('should return Vec4(r, b, r, g)', () => expect(v.rbrg).toBeVec(v[0], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rbrg; + const sw = v.rbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbrb', () => { it('should return Vec4(r, b, r, b)', () => expect(v.rbrb).toBeVec(v[0], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rbrb; + const sw = v.rbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbra', () => { it('should return Vec4(r, b, r, a)', () => expect(v.rbra).toBeVec(v[0], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rbra; + const sw = v.rbra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbgr', () => { it('should return Vec4(r, b, g, r)', () => expect(v.rbgr).toBeVec(v[0], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.rbgr; + const sw = v.rbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbgg', () => { it('should return Vec4(r, b, g, g)', () => expect(v.rbgg).toBeVec(v[0], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.rbgg; + const sw = v.rbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbgb', () => { it('should return Vec4(r, b, g, b)', () => expect(v.rbgb).toBeVec(v[0], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.rbgb; + const sw = v.rbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbga', () => { it('should return Vec4(r, b, g, a)', () => expect(v.rbga).toBeVec(v[0], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.rbga; + const sw = v.rbga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbbr', () => { it('should return Vec4(r, b, b, r)', () => expect(v.rbbr).toBeVec(v[0], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rbbr; + const sw = v.rbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbbg', () => { it('should return Vec4(r, b, b, g)', () => expect(v.rbbg).toBeVec(v[0], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rbbg; + const sw = v.rbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbbb', () => { it('should return Vec4(r, b, b, b)', () => expect(v.rbbb).toBeVec(v[0], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rbbb; + const sw = v.rbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbba', () => { it('should return Vec4(r, b, b, a)', () => expect(v.rbba).toBeVec(v[0], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.rbba; + const sw = v.rbba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbar', () => { it('should return Vec4(r, b, a, r)', () => expect(v.rbar).toBeVec(v[0], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.rbar; + const sw = v.rbar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbag', () => { it('should return Vec4(r, b, a, g)', () => expect(v.rbag).toBeVec(v[0], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.rbag; + const sw = v.rbag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbab', () => { it('should return Vec4(r, b, a, b)', () => expect(v.rbab).toBeVec(v[0], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.rbab; + const sw = v.rbab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rbaa', () => { it('should return Vec4(r, b, a, a)', () => expect(v.rbaa).toBeVec(v[0], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.rbaa; + const sw = v.rbaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rarr', () => { it('should return Vec4(r, a, r, r)', () => expect(v.rarr).toBeVec(v[0], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.rarr; + const sw = v.rarr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rarg', () => { it('should return Vec4(r, a, r, g)', () => expect(v.rarg).toBeVec(v[0], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.rarg; + const sw = v.rarg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rarb', () => { it('should return Vec4(r, a, r, b)', () => expect(v.rarb).toBeVec(v[0], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.rarb; + const sw = v.rarb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rara', () => { it('should return Vec4(r, a, r, a)', () => expect(v.rara).toBeVec(v[0], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.rara; + const sw = v.rara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ragr', () => { it('should return Vec4(r, a, g, r)', () => expect(v.ragr).toBeVec(v[0], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.ragr; + const sw = v.ragr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ragg', () => { it('should return Vec4(r, a, g, g)', () => expect(v.ragg).toBeVec(v[0], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.ragg; + const sw = v.ragg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ragb', () => { it('should return Vec4(r, a, g, b)', () => expect(v.ragb).toBeVec(v[0], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.ragb; + const sw = v.ragb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raga', () => { it('should return Vec4(r, a, g, a)', () => expect(v.raga).toBeVec(v[0], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.raga; + const sw = v.raga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rabr', () => { it('should return Vec4(r, a, b, r)', () => expect(v.rabr).toBeVec(v[0], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.rabr; + const sw = v.rabr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rabg', () => { it('should return Vec4(r, a, b, g)', () => expect(v.rabg).toBeVec(v[0], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.rabg; + const sw = v.rabg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().rabb', () => { it('should return Vec4(r, a, b, b)', () => expect(v.rabb).toBeVec(v[0], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.rabb; + const sw = v.rabb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raba', () => { it('should return Vec4(r, a, b, a)', () => expect(v.raba).toBeVec(v[0], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.raba; + const sw = v.raba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raar', () => { it('should return Vec4(r, a, a, r)', () => expect(v.raar).toBeVec(v[0], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.raar; + const sw = v.raar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raag', () => { it('should return Vec4(r, a, a, g)', () => expect(v.raag).toBeVec(v[0], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.raag; + const sw = v.raag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raab', () => { it('should return Vec4(r, a, a, b)', () => expect(v.raab).toBeVec(v[0], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.raab; + const sw = v.raab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().raaa', () => { it('should return Vec4(r, a, a, a)', () => expect(v.raaa).toBeVec(v[0], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.raaa; + const sw = v.raaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grrr', () => { it('should return Vec4(g, r, r, r)', () => expect(v.grrr).toBeVec(v[1], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.grrr; + const sw = v.grrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grrg', () => { it('should return Vec4(g, r, r, g)', () => expect(v.grrg).toBeVec(v[1], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.grrg; + const sw = v.grrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grrb', () => { it('should return Vec4(g, r, r, b)', () => expect(v.grrb).toBeVec(v[1], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.grrb; + const sw = v.grrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grra', () => { it('should return Vec4(g, r, r, a)', () => expect(v.grra).toBeVec(v[1], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.grra; + const sw = v.grra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grgr', () => { it('should return Vec4(g, r, g, r)', () => expect(v.grgr).toBeVec(v[1], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.grgr; + const sw = v.grgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grgg', () => { it('should return Vec4(g, r, g, g)', () => expect(v.grgg).toBeVec(v[1], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.grgg; + const sw = v.grgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grgb', () => { it('should return Vec4(g, r, g, b)', () => expect(v.grgb).toBeVec(v[1], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.grgb; + const sw = v.grgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grga', () => { it('should return Vec4(g, r, g, a)', () => expect(v.grga).toBeVec(v[1], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.grga; + const sw = v.grga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grbr', () => { it('should return Vec4(g, r, b, r)', () => expect(v.grbr).toBeVec(v[1], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.grbr; + const sw = v.grbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grbg', () => { it('should return Vec4(g, r, b, g)', () => expect(v.grbg).toBeVec(v[1], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.grbg; + const sw = v.grbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grbb', () => { it('should return Vec4(g, r, b, b)', () => expect(v.grbb).toBeVec(v[1], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.grbb; + const sw = v.grbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grba', () => { it('should return Vec4(g, r, b, a)', () => expect(v.grba).toBeVec(v[1], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.grba; + const sw = v.grba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grar', () => { it('should return Vec4(g, r, a, r)', () => expect(v.grar).toBeVec(v[1], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.grar; + const sw = v.grar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grag', () => { it('should return Vec4(g, r, a, g)', () => expect(v.grag).toBeVec(v[1], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.grag; + const sw = v.grag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().grab', () => { it('should return Vec4(g, r, a, b)', () => expect(v.grab).toBeVec(v[1], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.grab; + const sw = v.grab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().graa', () => { it('should return Vec4(g, r, a, a)', () => expect(v.graa).toBeVec(v[1], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.graa; + const sw = v.graa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggrr', () => { it('should return Vec4(g, g, r, r)', () => expect(v.ggrr).toBeVec(v[1], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.ggrr; + const sw = v.ggrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggrg', () => { it('should return Vec4(g, g, r, g)', () => expect(v.ggrg).toBeVec(v[1], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.ggrg; + const sw = v.ggrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggrb', () => { it('should return Vec4(g, g, r, b)', () => expect(v.ggrb).toBeVec(v[1], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.ggrb; + const sw = v.ggrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggra', () => { it('should return Vec4(g, g, r, a)', () => expect(v.ggra).toBeVec(v[1], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.ggra; + const sw = v.ggra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gggr', () => { it('should return Vec4(g, g, g, r)', () => expect(v.gggr).toBeVec(v[1], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gggr; + const sw = v.gggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gggg', () => { it('should return Vec4(g, g, g, g)', () => expect(v.gggg).toBeVec(v[1], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gggg; + const sw = v.gggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gggb', () => { it('should return Vec4(g, g, g, b)', () => expect(v.gggb).toBeVec(v[1], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gggb; + const sw = v.gggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggga', () => { it('should return Vec4(g, g, g, a)', () => expect(v.ggga).toBeVec(v[1], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.ggga; + const sw = v.ggga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggbr', () => { it('should return Vec4(g, g, b, r)', () => expect(v.ggbr).toBeVec(v[1], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.ggbr; + const sw = v.ggbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggbg', () => { it('should return Vec4(g, g, b, g)', () => expect(v.ggbg).toBeVec(v[1], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.ggbg; + const sw = v.ggbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggbb', () => { it('should return Vec4(g, g, b, b)', () => expect(v.ggbb).toBeVec(v[1], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.ggbb; + const sw = v.ggbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggba', () => { it('should return Vec4(g, g, b, a)', () => expect(v.ggba).toBeVec(v[1], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.ggba; + const sw = v.ggba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggar', () => { it('should return Vec4(g, g, a, r)', () => expect(v.ggar).toBeVec(v[1], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.ggar; + const sw = v.ggar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggag', () => { it('should return Vec4(g, g, a, g)', () => expect(v.ggag).toBeVec(v[1], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.ggag; + const sw = v.ggag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggab', () => { it('should return Vec4(g, g, a, b)', () => expect(v.ggab).toBeVec(v[1], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.ggab; + const sw = v.ggab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().ggaa', () => { it('should return Vec4(g, g, a, a)', () => expect(v.ggaa).toBeVec(v[1], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.ggaa; + const sw = v.ggaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbrr', () => { it('should return Vec4(g, b, r, r)', () => expect(v.gbrr).toBeVec(v[1], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.gbrr; + const sw = v.gbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbrg', () => { it('should return Vec4(g, b, r, g)', () => expect(v.gbrg).toBeVec(v[1], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.gbrg; + const sw = v.gbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbrb', () => { it('should return Vec4(g, b, r, b)', () => expect(v.gbrb).toBeVec(v[1], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.gbrb; + const sw = v.gbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbra', () => { it('should return Vec4(g, b, r, a)', () => expect(v.gbra).toBeVec(v[1], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.gbra; + const sw = v.gbra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbgr', () => { it('should return Vec4(g, b, g, r)', () => expect(v.gbgr).toBeVec(v[1], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gbgr; + const sw = v.gbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbgg', () => { it('should return Vec4(g, b, g, g)', () => expect(v.gbgg).toBeVec(v[1], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gbgg; + const sw = v.gbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbgb', () => { it('should return Vec4(g, b, g, b)', () => expect(v.gbgb).toBeVec(v[1], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gbgb; + const sw = v.gbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbga', () => { it('should return Vec4(g, b, g, a)', () => expect(v.gbga).toBeVec(v[1], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.gbga; + const sw = v.gbga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbbr', () => { it('should return Vec4(g, b, b, r)', () => expect(v.gbbr).toBeVec(v[1], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gbbr; + const sw = v.gbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbbg', () => { it('should return Vec4(g, b, b, g)', () => expect(v.gbbg).toBeVec(v[1], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gbbg; + const sw = v.gbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbbb', () => { it('should return Vec4(g, b, b, b)', () => expect(v.gbbb).toBeVec(v[1], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gbbb; + const sw = v.gbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbba', () => { it('should return Vec4(g, b, b, a)', () => expect(v.gbba).toBeVec(v[1], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.gbba; + const sw = v.gbba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbar', () => { it('should return Vec4(g, b, a, r)', () => expect(v.gbar).toBeVec(v[1], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.gbar; + const sw = v.gbar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbag', () => { it('should return Vec4(g, b, a, g)', () => expect(v.gbag).toBeVec(v[1], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.gbag; + const sw = v.gbag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbab', () => { it('should return Vec4(g, b, a, b)', () => expect(v.gbab).toBeVec(v[1], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.gbab; + const sw = v.gbab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gbaa', () => { it('should return Vec4(g, b, a, a)', () => expect(v.gbaa).toBeVec(v[1], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.gbaa; + const sw = v.gbaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().garr', () => { it('should return Vec4(g, a, r, r)', () => expect(v.garr).toBeVec(v[1], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.garr; + const sw = v.garr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().garg', () => { it('should return Vec4(g, a, r, g)', () => expect(v.garg).toBeVec(v[1], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.garg; + const sw = v.garg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().garb', () => { it('should return Vec4(g, a, r, b)', () => expect(v.garb).toBeVec(v[1], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.garb; + const sw = v.garb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gara', () => { it('should return Vec4(g, a, r, a)', () => expect(v.gara).toBeVec(v[1], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.gara; + const sw = v.gara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gagr', () => { it('should return Vec4(g, a, g, r)', () => expect(v.gagr).toBeVec(v[1], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.gagr; + const sw = v.gagr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gagg', () => { it('should return Vec4(g, a, g, g)', () => expect(v.gagg).toBeVec(v[1], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.gagg; + const sw = v.gagg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gagb', () => { it('should return Vec4(g, a, g, b)', () => expect(v.gagb).toBeVec(v[1], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.gagb; + const sw = v.gagb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaga', () => { it('should return Vec4(g, a, g, a)', () => expect(v.gaga).toBeVec(v[1], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.gaga; + const sw = v.gaga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gabr', () => { it('should return Vec4(g, a, b, r)', () => expect(v.gabr).toBeVec(v[1], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.gabr; + const sw = v.gabr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gabg', () => { it('should return Vec4(g, a, b, g)', () => expect(v.gabg).toBeVec(v[1], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.gabg; + const sw = v.gabg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gabb', () => { it('should return Vec4(g, a, b, b)', () => expect(v.gabb).toBeVec(v[1], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.gabb; + const sw = v.gabb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaba', () => { it('should return Vec4(g, a, b, a)', () => expect(v.gaba).toBeVec(v[1], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.gaba; + const sw = v.gaba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaar', () => { it('should return Vec4(g, a, a, r)', () => expect(v.gaar).toBeVec(v[1], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.gaar; + const sw = v.gaar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaag', () => { it('should return Vec4(g, a, a, g)', () => expect(v.gaag).toBeVec(v[1], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.gaag; + const sw = v.gaag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaab', () => { it('should return Vec4(g, a, a, b)', () => expect(v.gaab).toBeVec(v[1], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.gaab; + const sw = v.gaab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().gaaa', () => { it('should return Vec4(g, a, a, a)', () => expect(v.gaaa).toBeVec(v[1], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.gaaa; + const sw = v.gaaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brrr', () => { it('should return Vec4(b, r, r, r)', () => expect(v.brrr).toBeVec(v[2], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.brrr; + const sw = v.brrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brrg', () => { it('should return Vec4(b, r, r, g)', () => expect(v.brrg).toBeVec(v[2], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.brrg; + const sw = v.brrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brrb', () => { it('should return Vec4(b, r, r, b)', () => expect(v.brrb).toBeVec(v[2], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.brrb; + const sw = v.brrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brra', () => { it('should return Vec4(b, r, r, a)', () => expect(v.brra).toBeVec(v[2], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.brra; + const sw = v.brra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brgr', () => { it('should return Vec4(b, r, g, r)', () => expect(v.brgr).toBeVec(v[2], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.brgr; + const sw = v.brgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brgg', () => { it('should return Vec4(b, r, g, g)', () => expect(v.brgg).toBeVec(v[2], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.brgg; + const sw = v.brgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brgb', () => { it('should return Vec4(b, r, g, b)', () => expect(v.brgb).toBeVec(v[2], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.brgb; + const sw = v.brgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brga', () => { it('should return Vec4(b, r, g, a)', () => expect(v.brga).toBeVec(v[2], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.brga; + const sw = v.brga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brbr', () => { it('should return Vec4(b, r, b, r)', () => expect(v.brbr).toBeVec(v[2], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.brbr; + const sw = v.brbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brbg', () => { it('should return Vec4(b, r, b, g)', () => expect(v.brbg).toBeVec(v[2], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.brbg; + const sw = v.brbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brbb', () => { it('should return Vec4(b, r, b, b)', () => expect(v.brbb).toBeVec(v[2], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.brbb; + const sw = v.brbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brba', () => { it('should return Vec4(b, r, b, a)', () => expect(v.brba).toBeVec(v[2], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.brba; + const sw = v.brba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brar', () => { it('should return Vec4(b, r, a, r)', () => expect(v.brar).toBeVec(v[2], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.brar; + const sw = v.brar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brag', () => { it('should return Vec4(b, r, a, g)', () => expect(v.brag).toBeVec(v[2], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.brag; + const sw = v.brag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().brab', () => { it('should return Vec4(b, r, a, b)', () => expect(v.brab).toBeVec(v[2], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.brab; + const sw = v.brab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().braa', () => { it('should return Vec4(b, r, a, a)', () => expect(v.braa).toBeVec(v[2], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.braa; + const sw = v.braa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgrr', () => { it('should return Vec4(b, g, r, r)', () => expect(v.bgrr).toBeVec(v[2], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bgrr; + const sw = v.bgrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgrg', () => { it('should return Vec4(b, g, r, g)', () => expect(v.bgrg).toBeVec(v[2], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bgrg; + const sw = v.bgrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgrb', () => { it('should return Vec4(b, g, r, b)', () => expect(v.bgrb).toBeVec(v[2], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bgrb; + const sw = v.bgrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgra', () => { it('should return Vec4(b, g, r, a)', () => expect(v.bgra).toBeVec(v[2], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bgra; + const sw = v.bgra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bggr', () => { it('should return Vec4(b, g, g, r)', () => expect(v.bggr).toBeVec(v[2], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bggr; + const sw = v.bggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bggg', () => { it('should return Vec4(b, g, g, g)', () => expect(v.bggg).toBeVec(v[2], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bggg; + const sw = v.bggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bggb', () => { it('should return Vec4(b, g, g, b)', () => expect(v.bggb).toBeVec(v[2], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bggb; + const sw = v.bggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgga', () => { it('should return Vec4(b, g, g, a)', () => expect(v.bgga).toBeVec(v[2], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.bgga; + const sw = v.bgga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgbr', () => { it('should return Vec4(b, g, b, r)', () => expect(v.bgbr).toBeVec(v[2], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bgbr; + const sw = v.bgbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgbg', () => { it('should return Vec4(b, g, b, g)', () => expect(v.bgbg).toBeVec(v[2], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bgbg; + const sw = v.bgbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgbb', () => { it('should return Vec4(b, g, b, b)', () => expect(v.bgbb).toBeVec(v[2], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bgbb; + const sw = v.bgbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgba', () => { it('should return Vec4(b, g, b, a)', () => expect(v.bgba).toBeVec(v[2], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.bgba; + const sw = v.bgba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgar', () => { it('should return Vec4(b, g, a, r)', () => expect(v.bgar).toBeVec(v[2], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.bgar; + const sw = v.bgar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgag', () => { it('should return Vec4(b, g, a, g)', () => expect(v.bgag).toBeVec(v[2], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.bgag; + const sw = v.bgag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgab', () => { it('should return Vec4(b, g, a, b)', () => expect(v.bgab).toBeVec(v[2], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.bgab; + const sw = v.bgab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bgaa', () => { it('should return Vec4(b, g, a, a)', () => expect(v.bgaa).toBeVec(v[2], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.bgaa; + const sw = v.bgaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbrr', () => { it('should return Vec4(b, b, r, r)', () => expect(v.bbrr).toBeVec(v[2], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.bbrr; + const sw = v.bbrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbrg', () => { it('should return Vec4(b, b, r, g)', () => expect(v.bbrg).toBeVec(v[2], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.bbrg; + const sw = v.bbrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbrb', () => { it('should return Vec4(b, b, r, b)', () => expect(v.bbrb).toBeVec(v[2], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.bbrb; + const sw = v.bbrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbra', () => { it('should return Vec4(b, b, r, a)', () => expect(v.bbra).toBeVec(v[2], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bbra; + const sw = v.bbra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbgr', () => { it('should return Vec4(b, b, g, r)', () => expect(v.bbgr).toBeVec(v[2], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bbgr; + const sw = v.bbgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbgg', () => { it('should return Vec4(b, b, g, g)', () => expect(v.bbgg).toBeVec(v[2], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bbgg; + const sw = v.bbgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbgb', () => { it('should return Vec4(b, b, g, b)', () => expect(v.bbgb).toBeVec(v[2], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bbgb; + const sw = v.bbgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbga', () => { it('should return Vec4(b, b, g, a)', () => expect(v.bbga).toBeVec(v[2], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.bbga; + const sw = v.bbga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbbr', () => { it('should return Vec4(b, b, b, r)', () => expect(v.bbbr).toBeVec(v[2], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.bbbr; + const sw = v.bbbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbbg', () => { it('should return Vec4(b, b, b, g)', () => expect(v.bbbg).toBeVec(v[2], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.bbbg; + const sw = v.bbbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbbb', () => { it('should return Vec4(b, b, b, b)', () => expect(v.bbbb).toBeVec(v[2], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.bbbb; + const sw = v.bbbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbba', () => { it('should return Vec4(b, b, b, a)', () => expect(v.bbba).toBeVec(v[2], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.bbba; + const sw = v.bbba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbar', () => { it('should return Vec4(b, b, a, r)', () => expect(v.bbar).toBeVec(v[2], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.bbar; + const sw = v.bbar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbag', () => { it('should return Vec4(b, b, a, g)', () => expect(v.bbag).toBeVec(v[2], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.bbag; + const sw = v.bbag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbab', () => { it('should return Vec4(b, b, a, b)', () => expect(v.bbab).toBeVec(v[2], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.bbab; + const sw = v.bbab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bbaa', () => { it('should return Vec4(b, b, a, a)', () => expect(v.bbaa).toBeVec(v[2], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.bbaa; + const sw = v.bbaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().barr', () => { it('should return Vec4(b, a, r, r)', () => expect(v.barr).toBeVec(v[2], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.barr; + const sw = v.barr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().barg', () => { it('should return Vec4(b, a, r, g)', () => expect(v.barg).toBeVec(v[2], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.barg; + const sw = v.barg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().barb', () => { it('should return Vec4(b, a, r, b)', () => expect(v.barb).toBeVec(v[2], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.barb; + const sw = v.barb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bara', () => { it('should return Vec4(b, a, r, a)', () => expect(v.bara).toBeVec(v[2], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.bara; + const sw = v.bara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bagr', () => { it('should return Vec4(b, a, g, r)', () => expect(v.bagr).toBeVec(v[2], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.bagr; + const sw = v.bagr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bagg', () => { it('should return Vec4(b, a, g, g)', () => expect(v.bagg).toBeVec(v[2], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.bagg; + const sw = v.bagg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().bagb', () => { it('should return Vec4(b, a, g, b)', () => expect(v.bagb).toBeVec(v[2], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.bagb; + const sw = v.bagb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baga', () => { it('should return Vec4(b, a, g, a)', () => expect(v.baga).toBeVec(v[2], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.baga; + const sw = v.baga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().babr', () => { it('should return Vec4(b, a, b, r)', () => expect(v.babr).toBeVec(v[2], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.babr; + const sw = v.babr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().babg', () => { it('should return Vec4(b, a, b, g)', () => expect(v.babg).toBeVec(v[2], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.babg; + const sw = v.babg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().babb', () => { it('should return Vec4(b, a, b, b)', () => expect(v.babb).toBeVec(v[2], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.babb; + const sw = v.babb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baba', () => { it('should return Vec4(b, a, b, a)', () => expect(v.baba).toBeVec(v[2], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.baba; + const sw = v.baba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baar', () => { it('should return Vec4(b, a, a, r)', () => expect(v.baar).toBeVec(v[2], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.baar; + const sw = v.baar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baag', () => { it('should return Vec4(b, a, a, g)', () => expect(v.baag).toBeVec(v[2], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.baag; + const sw = v.baag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baab', () => { it('should return Vec4(b, a, a, b)', () => expect(v.baab).toBeVec(v[2], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.baab; + const sw = v.baab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().baaa', () => { it('should return Vec4(b, a, a, a)', () => expect(v.baaa).toBeVec(v[2], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.baaa; + const sw = v.baaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arrr', () => { it('should return Vec4(a, r, r, r)', () => expect(v.arrr).toBeVec(v[3], v[0], v[0], v[0])); it('should be return a copy', () => { - let sw = v.arrr; + const sw = v.arrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arrg', () => { it('should return Vec4(a, r, r, g)', () => expect(v.arrg).toBeVec(v[3], v[0], v[0], v[1])); it('should be return a copy', () => { - let sw = v.arrg; + const sw = v.arrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arrb', () => { it('should return Vec4(a, r, r, b)', () => expect(v.arrb).toBeVec(v[3], v[0], v[0], v[2])); it('should be return a copy', () => { - let sw = v.arrb; + const sw = v.arrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arra', () => { it('should return Vec4(a, r, r, a)', () => expect(v.arra).toBeVec(v[3], v[0], v[0], v[3])); it('should be return a copy', () => { - let sw = v.arra; + const sw = v.arra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().argr', () => { it('should return Vec4(a, r, g, r)', () => expect(v.argr).toBeVec(v[3], v[0], v[1], v[0])); it('should be return a copy', () => { - let sw = v.argr; + const sw = v.argr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().argg', () => { it('should return Vec4(a, r, g, g)', () => expect(v.argg).toBeVec(v[3], v[0], v[1], v[1])); it('should be return a copy', () => { - let sw = v.argg; + const sw = v.argg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().argb', () => { it('should return Vec4(a, r, g, b)', () => expect(v.argb).toBeVec(v[3], v[0], v[1], v[2])); it('should be return a copy', () => { - let sw = v.argb; + const sw = v.argb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arga', () => { it('should return Vec4(a, r, g, a)', () => expect(v.arga).toBeVec(v[3], v[0], v[1], v[3])); it('should be return a copy', () => { - let sw = v.arga; + const sw = v.arga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arbr', () => { it('should return Vec4(a, r, b, r)', () => expect(v.arbr).toBeVec(v[3], v[0], v[2], v[0])); it('should be return a copy', () => { - let sw = v.arbr; + const sw = v.arbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arbg', () => { it('should return Vec4(a, r, b, g)', () => expect(v.arbg).toBeVec(v[3], v[0], v[2], v[1])); it('should be return a copy', () => { - let sw = v.arbg; + const sw = v.arbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arbb', () => { it('should return Vec4(a, r, b, b)', () => expect(v.arbb).toBeVec(v[3], v[0], v[2], v[2])); it('should be return a copy', () => { - let sw = v.arbb; + const sw = v.arbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arba', () => { it('should return Vec4(a, r, b, a)', () => expect(v.arba).toBeVec(v[3], v[0], v[2], v[3])); it('should be return a copy', () => { - let sw = v.arba; + const sw = v.arba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arar', () => { it('should return Vec4(a, r, a, r)', () => expect(v.arar).toBeVec(v[3], v[0], v[3], v[0])); it('should be return a copy', () => { - let sw = v.arar; + const sw = v.arar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arag', () => { it('should return Vec4(a, r, a, g)', () => expect(v.arag).toBeVec(v[3], v[0], v[3], v[1])); it('should be return a copy', () => { - let sw = v.arag; + const sw = v.arag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().arab', () => { it('should return Vec4(a, r, a, b)', () => expect(v.arab).toBeVec(v[3], v[0], v[3], v[2])); it('should be return a copy', () => { - let sw = v.arab; + const sw = v.arab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().araa', () => { it('should return Vec4(a, r, a, a)', () => expect(v.araa).toBeVec(v[3], v[0], v[3], v[3])); it('should be return a copy', () => { - let sw = v.araa; + const sw = v.araa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agrr', () => { it('should return Vec4(a, g, r, r)', () => expect(v.agrr).toBeVec(v[3], v[1], v[0], v[0])); it('should be return a copy', () => { - let sw = v.agrr; + const sw = v.agrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agrg', () => { it('should return Vec4(a, g, r, g)', () => expect(v.agrg).toBeVec(v[3], v[1], v[0], v[1])); it('should be return a copy', () => { - let sw = v.agrg; + const sw = v.agrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agrb', () => { it('should return Vec4(a, g, r, b)', () => expect(v.agrb).toBeVec(v[3], v[1], v[0], v[2])); it('should be return a copy', () => { - let sw = v.agrb; + const sw = v.agrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agra', () => { it('should return Vec4(a, g, r, a)', () => expect(v.agra).toBeVec(v[3], v[1], v[0], v[3])); it('should be return a copy', () => { - let sw = v.agra; + const sw = v.agra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aggr', () => { it('should return Vec4(a, g, g, r)', () => expect(v.aggr).toBeVec(v[3], v[1], v[1], v[0])); it('should be return a copy', () => { - let sw = v.aggr; + const sw = v.aggr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aggg', () => { it('should return Vec4(a, g, g, g)', () => expect(v.aggg).toBeVec(v[3], v[1], v[1], v[1])); it('should be return a copy', () => { - let sw = v.aggg; + const sw = v.aggg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aggb', () => { it('should return Vec4(a, g, g, b)', () => expect(v.aggb).toBeVec(v[3], v[1], v[1], v[2])); it('should be return a copy', () => { - let sw = v.aggb; + const sw = v.aggb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agga', () => { it('should return Vec4(a, g, g, a)', () => expect(v.agga).toBeVec(v[3], v[1], v[1], v[3])); it('should be return a copy', () => { - let sw = v.agga; + const sw = v.agga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agbr', () => { it('should return Vec4(a, g, b, r)', () => expect(v.agbr).toBeVec(v[3], v[1], v[2], v[0])); it('should be return a copy', () => { - let sw = v.agbr; + const sw = v.agbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agbg', () => { it('should return Vec4(a, g, b, g)', () => expect(v.agbg).toBeVec(v[3], v[1], v[2], v[1])); it('should be return a copy', () => { - let sw = v.agbg; + const sw = v.agbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agbb', () => { it('should return Vec4(a, g, b, b)', () => expect(v.agbb).toBeVec(v[3], v[1], v[2], v[2])); it('should be return a copy', () => { - let sw = v.agbb; + const sw = v.agbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agba', () => { it('should return Vec4(a, g, b, a)', () => expect(v.agba).toBeVec(v[3], v[1], v[2], v[3])); it('should be return a copy', () => { - let sw = v.agba; + const sw = v.agba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agar', () => { it('should return Vec4(a, g, a, r)', () => expect(v.agar).toBeVec(v[3], v[1], v[3], v[0])); it('should be return a copy', () => { - let sw = v.agar; + const sw = v.agar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agag', () => { it('should return Vec4(a, g, a, g)', () => expect(v.agag).toBeVec(v[3], v[1], v[3], v[1])); it('should be return a copy', () => { - let sw = v.agag; + const sw = v.agag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agab', () => { it('should return Vec4(a, g, a, b)', () => expect(v.agab).toBeVec(v[3], v[1], v[3], v[2])); it('should be return a copy', () => { - let sw = v.agab; + const sw = v.agab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().agaa', () => { it('should return Vec4(a, g, a, a)', () => expect(v.agaa).toBeVec(v[3], v[1], v[3], v[3])); it('should be return a copy', () => { - let sw = v.agaa; + const sw = v.agaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abrr', () => { it('should return Vec4(a, b, r, r)', () => expect(v.abrr).toBeVec(v[3], v[2], v[0], v[0])); it('should be return a copy', () => { - let sw = v.abrr; + const sw = v.abrr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abrg', () => { it('should return Vec4(a, b, r, g)', () => expect(v.abrg).toBeVec(v[3], v[2], v[0], v[1])); it('should be return a copy', () => { - let sw = v.abrg; + const sw = v.abrg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abrb', () => { it('should return Vec4(a, b, r, b)', () => expect(v.abrb).toBeVec(v[3], v[2], v[0], v[2])); it('should be return a copy', () => { - let sw = v.abrb; + const sw = v.abrb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abra', () => { it('should return Vec4(a, b, r, a)', () => expect(v.abra).toBeVec(v[3], v[2], v[0], v[3])); it('should be return a copy', () => { - let sw = v.abra; + const sw = v.abra; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abgr', () => { it('should return Vec4(a, b, g, r)', () => expect(v.abgr).toBeVec(v[3], v[2], v[1], v[0])); it('should be return a copy', () => { - let sw = v.abgr; + const sw = v.abgr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abgg', () => { it('should return Vec4(a, b, g, g)', () => expect(v.abgg).toBeVec(v[3], v[2], v[1], v[1])); it('should be return a copy', () => { - let sw = v.abgg; + const sw = v.abgg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abgb', () => { it('should return Vec4(a, b, g, b)', () => expect(v.abgb).toBeVec(v[3], v[2], v[1], v[2])); it('should be return a copy', () => { - let sw = v.abgb; + const sw = v.abgb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abga', () => { it('should return Vec4(a, b, g, a)', () => expect(v.abga).toBeVec(v[3], v[2], v[1], v[3])); it('should be return a copy', () => { - let sw = v.abga; + const sw = v.abga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abbr', () => { it('should return Vec4(a, b, b, r)', () => expect(v.abbr).toBeVec(v[3], v[2], v[2], v[0])); it('should be return a copy', () => { - let sw = v.abbr; + const sw = v.abbr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abbg', () => { it('should return Vec4(a, b, b, g)', () => expect(v.abbg).toBeVec(v[3], v[2], v[2], v[1])); it('should be return a copy', () => { - let sw = v.abbg; + const sw = v.abbg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abbb', () => { it('should return Vec4(a, b, b, b)', () => expect(v.abbb).toBeVec(v[3], v[2], v[2], v[2])); it('should be return a copy', () => { - let sw = v.abbb; + const sw = v.abbb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abba', () => { it('should return Vec4(a, b, b, a)', () => expect(v.abba).toBeVec(v[3], v[2], v[2], v[3])); it('should be return a copy', () => { - let sw = v.abba; + const sw = v.abba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abar', () => { it('should return Vec4(a, b, a, r)', () => expect(v.abar).toBeVec(v[3], v[2], v[3], v[0])); it('should be return a copy', () => { - let sw = v.abar; + const sw = v.abar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abag', () => { it('should return Vec4(a, b, a, g)', () => expect(v.abag).toBeVec(v[3], v[2], v[3], v[1])); it('should be return a copy', () => { - let sw = v.abag; + const sw = v.abag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abab', () => { it('should return Vec4(a, b, a, b)', () => expect(v.abab).toBeVec(v[3], v[2], v[3], v[2])); it('should be return a copy', () => { - let sw = v.abab; + const sw = v.abab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().abaa', () => { it('should return Vec4(a, b, a, a)', () => expect(v.abaa).toBeVec(v[3], v[2], v[3], v[3])); it('should be return a copy', () => { - let sw = v.abaa; + const sw = v.abaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aarr', () => { it('should return Vec4(a, a, r, r)', () => expect(v.aarr).toBeVec(v[3], v[3], v[0], v[0])); it('should be return a copy', () => { - let sw = v.aarr; + const sw = v.aarr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aarg', () => { it('should return Vec4(a, a, r, g)', () => expect(v.aarg).toBeVec(v[3], v[3], v[0], v[1])); it('should be return a copy', () => { - let sw = v.aarg; + const sw = v.aarg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aarb', () => { it('should return Vec4(a, a, r, b)', () => expect(v.aarb).toBeVec(v[3], v[3], v[0], v[2])); it('should be return a copy', () => { - let sw = v.aarb; + const sw = v.aarb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aara', () => { it('should return Vec4(a, a, r, a)', () => expect(v.aara).toBeVec(v[3], v[3], v[0], v[3])); it('should be return a copy', () => { - let sw = v.aara; + const sw = v.aara; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aagr', () => { it('should return Vec4(a, a, g, r)', () => expect(v.aagr).toBeVec(v[3], v[3], v[1], v[0])); it('should be return a copy', () => { - let sw = v.aagr; + const sw = v.aagr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aagg', () => { it('should return Vec4(a, a, g, g)', () => expect(v.aagg).toBeVec(v[3], v[3], v[1], v[1])); it('should be return a copy', () => { - let sw = v.aagg; + const sw = v.aagg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aagb', () => { it('should return Vec4(a, a, g, b)', () => expect(v.aagb).toBeVec(v[3], v[3], v[1], v[2])); it('should be return a copy', () => { - let sw = v.aagb; + const sw = v.aagb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaga', () => { it('should return Vec4(a, a, g, a)', () => expect(v.aaga).toBeVec(v[3], v[3], v[1], v[3])); it('should be return a copy', () => { - let sw = v.aaga; + const sw = v.aaga; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aabr', () => { it('should return Vec4(a, a, b, r)', () => expect(v.aabr).toBeVec(v[3], v[3], v[2], v[0])); it('should be return a copy', () => { - let sw = v.aabr; + const sw = v.aabr; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aabg', () => { it('should return Vec4(a, a, b, g)', () => expect(v.aabg).toBeVec(v[3], v[3], v[2], v[1])); it('should be return a copy', () => { - let sw = v.aabg; + const sw = v.aabg; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aabb', () => { it('should return Vec4(a, a, b, b)', () => expect(v.aabb).toBeVec(v[3], v[3], v[2], v[2])); it('should be return a copy', () => { - let sw = v.aabb; + const sw = v.aabb; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaba', () => { it('should return Vec4(a, a, b, a)', () => expect(v.aaba).toBeVec(v[3], v[3], v[2], v[3])); it('should be return a copy', () => { - let sw = v.aaba; + const sw = v.aaba; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaar', () => { it('should return Vec4(a, a, a, r)', () => expect(v.aaar).toBeVec(v[3], v[3], v[3], v[0])); it('should be return a copy', () => { - let sw = v.aaar; + const sw = v.aaar; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaag', () => { it('should return Vec4(a, a, a, g)', () => expect(v.aaag).toBeVec(v[3], v[3], v[3], v[1])); it('should be return a copy', () => { - let sw = v.aaag; + const sw = v.aaag; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaab', () => { it('should return Vec4(a, a, a, b)', () => expect(v.aaab).toBeVec(v[3], v[3], v[3], v[2])); it('should be return a copy', () => { - let sw = v.aaab; + const sw = v.aaab; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + describe('Vec4().aaaa', () => { it('should return Vec4(a, a, a, a)', () => expect(v.aaaa).toBeVec(v[3], v[3], v[3], v[3])); it('should be return a copy', () => { - let sw = v.aaaa; + const sw = v.aaaa; sw[0] += 1; expect(v[0]).not.toEqual(sw[0]); }); }); - + // [/Swizzle Autogen] }); diff --git a/tests/f64/Vec4.spec.ts b/tests/f64/Vec4.spec.ts index 3a94619b..11a46e41 100644 --- a/tests/f64/Vec4.spec.ts +++ b/tests/f64/Vec4.spec.ts @@ -24,12 +24,12 @@ describe('Vec4', () => { }); it('should return Vec4(x, y, z, w) if called with (Vec4(x, y, z, w))', () => { - let v = new Vec4(3.4, 5.6, 7.8, 9); + const v = new Vec4(3.4, 5.6, 7.8, 9); expect(new Vec4(v)).toBeVec(v); }); it('should return Vec4(x, y, z, w) if called with (Float64Array([x, y, z, w]))', () => { - let arr = new Float64Array([1.2, 3.4, 5.6, 7.8]); + const arr = new Float64Array([1.2, 3.4, 5.6, 7.8]); expect(new Vec4(arr)).toBeVec(arr); }); }); @@ -38,7 +38,7 @@ describe('Vec4', () => { let out: Vec4Like; let vecA: Vec4Like; let vecB: Vec4Like; - let result: any; + let result: Vec4Like | number; beforeEach(() => { vecA = new Vec4(1, 2, 3, 4); @@ -406,7 +406,7 @@ describe('Vec4', () => { describe('with a separate output vector', () => { beforeEach(() => { result = Vec4.inverse(out, vecA); }); - it('should place values into out', () => expect(out).toBeVec(1, 1/2, 1/3, 1/4)); + it('should place values into out', () => expect(out).toBeVec(1, 1 / 2, 1 / 3, 1 / 4)); it('should return out', () => expect(result).toBe(out)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 2, 3, 4)); }); @@ -414,7 +414,7 @@ describe('Vec4', () => { describe('when vecA is the output vector', () => { beforeEach(() => { result = Vec4.inverse(vecA, vecA); }); - it('should place values into vecA', () => expect(vecA).toBeVec(1, 1/2, 1/3, 1/4)); + it('should place values into vecA', () => expect(vecA).toBeVec(1, 1 / 2, 1 / 3, 1 / 4)); it('should return vecA', () => expect(result).toBe(vecA)); }); }); @@ -491,7 +491,8 @@ describe('Vec4', () => { }); }); - /*describe('random', () => { + /* + describe('random', () => { describe('with no scale', () => { beforeEach(() => { result = Vec4.random(out); }); @@ -517,7 +518,7 @@ describe('Vec4', () => { }); describe('with a separate output vector', () => { - beforeEach(() => { result = Vec4.cross(out, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(out, vecA, vecB, vecC); }); it('should place values into out', () => expect(out).toBeVec(0, 0, 0, -1)); it('should return out', () => expect(result).toBe(out)); @@ -527,32 +528,33 @@ describe('Vec4', () => { }); describe('when vecA is the output vector', () => { - beforeEach(() => { result = Vec4.cross(vecA, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(vecA, vecA, vecB, vecC); }); - it('should place values into vecA', () => expect(vecA).toBeVec(0, 0, 0,-1)); + it('should place values into vecA', () => expect(vecA).toBeVec(0, 0, 0, -1)); it('should return vecA', () => expect(result).toBe(vecA)); it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); }); describe('when vecB is the output vector', () => { - beforeEach(() => { result = Vec4.cross(vecB, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(vecB, vecA, vecB, vecC); }); - it('should place values into vecB', () => expect(vecB).toBeVec(0, 0, 0,-1)); + it('should place values into vecB', () => expect(vecB).toBeVec(0, 0, 0, -1)); it('should return vecB', () => expect(result).toBe(vecB)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); it('should not modify vecC', () => expect(vecC).toBeVec(0, 0, 1, 0)); }); describe('when vecC is the output vector', () => { - beforeEach(() => { result = Vec4.cross(vecC, vecA,vecB,vecC); }); + beforeEach(() => { result = Vec4.cross(vecC, vecA, vecB, vecC); }); - it('should place values into vecC', () => expect(vecC).toBeVec(0, 0, 0,-1)); + it('should place values into vecC', () => expect(vecC).toBeVec(0, 0, 0, -1)); it('should return vecC', () => expect(result).toBe(vecC)); it('should not modify vecA', () => expect(vecA).toBeVec(1, 0, 0, 0)); it('should not modify vecB', () => expect(vecB).toBeVec(0, 1, 0, 0)); }); }); - /*describe('forEach', () => { + /* + describe('forEach', () => { let vecArray; beforeEach(() => { @@ -648,7 +650,7 @@ describe('Vec4', () => { describe('str', () => { it('should return a string representation of the vector', - () => expect(Vec4.str(vecA)).toEqual('Vec4(1, 2, 3, 4)')); + () => expect(Vec4.str(vecA)).toEqual('Vec4(1, 2, 3, 4)')); }); describe('exactEquals', () => { diff --git a/tests/f64/util.spec.ts b/tests/f64/util.spec.ts index 534dc745..30043e51 100644 --- a/tests/f64/util.spec.ts +++ b/tests/f64/util.spec.ts @@ -5,15 +5,15 @@ import { toDegree, toRadian } from '#gl-matrix/util'; describe('Common', () => { describe('toRadian', () => { it('should return a value of 0 when passed 0', () => expect(toRadian(0)).toBeCloseTo(0)); - it('should return a value of Math.PI/2 when passed 90', () => expect(toRadian(90)).toBeCloseTo(Math.PI/2)); + it('should return a value of Math.PI/2 when passed 90', () => expect(toRadian(90)).toBeCloseTo(Math.PI / 2)); it('should return a value of Math.PI when passed 180', () => expect(toRadian(180)).toBeCloseTo(Math.PI)); - it('should return a value of Math.PI*2 when passed 360', () => expect(toRadian(360)).toBeCloseTo(Math.PI*2)); + it('should return a value of Math.PI*2 when passed 360', () => expect(toRadian(360)).toBeCloseTo(Math.PI * 2)); }); describe('toDegree', () => { it('should return a value of 0 when passed 0', () => expect(toDegree(0)).toBeCloseTo(0)); - it('should return a value of 90 when passed Math.PI/2', () => expect(toDegree(Math.PI/2)).toBeCloseTo(90)); + it('should return a value of 90 when passed Math.PI/2', () => expect(toDegree(Math.PI / 2)).toBeCloseTo(90)); it('should return a value of 180 when passed Math.PI', () => expect(toDegree(Math.PI)).toBeCloseTo(180)); - it('should return a value of 360 when passed Math.PI*2', () => expect(toDegree(Math.PI*2)).toBeCloseTo(360)); + it('should return a value of 360 when passed Math.PI*2', () => expect(toDegree(Math.PI * 2)).toBeCloseTo(360)); }); }); diff --git a/tests/other/classic-api.spec.ts b/tests/other/classic-api.spec.ts index 2ca43b2a..e37b407a 100644 --- a/tests/other/classic-api.spec.ts +++ b/tests/other/classic-api.spec.ts @@ -6,17 +6,16 @@ import * as classic from '#gl-matrix/classic'; const toUpper = (string: string) => string.charAt(0).toUpperCase() + string.slice(1); describe('Classic API', () => { - const classicKeys = Object.keys(classic); - const modernKeys = Object.keys(modern); + const classicKeys = Object.keys(classic); + const modernKeys = Object.keys(modern); - it('Classic API re-exports Modern API', () => - { - // Ensure that the Classic & Modern APIs export the same amount of symbols. - expect(classicKeys.length).toEqual(modernKeys.length); + it('Classic API re-exports Modern API', () => { + // Ensure that the Classic & Modern APIs export the same amount of symbols. + expect(classicKeys.length).toEqual(modernKeys.length); - // Verify that Classic API re-exports the Modern API. - for (const key of classicKeys) { - expect(classic[key]).toEqual(modern[toUpper(key)]); - } - }); + // Verify that Classic API re-exports the Modern API. + for (const key of classicKeys) { + expect(classic[key]).toEqual(modern[toUpper(key)]); + } + }); }); diff --git a/tests/setupExtend.ts b/tests/setupExtend.ts index a6849c24..1aaebd88 100644 --- a/tests/setupExtend.ts +++ b/tests/setupExtend.ts @@ -1,6 +1,15 @@ import { expect } from 'vitest'; -import type { FloatArray, Quat2Like, Vec2Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; +import type { + FloatArray, + Quat2Like, + Mat2Like, + Mat2dLike, + Mat3Like, + Mat4Like, + Vec2Like, + Vec3Like, + Vec4Like } from '#gl-matrix/types'; /** Less precision than `GSM_EPSILON` from #gl-matrix/common. */ const TEST_EPSILON = 0.00001; @@ -11,7 +20,8 @@ interface MatcherResult { } expect.extend({ - toBeVec(received: FloatArray, ...expected: number[] | [FloatArray] | [Vec2Like] | [Vec3Like] | [Vec4Like]): + toBeVec(received: FloatArray, ...expected: number[] | [FloatArray] | [Mat2Like] | [Mat2dLike] | [Mat3Like] | + [Mat4Like] | [Vec2Like] | [Vec3Like] | [Vec4Like]): MatcherResult { let values: number[] | FloatArray; if (expected[0] instanceof Float32Array || expected[0] instanceof Float64Array) { @@ -23,15 +33,15 @@ expect.extend({ return ({ pass: false, message: () => `Expected (${received}) and (${values}) to have the same length. (${ - received.length} != ${values.length})` + received.length} != ${values.length})` }); } - for(let i = 0; i < values.length; ++i) { - if(Math.abs(received[i] - values[i]) >= TEST_EPSILON) { + for (let i = 0; i < values.length; ++i) { + if (Math.abs(received[i] - values[i]) >= TEST_EPSILON) { return ({ pass: false, message: () => `Expected (${received}) to be (${values}), but value[${i}] is not within tolerance. (${ - received[i]} != ${values[i]})` + received[i]} != ${values[i]})` }); } } @@ -42,7 +52,7 @@ expect.extend({ }); }, - //Dual quaternions are very special & unique snowflakes + // Dual quaternions are very special & unique snowflakes toBeQuat2(received: FloatArray, ...expected: number[] | [FloatArray] | [Quat2Like]): MatcherResult { let values: number[] | FloatArray; if (expected[0] instanceof Float32Array || expected[0] instanceof Float64Array) { @@ -56,7 +66,7 @@ expect.extend({ return ({ pass: false, message: () => `Expected (${received}) and (${values}) to have the same length. (${ - received.length} != ${values.length})` + received.length} != ${values.length})` }); } @@ -65,7 +75,7 @@ expect.extend({ return ({ pass: false, message: () => `Expected (${received}) and (${values}) to be equalish. (${ - received.length} != ${values.length})` + received.length} != ${values.length})` }); } @@ -74,7 +84,7 @@ expect.extend({ return ({ pass: false, message: () => `Expected (${received}) and (${values}) to be equalish. (${ - received.length} != ${values.length})` + received.length} != ${values.length})` }); } } else { diff --git a/tests/vitest.d.ts b/tests/vitest.d.ts index 30105e74..caf7ce8c 100644 --- a/tests/vitest.d.ts +++ b/tests/vitest.d.ts @@ -1,13 +1,24 @@ -import type { FloatArray, Quat2Like, Vec2Like, Vec3Like, Vec4Like } from '#gl-matrix/types'; +import type { + FloatArray, + Quat2Like, + Mat2Like, + Mat2dLike, + Mat3Like, + Mat4Like, + Vec2Like, + Vec3Like, + Vec4Like } from '#gl-matrix/types'; /** * Defines custom matchers set in `./setupExtend.ts` via `expect.extend`. */ interface CustomMatchers { - toBeVec: (...expected: number[] | [FloatArray] | [Vec2Like] | [Vec3Like] | [Vec4Like]) => R - toBeQuat2: (...expected: number[] | [FloatArray] | [Quat2Like]) => R + toBeVec: (...expected: number[] | [FloatArray] | [Mat2Like] | [Mat2dLike] | [Mat3Like] | [Mat4Like] | [Vec2Like] | + [Vec3Like] | [Vec4Like]) => R + toBeQuat2: (...expected: number[] | [FloatArray] | [Quat2Like]) => R } declare module 'vitest' { - interface Assertion extends CustomMatchers {} + // eslint-disable-next-line + interface Assertion extends CustomMatchers {} } diff --git a/tsconfig.json b/tsconfig.json index 23641bfb..6ef0b5c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "lib": ["ESNext", "DOM"], "module": "NodeNext", - "moduleResolution": "NodeNext" + "moduleResolution": "NodeNext", + "strictNullChecks": true }, "include": [ "src/**/*", From 6a7fdcbe4f402bbb738b60fca10d5e810565c136 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sun, 23 Jun 2024 01:25:09 -0700 Subject: [PATCH 08/16] Update for binary files. --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitattributes b/.gitattributes index 4923a91d..1e7906ab 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,6 @@ # Set line endings. * text eol=lf + +# Explicitly mark binary files. +*.png binary +*.jpg binary From 5baf7b12d6367e6faf5f73507386a9c1db6762bf Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sun, 23 Jun 2024 01:27:57 -0700 Subject: [PATCH 09/16] Update for binary files. --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 1e7906ab..ba316e18 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,4 @@ # Explicitly mark binary files. *.png binary *.jpg binary +*.ico binary From 821debe00164cdb9d7dc90c46d515f70439c4a17 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Wed, 18 Sep 2024 13:19:50 -0700 Subject: [PATCH 10/16] Update README --- README.md | 119 +++++++----------------------------------------------- 1 file changed, 14 insertions(+), 105 deletions(-) diff --git a/README.md b/README.md index 5045e12c..9f37c2fb 100644 --- a/README.md +++ b/README.md @@ -4,113 +4,22 @@ [![Coverage](https://img.shields.io/codecov/c/github/toji/gl-matrix.svg)](https://codecov.io/github/toji/gl-matrix) [![API Docs](https://img.shields.io/badge/API%20Documentation-476ff0)](https://glmatrix.net/docs/v4/) -`gl-matrix` is a versatile and high-performance JavaScript / TypeScript library for vector and matrix operations, +`gl-matrix` is a versatile and high-performance JavaScript / TypeScript library for vector and matrix operations, optimized for real-time 3D graphics APIs such as WebGL and WebGPU. -## Using Float32Array +Javascript has evolved into a language capable of handling realtime 3D graphics and computationally intensive tasks such +as physics simulations. These types of applications demand high performance vector and matrix math which is something +that Javascript doesn't provide by default. `gl-matrix` to the rescue! -The version 4 release offers a new class based API. +`gl-matrix` is designed to perform vector and matrix operations stupidly fast! By hand-tuning each function for maximum +performance and encouraging efficient usage patterns through API conventions `gl-matrix` will help you get the most out +of your Javascript engine in the browser or preferred Javascript runtime. -```js -import { Vec3 } from 'gl-matrix'; +## What's new in 4.0? +`gl-matrix` 4.0 is the result of a lot of excellent feedback from the community, and features: -const vec = new Vec3(0, 1, 2); -``` - -## Using Float64Array - -If your use case requires additional precision beyond 32-bit floats used by default you can instead use a -64-bit version of the library by importing from the `gl-matrix/f64` sub-path export. - -```js -import { Vec3 } from 'gl-matrix/f64'; - -const vec = new Vec3(0, 1, 2); -``` - -If you have a need to mix and match the 64-bit and 32-bit versions you can do so by importing them as different names. - -```js -import { Vec3 as Vec3F32 } from 'gl-matrix'; -import { Vec3 as Vec3F64 } from 'gl-matrix/f64'; -``` - -All API calls are identical between the two versions and the only difference is the type of TypedArray which the classes extend. - -## Using Typescript / Type Aliases - -All Typescript type aliases are shared across library variants and located in the `gl-matrix/types` sub-path export. - -For Typescript: -```ts -import type { Vec3Like } from 'gl-matrix/types'; -``` - -For JSDoc using the new Typescript 5.5 `@import` tag: -```js -/** - * @import { Vec3Like } from 'gl-matrix/types' - */ -``` - -For JSDoc using the older `import types` Typescript mechanism: -```js -/** - * @type {import('gl-matrix/types').Vec3Like} - */ -``` - -## Classic API - -To facilitate easier adoption of version 4 of `gl-matrix` and maintain essential compatability with existing codebases the modern -API can be accessed via remapped exports matching the version 3 API from the `gl-matrix/classic` sub-path export. The -only change required is altering imports from `gl-matrix` to `gl-matrix/classic`. - -```js -import { vec3 } from 'gl-matrix/classic'; - -const vec = vec3.create(); -``` - -## Enabling Swizzling - -To enable additional swizzle accessors for vector classes invoke the `EnableSwizzles` function from -the `gl-matrix/swizzle` sub-path export. - -```ts -import { Vec3 } from 'gl-matrix'; -import { EnableSwizzles } from 'gl-matrix/swizzle'; - -EnableSwizzles(); - -const vec = new Vec3(0, 1, 2); -const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). -``` - -To enable the 64-bit swizzle accessors use the `gl-matrix/swizzle/f64` sub-path export and invoke `EnableSwizzlesF64`. - -```ts -import { Vec3 } from 'gl-matrix/f64'; -import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; - -EnableSwizzlesF64(); - -const vec = new Vec3(0, 1, 2); -const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). -``` - -Additionally, you may enable ambient module declarations for the respective 32-bit or 64-bit -vector classes when enabling swizzling. This is accomplished by using `side effect` imports as follows. - -```ts -// For `gl-matrix` / 32-bit vector classes. -import 'gl-matrix/types/swizzle'; - -// For `gl-matrix/f64` / 64-bit vector classes. -import 'gl-matrix/types/swizzle/f64'; -``` - -## CommonJS - -This package supports both ES Module and CommonJS formats. For CommonJS usage, replace `import` statements with -`require`. All functionality remains consistent across both module systems. +- Revamped and consistent API (not backward compatible with 3.x, see: Classic API) +- Even more optimizations! +- Written in Typescript. +- A cleaner code base, broken up by type. +- A more complete unit testing suite. From 36bb26f38564968c5a95bb9e3e84b6d5bae7aebe Mon Sep 17 00:00:00 2001 From: typhonrt Date: Wed, 18 Sep 2024 13:20:20 -0700 Subject: [PATCH 11/16] Add separated Markdown API docs. --- docs-md/main/api-usage/1-Using-32-64-API.md | 33 ++++++++++++++++ docs-md/main/api-usage/2-Typescript.md | 26 +++++++++++++ docs-md/main/api-usage/3-Enable-Swizzling.md | 41 ++++++++++++++++++++ docs-md/main/api-usage/4-Classic-API.md | 15 +++++++ docs-md/main/api-usage/5-CommonJS.md | 29 ++++++++++++++ docs-md/main/notes/1-Matrix-Format.md | 30 ++++++++++++++ 6 files changed, 174 insertions(+) create mode 100644 docs-md/main/api-usage/1-Using-32-64-API.md create mode 100644 docs-md/main/api-usage/2-Typescript.md create mode 100644 docs-md/main/api-usage/3-Enable-Swizzling.md create mode 100644 docs-md/main/api-usage/4-Classic-API.md create mode 100644 docs-md/main/api-usage/5-CommonJS.md create mode 100644 docs-md/main/notes/1-Matrix-Format.md diff --git a/docs-md/main/api-usage/1-Using-32-64-API.md b/docs-md/main/api-usage/1-Using-32-64-API.md new file mode 100644 index 00000000..d6e70847 --- /dev/null +++ b/docs-md/main/api-usage/1-Using-32-64-API.md @@ -0,0 +1,33 @@ +--- +title: 1. Float 32 / 64 Versions +category: API Usage +--- +## Using Float32Array + +The version 4 release offers a new class based API. + +```js +import { Vec3 } from 'gl-matrix'; + +const vec = new Vec3(0, 1, 2); +``` + +## Using Float64Array + +If your use case requires additional precision beyond 32-bit floats used by default you can instead use a +64-bit version of the library by importing from the `gl-matrix/f64` sub-path export. + +```js +import { Vec3 } from 'gl-matrix/f64'; + +const vec = new Vec3(0, 1, 2); +``` + +If you have a need to mix and match the 64-bit and 32-bit versions you can do so by importing them as different names. + +```js +import { Vec3 as Vec3F32 } from 'gl-matrix'; +import { Vec3 as Vec3F64 } from 'gl-matrix/f64'; +``` + +All API calls are identical between the two versions and the only difference is the type of TypedArray which the classes extend. diff --git a/docs-md/main/api-usage/2-Typescript.md b/docs-md/main/api-usage/2-Typescript.md new file mode 100644 index 00000000..43aaa9b4 --- /dev/null +++ b/docs-md/main/api-usage/2-Typescript.md @@ -0,0 +1,26 @@ +--- +title: 2. Using Typescript +category: API Usage +--- +## Using Typescript / Type Aliases + +All Typescript type aliases are shared across library variants and located in the `gl-matrix/types` sub-path export. + +For Typescript: +```ts +import type { Vec3Like } from 'gl-matrix/types'; +``` + +For JSDoc using the new Typescript 5.5 `@import` tag: +```js +/** + * @import { Vec3Like } from 'gl-matrix/types' + */ +``` + +For JSDoc using the older `import types` Typescript mechanism: +```js +/** + * @type {import('gl-matrix/types').Vec3Like} + */ +``` diff --git a/docs-md/main/api-usage/3-Enable-Swizzling.md b/docs-md/main/api-usage/3-Enable-Swizzling.md new file mode 100644 index 00000000..1a90edeb --- /dev/null +++ b/docs-md/main/api-usage/3-Enable-Swizzling.md @@ -0,0 +1,41 @@ +--- +title: 3. Enabling Swizzling +category: API Usage +--- +## Enabling Swizzling + +To enable additional swizzle accessors for vector classes invoke the `EnableSwizzles` function from +the `gl-matrix/swizzle` sub-path export. + +```ts +import { Vec3 } from 'gl-matrix'; +import { EnableSwizzles } from 'gl-matrix/swizzle'; + +EnableSwizzles(); + +const vec = new Vec3(0, 1, 2); +const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). +``` + +To enable the 64-bit swizzle accessors use the `gl-matrix/swizzle/f64` sub-path export and invoke `EnableSwizzlesF64`. + +```ts +import { Vec3 } from 'gl-matrix/f64'; +import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + +EnableSwizzlesF64(); + +const vec = new Vec3(0, 1, 2); +const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). +``` + +Additionally, you may enable ambient module declarations for the respective 32-bit or 64-bit +vector classes when enabling swizzling. This is accomplished by using `side effect` imports as follows. + +```ts +// For `gl-matrix` / 32-bit vector classes. +import 'gl-matrix/types/swizzle'; + +// For `gl-matrix/f64` / 64-bit vector classes. +import 'gl-matrix/types/swizzle/f64'; +``` diff --git a/docs-md/main/api-usage/4-Classic-API.md b/docs-md/main/api-usage/4-Classic-API.md new file mode 100644 index 00000000..d184052e --- /dev/null +++ b/docs-md/main/api-usage/4-Classic-API.md @@ -0,0 +1,15 @@ +--- +title: 4. Classic API +category: API Usage +--- +## Classic API + +To facilitate easier adoption of version 4 of `gl-matrix` and maintain essential compatability with existing codebases the modern +API can be accessed via remapped exports matching the version 3 API from the `gl-matrix/classic` sub-path export. The +only change required is altering imports from `gl-matrix` to `gl-matrix/classic`. + +```js +import { vec3 } from 'gl-matrix/classic'; + +const vec = vec3.create(); +``` diff --git a/docs-md/main/api-usage/5-CommonJS.md b/docs-md/main/api-usage/5-CommonJS.md new file mode 100644 index 00000000..c53491db --- /dev/null +++ b/docs-md/main/api-usage/5-CommonJS.md @@ -0,0 +1,29 @@ +--- +title: 5. CommonJS +category: API Usage +--- +## CommonJS + +This package supports both ES Module and CommonJS formats. For CommonJS usage, replace `import` statements with +`require`. All functionality remains consistent across both module systems. + +## Using Float32Array + +The version 4 release offers a new class based API. + +```js +const { Vec3 } = require('gl-matrix'); + +const vec = new Vec3(0, 1, 2); +``` + +## Using Float64Array + +If your use case requires additional precision beyond 32-bit floats used by default you can instead use a +64-bit version of the library by importing from the `gl-matrix/f64` sub-path export. + +```js +const { Vec3 } = require('gl-matrix/f64'); + +const vec = new Vec3(0, 1, 2); +``` diff --git a/docs-md/main/notes/1-Matrix-Format.md b/docs-md/main/notes/1-Matrix-Format.md new file mode 100644 index 00000000..83edf1e8 --- /dev/null +++ b/docs-md/main/notes/1-Matrix-Format.md @@ -0,0 +1,30 @@ +--- +title: 1. Matrix Formatting +category: Notes +--- +## Matrix formatting +`gl-matrix` is modeled after the needs of WebGL, which in turn uses matrix conventions set by OpenGL. Specifically, a +4x4 matrix is an array of 16 contiguous floats with the 13th, 14th, and 15th elements representing the X, Y, and Z, +translation components. + +This may lead to some confusion when referencing OpenGL documentation, however, which represents out all matrices in +column-major format. This means that while in code a matrix may be typed out as: + +``` +[1, 0, 0, 0, +0, 1, 0, 0, +0, 0, 1, 0, +x, y, z, 0] +``` + +The same matrix in the OpenGL documentation is written as: + +``` +1 0 0 x +0 1 0 y +0 0 1 z +0 0 0 0 +``` + +Please rest assured, however, that they are the same thing! This is not unique to `gl-matrix`, either, as OpenGL +developers have long been confused by the apparent lack of consistency between the memory layout and the documentation. From a0452f907bfcc721444e2a6a01b62ec39c89b87e Mon Sep 17 00:00:00 2001 From: typhonrt Date: Wed, 18 Sep 2024 13:21:48 -0700 Subject: [PATCH 12/16] Update config. --- typedoc-cdn.json | 3 +++ typedoc.json | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/typedoc-cdn.json b/typedoc-cdn.json index a7b9a755..90f97dd8 100644 --- a/typedoc-cdn.json +++ b/typedoc-cdn.json @@ -27,6 +27,9 @@ "GitHub": "https://github.com/toji/gl-matrix", "NPM": "https://www.npmjs.com/package/gl-matrix" }, + "navigation": { + "includeCategories": true + }, "sidebarLinks": { "Go to: Node / NPM Distribution": "https://typhonjs-svelte-scratch.github.io/gl-matrix-beta3-dist/" } diff --git a/typedoc.json b/typedoc.json index cd7a0938..e76d7b13 100644 --- a/typedoc.json +++ b/typedoc.json @@ -25,6 +25,10 @@ "GitHub": "https://github.com/toji/gl-matrix", "NPM": "https://www.npmjs.com/package/gl-matrix" }, + "navigation": { + "includeCategories": true + }, + "projectDocuments": ["docs-md/main/**/*.md"], "sidebarLinks": { "Go to: CDN Distribution": "https://typhonjs-svelte-scratch.github.io/gl-matrix-beta3-dist/cdn" } From 1a8ee04f641a62d5e5e7bae1b1c2c11a355c577a Mon Sep 17 00:00:00 2001 From: typhonrt Date: Wed, 18 Sep 2024 13:25:08 -0700 Subject: [PATCH 13/16] Update dist-cdn --- dist-cdn/umd/gl-matrix-f32.js | 32 ++++++++++++++++----------- dist-cdn/umd/gl-matrix-f32.js.map | 2 +- dist-cdn/umd/gl-matrix-f32.min.js | 32 ++++++++++++++++----------- dist-cdn/umd/gl-matrix-f32.min.js.map | 2 +- dist-cdn/umd/gl-matrix-f64.js | 32 ++++++++++++++++----------- dist-cdn/umd/gl-matrix-f64.js.map | 2 +- dist-cdn/umd/gl-matrix-f64.min.js | 32 ++++++++++++++++----------- dist-cdn/umd/gl-matrix-f64.min.js.map | 2 +- 8 files changed, 80 insertions(+), 56 deletions(-) diff --git a/dist-cdn/umd/gl-matrix-f32.js b/dist-cdn/umd/gl-matrix-f32.js index e3b3f6f0..99160597 100644 --- a/dist-cdn/umd/gl-matrix-f32.js +++ b/dist-cdn/umd/gl-matrix-f32.js @@ -91,11 +91,17 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } + function _superPropGet(t, e, o, r) { + var p = _get(_getPrototypeOf(t.prototype ), e, o); + return "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; + } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { - var i = e.call(t, r ); + var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } @@ -773,7 +779,7 @@ return "Mat2(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); _IDENTITY_2X2 = new WeakMap(); __privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([1, 0, 0, 1])); var Mat2 = _Mat2; @@ -1431,7 +1437,7 @@ return "Mat2d(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); _IDENTITY_2X3 = new WeakMap(); __privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([1, 0, 0, 1, 0, 0])); var Mat2d = _Mat2d; @@ -2443,7 +2449,7 @@ return "Mat3(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); _IDENTITY_3X3 = new WeakMap(); __privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); var Mat3 = _Mat3; @@ -4874,7 +4880,7 @@ return "Mat4(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); _IDENTITY_4X4 = new WeakMap(); _TMP_VEC3 = new WeakMap(); __privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])); @@ -6200,7 +6206,7 @@ return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); Vec3.prototype.sub = Vec3.prototype.subtract; Vec3.prototype.mul = Vec3.prototype.multiply; Vec3.prototype.div = Vec3.prototype.divide; @@ -6408,7 +6414,7 @@ }, { key: "copy", value: function copy(a) { - _get(_getPrototypeOf(_Vec4.prototype), "set", this).call(this, a); + _superPropGet(_Vec4, "set", this)([a]); return this; } /** @@ -7399,7 +7405,7 @@ return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); Vec4.prototype.sub = Vec4.prototype.subtract; Vec4.prototype.mul = Vec4.prototype.multiply; Vec4.prototype.div = Vec4.prototype.divide; @@ -7559,7 +7565,7 @@ }, { key: "copy", value: function copy(a) { - _get(_getPrototypeOf(_Quat.prototype), "set", this).call(this, a); + _superPropGet(_Quat, "set", this)([a]); return this; } /** @@ -8539,7 +8545,7 @@ return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3))); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); _DEFAULT_ANGLE_ORDER = new WeakMap(); _TMP_QUAT1 = new WeakMap(); _TMP_QUAT2 = new WeakMap(); @@ -8638,7 +8644,7 @@ }, { key: "copy", value: function copy(a) { - _get(_getPrototypeOf(_Quat2.prototype), "set", this).call(this, a); + _superPropGet(_Quat2, "set", this)([a]); return this; } // =================== @@ -9550,7 +9556,7 @@ return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); _TMP_QUAT = new WeakMap(); _TMP_VEC33 = new WeakMap(); // Temporary variables to prevent repeated allocations in the algorithms within Quat2. @@ -10666,7 +10672,7 @@ return "Vec2(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); Vec2.prototype.sub = Vec2.prototype.subtract; Vec2.prototype.mul = Vec2.prototype.multiply; Vec2.prototype.div = Vec2.prototype.divide; diff --git a/dist-cdn/umd/gl-matrix-f32.js.map b/dist-cdn/umd/gl-matrix-f32.js.map index aab90e7c..83060cac 100644 --- a/dist-cdn/umd/gl-matrix-f32.js.map +++ b/dist-cdn/umd/gl-matrix-f32.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAc,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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line at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.min.js b/dist-cdn/umd/gl-matrix-f32.min.js index 9af348bc..fef36b6a 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.js +++ b/dist-cdn/umd/gl-matrix-f32.min.js @@ -91,11 +91,17 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } + function _superPropGet(t, e, o, r) { + var p = _get(_getPrototypeOf(t.prototype ), e, o); + return "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; + } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { - var i = e.call(t, r ); + var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } @@ -394,7 +400,7 @@ return "Mat2(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); ne = new WeakMap(), Z(C, ne, new Float32Array([1, 0, 0, 1])); var v = C; v.prototype.mul = v.prototype.multiply; @@ -657,7 +663,7 @@ return "Mat2d(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); se = new WeakMap(), Z(H, se, new Float32Array([1, 0, 0, 1, 0, 0])); var _ = H; _.mul = _.multiply; @@ -1059,7 +1065,7 @@ return "Mat3(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); re = new WeakMap(), Z(X, re, new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); var u = X; u.prototype.mul = u.prototype.multiply; @@ -1958,7 +1964,7 @@ return "Mat4(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); ae = new WeakMap(), $ = new WeakMap(), Z(S, ae, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(S, $, new Float32Array(3)); var G = S; G.prototype.mul = G.prototype.multiply; @@ -2506,7 +2512,7 @@ return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - i) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(i)) && Math.abs(r - c) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(c)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); T.prototype.sub = T.prototype.subtract; T.prototype.mul = T.prototype.multiply; T.prototype.div = T.prototype.divide; @@ -2634,7 +2640,7 @@ }, { key: "copy", value: function copy(e) { - return _get(_getPrototypeOf(A.prototype), "set", this).call(this, e), this; + return _superPropGet(A, "set", this)([e]), this; } }, { key: "add", @@ -3000,7 +3006,7 @@ return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(a - L) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(L)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); q.prototype.sub = q.prototype.subtract; q.prototype.mul = q.prototype.multiply; q.prototype.div = q.prototype.divide; @@ -3103,7 +3109,7 @@ }, { key: "copy", value: function copy(e) { - return _get(_getPrototypeOf(f.prototype), "set", this).call(this, e), this; + return _superPropGet(f, "set", this)([e]), this; } }, { key: "identity", @@ -3469,7 +3475,7 @@ return E(f, W)[0] = n[0], E(f, W)[3] = n[1], E(f, W)[6] = n[2], E(f, W)[1] = s[0], E(f, W)[4] = s[1], E(f, W)[7] = s[2], E(f, W)[2] = -t[0], E(f, W)[5] = -t[1], E(f, W)[8] = -t[2], f.normalize(e, f.fromMat3(e, E(f, W))); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); ke = new WeakMap(), ie = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), U = new WeakMap(), le = new WeakMap(), he = new WeakMap(), Z(f, ke, "zyx"), Z(f, ie, new Float32Array(4)), Z(f, ce, new Float32Array(4)), Z(f, W, new Float32Array(9)), Z(f, U, new Float32Array(3)), Z(f, le, new Float32Array([1, 0, 0])), Z(f, he, new Float32Array([0, 1, 0])); var O = f; O.set = q.set; @@ -3523,7 +3529,7 @@ }, { key: "copy", value: function copy(e) { - return _get(_getPrototypeOf(j.prototype), "set", this).call(this, e), this; + return _superPropGet(j, "set", this)([e]), this; } }], [{ key: "BYTE_LENGTH", @@ -3882,7 +3888,7 @@ return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - M) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(M)) && Math.abs(a - h) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(h)) && Math.abs(i - b) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(b)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - o) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(o)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); ye = new WeakMap(), Le = new WeakMap(), Z(j, ye, new Float32Array(4)), Z(j, Le, new Float32Array(3)); var J = j; J.dot = O.dot; @@ -4340,7 +4346,7 @@ return "Vec2(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float32Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float32Array)); N.prototype.sub = N.prototype.subtract; N.prototype.mul = N.prototype.multiply; N.prototype.div = N.prototype.divide; diff --git a/dist-cdn/umd/gl-matrix-f32.min.js.map b/dist-cdn/umd/gl-matrix-f32.min.js.map index 9c2c6b41..af91accf 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.js.map +++ b/dist-cdn/umd/gl-matrix-f32.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float32Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k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13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float32Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*xe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,N as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float32Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-a*Y)*Q,e[2]=(d*B-m*g+o*z)*Q,e[3]=(M*g-l*B-h*z)*Q,e[4]=(y*p-i*P-L*F)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(m*R-b*B-o*x)*Q,e[7]=(k*B-M*R+h*x)*Q,e[8]=(i*I-c*p+L*D)*Q,e[9]=(s*p-n*I-a*D)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*F-i*Y-y*D)*Q,e[13]=(n*Y-s*F+r*D)*Q,e[14]=(d*x-b*z-m*V)*Q,e[15]=(k*z-l*x+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-a*Y,e[2]=d*B-m*g+o*z,e[3]=M*g-l*B-h*z,e[4]=y*p-i*P-L*F,e[5]=n*P-r*p+a*F,e[6]=m*R-b*B-o*x,e[7]=k*B-M*R+h*x,e[8]=i*I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c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0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float32Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*xe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,N as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","mult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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.js b/dist-cdn/umd/gl-matrix-f64.js index 288a2c3a..0d0d94b4 100644 --- a/dist-cdn/umd/gl-matrix-f64.js +++ b/dist-cdn/umd/gl-matrix-f64.js @@ -91,11 +91,17 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } + function _superPropGet(t, e, o, r) { + var p = _get(_getPrototypeOf(t.prototype ), e, o); + return "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; + } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { - var i = e.call(t, r ); + var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } @@ -773,7 +779,7 @@ return "Mat2(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); _IDENTITY_2X2 = new WeakMap(); __privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([1, 0, 0, 1])); var Mat2 = _Mat2; @@ -1431,7 +1437,7 @@ return "Mat2d(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); _IDENTITY_2X3 = new WeakMap(); __privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([1, 0, 0, 1, 0, 0])); var Mat2d = _Mat2d; @@ -2443,7 +2449,7 @@ return "Mat3(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); _IDENTITY_3X3 = new WeakMap(); __privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); var Mat3 = _Mat3; @@ -4874,7 +4880,7 @@ return "Mat4(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); _IDENTITY_4X4 = new WeakMap(); _TMP_VEC3 = new WeakMap(); __privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])); @@ -6200,7 +6206,7 @@ return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); Vec3.prototype.sub = Vec3.prototype.subtract; Vec3.prototype.mul = Vec3.prototype.multiply; Vec3.prototype.div = Vec3.prototype.divide; @@ -6408,7 +6414,7 @@ }, { key: "copy", value: function copy(a) { - _get(_getPrototypeOf(_Vec4.prototype), "set", this).call(this, a); + _superPropGet(_Vec4, "set", this)([a]); return this; } /** @@ -7399,7 +7405,7 @@ return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); Vec4.prototype.sub = Vec4.prototype.subtract; Vec4.prototype.mul = Vec4.prototype.multiply; Vec4.prototype.div = Vec4.prototype.divide; @@ -7559,7 +7565,7 @@ }, { key: "copy", value: function copy(a) { - _get(_getPrototypeOf(_Quat.prototype), "set", this).call(this, a); + _superPropGet(_Quat, "set", this)([a]); return this; } /** @@ -8539,7 +8545,7 @@ return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3))); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); _DEFAULT_ANGLE_ORDER = new WeakMap(); _TMP_QUAT1 = new WeakMap(); _TMP_QUAT2 = new WeakMap(); @@ -8638,7 +8644,7 @@ }, { key: "copy", value: function copy(a) { - _get(_getPrototypeOf(_Quat2.prototype), "set", this).call(this, a); + _superPropGet(_Quat2, "set", this)([a]); return this; } // =================== @@ -9550,7 +9556,7 @@ return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); _TMP_QUAT = new WeakMap(); _TMP_VEC33 = new WeakMap(); // Temporary variables to prevent repeated allocations in the algorithms within Quat2. @@ -10666,7 +10672,7 @@ return "Vec2(".concat(a.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); Vec2.prototype.sub = Vec2.prototype.subtract; Vec2.prototype.mul = Vec2.prototype.multiply; Vec2.prototype.div = Vec2.prototype.divide; diff --git a/dist-cdn/umd/gl-matrix-f64.js.map b/dist-cdn/umd/gl-matrix-f64.js.map index a3d3f192..77031bca 100644 --- a/dist-cdn/umd/gl-matrix-f64.js.map +++ b/dist-cdn/umd/gl-matrix-f64.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAc,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.min.js b/dist-cdn/umd/gl-matrix-f64.min.js index a76c8773..8e876e01 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.js +++ b/dist-cdn/umd/gl-matrix-f64.min.js @@ -91,11 +91,17 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } + function _superPropGet(t, e, o, r) { + var p = _get(_getPrototypeOf(t.prototype ), e, o); + return "function" == typeof p ? function (t) { + return p.apply(o, t); + } : p; + } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { - var i = e.call(t, r ); + var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } @@ -394,7 +400,7 @@ return "Mat2(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); ne = new WeakMap(), Z(C, ne, new Float64Array([1, 0, 0, 1])); var v = C; v.prototype.mul = v.prototype.multiply; @@ -657,7 +663,7 @@ return "Mat2d(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); se = new WeakMap(), Z(H, se, new Float64Array([1, 0, 0, 1, 0, 0])); var _ = H; _.mul = _.multiply; @@ -1059,7 +1065,7 @@ return "Mat3(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); re = new WeakMap(), Z(X, re, new Float64Array([1, 0, 0, 0, 1, 0, 0, 0, 1])); var u = X; u.prototype.mul = u.prototype.multiply; @@ -1958,7 +1964,7 @@ return "Mat4(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); ae = new WeakMap(), $ = new WeakMap(), Z(S, ae, new Float64Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])), Z(S, $, new Float64Array(3)); var G = S; G.prototype.mul = G.prototype.multiply; @@ -2506,7 +2512,7 @@ return Math.abs(n - a) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(s - i) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(i)) && Math.abs(r - c) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(c)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); T.prototype.sub = T.prototype.subtract; T.prototype.mul = T.prototype.multiply; T.prototype.div = T.prototype.divide; @@ -2634,7 +2640,7 @@ }, { key: "copy", value: function copy(e) { - return _get(_getPrototypeOf(A.prototype), "set", this).call(this, e), this; + return _superPropGet(A, "set", this)([e]), this; } }, { key: "add", @@ -3000,7 +3006,7 @@ return Math.abs(n - i) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(i)) && Math.abs(s - c) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(c)) && Math.abs(r - y) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(y)) && Math.abs(a - L) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(L)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); q.prototype.sub = q.prototype.subtract; q.prototype.mul = q.prototype.multiply; q.prototype.div = q.prototype.divide; @@ -3103,7 +3109,7 @@ }, { key: "copy", value: function copy(e) { - return _get(_getPrototypeOf(f.prototype), "set", this).call(this, e), this; + return _superPropGet(f, "set", this)([e]), this; } }, { key: "identity", @@ -3469,7 +3475,7 @@ return E(f, W)[0] = n[0], E(f, W)[3] = n[1], E(f, W)[6] = n[2], E(f, W)[1] = s[0], E(f, W)[4] = s[1], E(f, W)[7] = s[2], E(f, W)[2] = -t[0], E(f, W)[5] = -t[1], E(f, W)[8] = -t[2], f.normalize(e, f.fromMat3(e, E(f, W))); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); ke = new WeakMap(), ie = new WeakMap(), ce = new WeakMap(), W = new WeakMap(), U = new WeakMap(), le = new WeakMap(), he = new WeakMap(), Z(f, ke, "zyx"), Z(f, ie, new Float64Array(4)), Z(f, ce, new Float64Array(4)), Z(f, W, new Float64Array(9)), Z(f, U, new Float64Array(3)), Z(f, le, new Float64Array([1, 0, 0])), Z(f, he, new Float64Array([0, 1, 0])); var O = f; O.set = q.set; @@ -3523,7 +3529,7 @@ }, { key: "copy", value: function copy(e) { - return _get(_getPrototypeOf(j.prototype), "set", this).call(this, e), this; + return _superPropGet(j, "set", this)([e]), this; } }], [{ key: "BYTE_LENGTH", @@ -3882,7 +3888,7 @@ return Math.abs(n - k) <= 1e-6 * Math.max(1, Math.abs(n), Math.abs(k)) && Math.abs(s - l) <= 1e-6 * Math.max(1, Math.abs(s), Math.abs(l)) && Math.abs(r - M) <= 1e-6 * Math.max(1, Math.abs(r), Math.abs(M)) && Math.abs(a - h) <= 1e-6 * Math.max(1, Math.abs(a), Math.abs(h)) && Math.abs(i - b) <= 1e-6 * Math.max(1, Math.abs(i), Math.abs(b)) && Math.abs(c - d) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(d)) && Math.abs(y - m) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(m)) && Math.abs(L - o) <= 1e-6 * Math.max(1, Math.abs(L), Math.abs(o)); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); ye = new WeakMap(), Le = new WeakMap(), Z(j, ye, new Float64Array(4)), Z(j, Le, new Float64Array(3)); var J = j; J.dot = O.dot; @@ -4340,7 +4346,7 @@ return "Vec2(".concat(e.join(", "), ")"); } }]); - }( /*#__PURE__*/_wrapNativeSuper(Float64Array)); + }(/*#__PURE__*/_wrapNativeSuper(Float64Array)); N.prototype.sub = N.prototype.subtract; N.prototype.mul = N.prototype.multiply; N.prototype.div = N.prototype.divide; diff --git a/dist-cdn/umd/gl-matrix-f64.min.js.map b/dist-cdn/umd/gl-matrix-f64.min.js.map index 3284a010..e90f7a4f 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.js.map +++ b/dist-cdn/umd/gl-matrix-f64.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float64Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-a*Y)*Q,e[2]=(d*B-m*g+o*z)*Q,e[3]=(M*g-l*B-h*z)*Q,e[4]=(y*p-i*P-L*F)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(m*R-b*B-o*x)*Q,e[7]=(k*B-M*R+h*x)*Q,e[8]=(i*I-c*p+L*D)*Q,e[9]=(s*p-n*I-a*D)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*F-i*Y-y*D)*Q,e[13]=(n*Y-s*F+r*D)*Q,e[14]=(d*x-b*z-m*V)*Q,e[15]=(k*z-l*x+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-a*Y,e[2]=d*B-m*g+o*z,e[3]=M*g-l*B-h*z,e[4]=y*p-i*P-L*F,e[5]=n*P-r*p+a*F,e[6]=m*R-b*B-o*x,e[7]=k*B-M*R+h*x,e[8]=i*I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float64Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*xe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAmF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAApEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;EAAAF,QAAAA,CAAA,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;EAAA,OAAA;QACb,QAAQF,CAAA,CAAOD,MAAA;UACb,KAAK,CAAA;EACHJ,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA,CAAA,GAAMO,CAAM,CAAA,CAAA,CAAA;EAAG,UAAA,MAAA;UACjB,KAAK,CAAA;EACHL,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA,CAAA,EAAMO,CAAAA,CAAA,CAAO,CAAC,CAAsBA,EAAAA,CAAA,CAAO,CAAC,GAAG,CAAC,CAAA,CAAA,CAAA;EAAG,UAAA,MAAA;UACrD,KAAK,CAAA;EACH,UAAA,IAAMI,CAAA,GAAIJ,CAAA,CAAO,CAAC,CAAA,CAAA;EACd,UAAA,OAAOI,CAAA,IAAM,QAAAT,GAAAA,KAAA,GAAAQ,UAAA,CAAAV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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float64Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-a*Y)*Q,e[2]=(d*B-m*g+o*z)*Q,e[3]=(M*g-l*B-h*z)*Q,e[4]=(y*p-i*P-L*F)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(m*R-b*B-o*x)*Q,e[7]=(k*B-M*R+h*x)*Q,e[8]=(i*I-c*p+L*D)*Q,e[9]=(s*p-n*I-a*D)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=(l*R-k*g-h*V)*Q,e[12]=(c*F-i*Y-y*D)*Q,e[13]=(n*Y-s*F+r*D)*Q,e[14]=(d*x-b*z-m*V)*Q,e[15]=(k*z-l*x+M*V)*Q,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m;return e[0]=c*P-y*I+L*Y,e[1]=r*I-s*P-a*Y,e[2]=d*B-m*g+o*z,e[3]=M*g-l*B-h*z,e[4]=y*p-i*P-L*F,e[5]=n*P-r*p+a*F,e[6]=m*R-b*B-o*x,e[7]=k*B-M*R+h*x,e[8]=i*I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float64Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*xe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAmF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAApEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;EAAAF,QAAAA,CAAA,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;EAAA,OAAA;QACb,QAAQF,CAAA,CAAOD,MAAA;UACb,KAAK,CAAA;EACHJ,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA,CAAA,GAAMO,CAAM,CAAA,CAAA,CAAA;EAAG,UAAA,MAAA;UACjB,KAAK,CAAA;EACHL,UAAAA,KAAA,GAAAQ,UAAA,CAAAV,IAAAA,EAAAA,CAAA,EAAMO,CAAAA,CAAA,CAAO,CAAC,CAAsBA,EAAAA,CAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file From 5c993cbdfa8959ce05d1e897c76691e4afb4dc4e Mon Sep 17 00:00:00 2001 From: typhonrt Date: Wed, 18 Sep 2024 13:25:21 -0700 Subject: [PATCH 14/16] Update dependencies. --- package-lock.json | 3983 +++++++++++++++++++++++++++------------------ package.json | 23 +- 2 files changed, 2400 insertions(+), 1606 deletions(-) diff --git a/package-lock.json b/package-lock.json index fab68f9d..012bb553 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,20 +9,19 @@ "version": "4.0.0-beta.3", "license": "MIT", "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/preset-env": "^7.24.7", + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.4", "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", - "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", - "@vitest/coverage-v8": "^1.6.0", - "@vitest/ui": "^1.6.0", - "esbuild": "^0.21.0", - "eslint": "^9.5.0", - "rollup": "^4.18.0", - "typedoc": "0.25.12", - "typescript": "^5.4.0", - "typescript-eslint": "rc-v8", - "vitest": "^1.6.0" + "@typhonjs-typedoc/typedoc-pkg": "^0.1.0", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", + "esbuild": "^0.23.0", + "eslint": "^9.10.0", + "rollup": "^4.21.0", + "typescript": "^5.6.0", + "typescript-eslint": "^8.6.0", + "vitest": "^2.1.0" } }, "node_modules/@ampproject/remapping": { @@ -52,30 +51,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", - "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", + "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", - "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", + "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helpers": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -91,12 +90,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", - "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", + "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", "dev": true, "dependencies": { - "@babel/types": "^7.24.7", + "@babel/types": "^7.25.6", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" @@ -131,14 +130,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", - "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -147,19 +146,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", - "integrity": "sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.4.tgz", + "integrity": "sha512-ro/bFs3/84MDgDmMwbcHgDa8/E6J3QKNTk4xJJnVeFtGE+tL0K26E3pNxhYz2b67fJpt7Aphw5XcploKXuCvCQ==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.8", "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7", + "@babel/helper-replace-supers": "^7.25.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/traverse": "^7.25.4", "semver": "^6.3.1" }, "engines": { @@ -170,9 +167,9 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz", - "integrity": "sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", + "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", @@ -202,51 +199,14 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", - "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", - "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", - "dev": true, - "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", - "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.7.tgz", - "integrity": "sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", + "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -266,16 +226,15 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", - "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", "@babel/helper-module-imports": "^7.24.7", "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7" + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" }, "engines": { "node": ">=6.9.0" @@ -297,23 +256,23 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.7.tgz", - "integrity": "sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.7.tgz", - "integrity": "sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", + "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-wrap-function": "^7.24.7" + "@babel/helper-wrap-function": "^7.25.0", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -323,14 +282,14 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.7.tgz", - "integrity": "sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", + "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.7", - "@babel/helper-optimise-call-expression": "^7.24.7" + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -365,22 +324,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", - "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", - "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -396,37 +343,36 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", - "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.24.7.tgz", - "integrity": "sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", + "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.24.7", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", - "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", + "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", "dev": true, "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6" }, "engines": { "node": ">=6.9.0" @@ -448,10 +394,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", - "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", "dev": true, + "dependencies": { + "@babel/types": "^7.25.6" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -460,13 +409,28 @@ } }, "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.7.tgz", - "integrity": "sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==", + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.3.tgz", + "integrity": "sha512-wUrcsxZg6rqBXG05HG1FPYgsP6EvwF4WpBbxIpWIIYnH8wG0gzx3yZY3dtEHas4sTAOGkbTsc9EGPxwff8lRoA==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.0.tgz", + "integrity": "sha512-Bm4bH2qsX880b/3ziJ8KD711LT7z4u8CFudmjqle65AZj/HNUFhEf90dqYv6O86buWvSBmeQDjv0Tn2aF/bIBA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -476,12 +440,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.7.tgz", - "integrity": "sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", + "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -508,13 +472,13 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.7.tgz", - "integrity": "sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.0.tgz", + "integrity": "sha512-tggFrk1AIShG/RUQbEwt2Tr/E+ObkfwrPjR6BjbRvsx24+PSjK8zrq0GWPNCjo8qpRx4DuJzlcvWJqlm+0h3kw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -599,12 +563,12 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", - "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.6.tgz", + "integrity": "sha512-aABl0jHw9bZ2karQ/uUD6XP4u0SG22SJrOHFoL6XB1R7dTovOP4TzTlsxOYC5yQ1pdscVK2JTUnF6QL3ARoAiQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -614,12 +578,12 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", - "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz", + "integrity": "sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -786,15 +750,15 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.7.tgz", - "integrity": "sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.4.tgz", + "integrity": "sha512-jz8cV2XDDTqjKPwVPJBIjORVEmSGYhdRa8e5k5+vN+uwcjSrSxUaebBRa4ko1jqNF2uxyg8G6XYk30Jv285xzg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7", - "@babel/plugin-syntax-async-generators": "^7.8.4" + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-remap-async-to-generator": "^7.25.0", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/traverse": "^7.25.4" }, "engines": { "node": ">=6.9.0" @@ -836,12 +800,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.7.tgz", - "integrity": "sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", + "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -851,13 +815,13 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.7.tgz", - "integrity": "sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.4.tgz", + "integrity": "sha512-nZeZHyCWPfjkdU5pA/uHiTaDAFUEqkpzf1YoQT2NeSynCGYq9rxfyI3XpQbfx/a0hSnFH6TGlEXvae5Vi7GD8g==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -884,18 +848,16 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.7.tgz", - "integrity": "sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.4.tgz", + "integrity": "sha512-oexUfaQle2pF/b6E0dwsxQtAol9TLSO88kQvym6HHBWFliV2lGdrPieX+WgMRLSJDVzdYywk7jXbLPuO2KLTLg==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/traverse": "^7.25.4", "globals": "^11.1.0" }, "engines": { @@ -922,12 +884,12 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.7.tgz", - "integrity": "sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", + "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -967,6 +929,22 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.0.tgz", + "integrity": "sha512-YLpb4LlYSc3sCUa35un84poXoraOiQucUTTu8X1j18JV+gNa8E0nyUf/CjZ171IRGr4jEguF+vzJU66QZhn29g==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/plugin-transform-dynamic-import": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", @@ -1032,14 +1010,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.7.tgz", - "integrity": "sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==", + "version": "7.25.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", + "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.1" }, "engines": { "node": ">=6.9.0" @@ -1065,12 +1043,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz", - "integrity": "sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", + "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1127,13 +1105,13 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.7.tgz", - "integrity": "sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", + "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-simple-access": "^7.24.7" }, "engines": { @@ -1144,15 +1122,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.7.tgz", - "integrity": "sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", + "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -1291,12 +1269,12 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.7.tgz", - "integrity": "sha512-tK+0N9yd4j+x/4hxF3F0e0fu/VdcxU18y5SevtyM/PCFlQvXbR0Zmlo2eBrKtVipGNFzpq56o8WsIIKcJFUCRQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", + "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, @@ -1323,13 +1301,13 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.7.tgz", - "integrity": "sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.4.tgz", + "integrity": "sha512-ao8BG7E2b/URaUQGqN3Tlsg+M3KlHY6rJ1O1gXAEUnZoyNQnvKyH87Kfg+FoxSeyWUB8ISZZsC91C44ZuBFytw==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1464,12 +1442,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.7.tgz", - "integrity": "sha512-VtR8hDy7YLB7+Pet9IarXjg/zgCMSF+1mNS/EQEiEaUPoFXCVsHG64SIxcaaI2zJgRiv+YmgaQESUfWAdbjzgg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", + "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1526,13 +1504,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.7.tgz", - "integrity": "sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.4.tgz", + "integrity": "sha512-qesBxiWkgN1Q+31xUE9RcMk79eOXXDCv6tfyGMRSs4RGlioSg2WVyQAm07k726cSE56pa+Kb0y9epX2qaXzTvA==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1542,19 +1520,20 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.7.tgz", - "integrity": "sha512-1YZNsc+y6cTvWlDHidMBsQZrZfEFjRIo/BZCT906PMdzOyXtSLTgqGdrpcuTDCXyd11Am5uQULtDIcCfnTc8fQ==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.7", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.7", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.4.tgz", + "integrity": "sha512-W9Gyo+KmcxjGahtt3t9fb14vFRWvPpu5pT6GBlovAK6BTBcxgjfVMSQCfJl4oi35ODrxP6xx2Wr8LNST57Mraw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.25.4", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.0", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", @@ -1575,29 +1554,30 @@ "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", "@babel/plugin-transform-arrow-functions": "^7.24.7", - "@babel/plugin-transform-async-generator-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoped-functions": "^7.24.7", - "@babel/plugin-transform-block-scoping": "^7.24.7", - "@babel/plugin-transform-class-properties": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-class-static-block": "^7.24.7", - "@babel/plugin-transform-classes": "^7.24.7", + "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", - "@babel/plugin-transform-destructuring": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-dotall-regex": "^7.24.7", "@babel/plugin-transform-duplicate-keys": "^7.24.7", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.0", "@babel/plugin-transform-dynamic-import": "^7.24.7", "@babel/plugin-transform-exponentiation-operator": "^7.24.7", "@babel/plugin-transform-export-namespace-from": "^7.24.7", "@babel/plugin-transform-for-of": "^7.24.7", - "@babel/plugin-transform-function-name": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-json-strings": "^7.24.7", - "@babel/plugin-transform-literals": "^7.24.7", + "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-member-expression-literals": "^7.24.7", "@babel/plugin-transform-modules-amd": "^7.24.7", - "@babel/plugin-transform-modules-commonjs": "^7.24.7", - "@babel/plugin-transform-modules-systemjs": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-modules-systemjs": "^7.25.0", "@babel/plugin-transform-modules-umd": "^7.24.7", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-new-target": "^7.24.7", @@ -1606,9 +1586,9 @@ "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-object-super": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", - "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.25.4", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-property-literals": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", @@ -1617,16 +1597,16 @@ "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-template-literals": "^7.24.7", - "@babel/plugin-transform-typeof-symbol": "^7.24.7", + "@babel/plugin-transform-typeof-symbol": "^7.24.8", "@babel/plugin-transform-unicode-escapes": "^7.24.7", "@babel/plugin-transform-unicode-property-regex": "^7.24.7", "@babel/plugin-transform-unicode-regex": "^7.24.7", - "@babel/plugin-transform-unicode-sets-regex": "^7.24.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.4", "@babel/preset-modules": "0.1.6-no-external-plugins", "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.10.4", + "babel-plugin-polyfill-corejs3": "^0.10.6", "babel-plugin-polyfill-regenerator": "^0.6.1", - "core-js-compat": "^3.31.0", + "core-js-compat": "^3.37.1", "semver": "^6.3.1" }, "engines": { @@ -1657,9 +1637,9 @@ "dev": true }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", + "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -1669,33 +1649,30 @@ } }, "node_modules/@babel/template": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", - "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "dependencies": { "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", - "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", + "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1704,12 +1681,12 @@ } }, "node_modules/@babel/types": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", - "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-string-parser": "^7.24.8", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -1741,9 +1718,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", "cpu": [ "ppc64" ], @@ -1753,13 +1730,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", "cpu": [ "arm" ], @@ -1769,13 +1746,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", "cpu": [ "arm64" ], @@ -1785,13 +1762,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", "cpu": [ "x64" ], @@ -1801,13 +1778,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", "cpu": [ "arm64" ], @@ -1817,13 +1794,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", "cpu": [ "x64" ], @@ -1833,13 +1810,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", "cpu": [ "arm64" ], @@ -1849,13 +1826,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", "cpu": [ "x64" ], @@ -1865,13 +1842,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", "cpu": [ "arm" ], @@ -1881,13 +1858,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", "cpu": [ "arm64" ], @@ -1897,13 +1874,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", "cpu": [ "ia32" ], @@ -1913,13 +1890,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", "cpu": [ "loong64" ], @@ -1929,13 +1906,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", "cpu": [ "mips64el" ], @@ -1945,13 +1922,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", "cpu": [ "ppc64" ], @@ -1961,13 +1938,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", "cpu": [ "riscv64" ], @@ -1977,13 +1954,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", "cpu": [ "s390x" ], @@ -1993,13 +1970,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", "cpu": [ "x64" ], @@ -2009,13 +1986,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", "cpu": [ "x64" ], @@ -2025,13 +2002,29 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", "cpu": [ "x64" ], @@ -2041,13 +2034,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", "cpu": [ "x64" ], @@ -2057,13 +2050,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", "cpu": [ "arm64" ], @@ -2073,13 +2066,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", "cpu": [ "ia32" ], @@ -2089,13 +2082,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", "cpu": [ "x64" ], @@ -2105,7 +2098,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -2136,50 +2129,28 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", + "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", - "integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", "dev": true, "dependencies": { "@eslint/object-schema": "^2.1.4", "debug": "^4.3.1", - "minimatch": "^3.0.5" + "minimatch": "^3.1.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@eslint/eslintrc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", @@ -2203,16 +2174,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", @@ -2225,22 +2186,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@eslint/js": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", - "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", + "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2255,6 +2204,18 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/plugin-kit": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", + "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "dev": true, + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -2298,25 +2259,40 @@ "node": ">=12" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { - "@sinclair/typebox": "^0.27.8" + "ansi-regex": "^6.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" } }, "node_modules/@jridgewell/gen-mapping": { @@ -2352,9 +2328,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -2413,9 +2389,9 @@ } }, "node_modules/@polka/url": { - "version": "1.0.0-next.25", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", - "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", + "version": "1.0.0-next.27", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.27.tgz", + "integrity": "sha512-MU0SYgcrBdSVLu7Tfow3VY4z1odzlaTYRjt3WQ0z8XbjDWReuy+EALt2HdjhrwD2HPiW2GY+KTSw4HLv4C/EOA==", "dev": true }, "node_modules/@rollup/plugin-alias": { @@ -2487,9 +2463,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz", + "integrity": "sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg==", "cpu": [ "arm" ], @@ -2500,9 +2476,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz", + "integrity": "sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g==", "cpu": [ "arm64" ], @@ -2513,9 +2489,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz", + "integrity": "sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ==", "cpu": [ "arm64" ], @@ -2526,9 +2502,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz", + "integrity": "sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA==", "cpu": [ "x64" ], @@ -2539,9 +2515,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz", + "integrity": "sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g==", "cpu": [ "arm" ], @@ -2552,9 +2528,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz", + "integrity": "sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA==", "cpu": [ "arm" ], @@ -2565,9 +2541,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz", + "integrity": "sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw==", "cpu": [ "arm64" ], @@ -2578,9 +2554,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz", + "integrity": "sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ==", "cpu": [ "arm64" ], @@ -2591,9 +2567,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz", + "integrity": "sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw==", "cpu": [ "ppc64" ], @@ -2604,9 +2580,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz", + "integrity": "sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ==", "cpu": [ "riscv64" ], @@ -2617,9 +2593,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz", + "integrity": "sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg==", "cpu": [ "s390x" ], @@ -2630,9 +2606,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz", + "integrity": "sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==", "cpu": [ "x64" ], @@ -2643,9 +2619,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz", + "integrity": "sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg==", "cpu": [ "x64" ], @@ -2656,9 +2632,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz", + "integrity": "sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q==", "cpu": [ "arm64" ], @@ -2669,9 +2645,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz", + "integrity": "sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA==", "cpu": [ "ia32" ], @@ -2682,9 +2658,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz", + "integrity": "sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA==", "cpu": [ "x64" ], @@ -2694,11 +2670,61 @@ "win32" ] }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true + "node_modules/@shikijs/core": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.7.tgz", + "integrity": "sha512-ZnIDxFu/yvje3Q8owSHaEHd+bu/jdWhHAaJ17ggjXofHx5rc4bhpCSW+OjC6smUBi5s5dd023jWtZ1gzMu/yrw==", + "dev": true, + "peer": true, + "dependencies": { + "@shikijs/engine-javascript": "1.17.7", + "@shikijs/engine-oniguruma": "1.17.7", + "@shikijs/types": "1.17.7", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.2" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.17.7.tgz", + "integrity": "sha512-wwSf7lKPsm+hiYQdX+1WfOXujtnUG6fnN4rCmExxa4vo+OTmvZ9B1eKauilvol/LHUPrQgW12G3gzem7pY5ckw==", + "dev": true, + "peer": true, + "dependencies": { + "@shikijs/types": "1.17.7", + "@shikijs/vscode-textmate": "^9.2.2", + "oniguruma-to-js": "0.4.3" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.17.7.tgz", + "integrity": "sha512-pvSYGnVeEIconU28NEzBXqSQC/GILbuNbAHwMoSfdTBrobKAsV1vq2K4cAgiaW1TJceLV9QMGGh18hi7cCzbVQ==", + "dev": true, + "peer": true, + "dependencies": { + "@shikijs/types": "1.17.7", + "@shikijs/vscode-textmate": "^9.2.2" + } + }, + "node_modules/@shikijs/types": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.17.7.tgz", + "integrity": "sha512-+qA4UyhWLH2q4EFd+0z4K7GpERDU+c+CN2XYD3sC+zjvAr5iuwD1nToXZMt1YODshjkEGEDV86G7j66bKjqDdg==", + "dev": true, + "peer": true, + "dependencies": { + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.2.2.tgz", + "integrity": "sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==", + "dev": true, + "peer": true }, "node_modules/@ts-morph/common": { "version": "0.23.0", @@ -2712,16 +2738,40 @@ "path-browserify": "^1.0.1" } }, + "node_modules/@ts-morph/common/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@ts-morph/common/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@types/cytoscape": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.4.tgz", - "integrity": "sha512-g4M57Zho+AMNYuEptTWH+aZ5VpyF8VcaI2t0+1/PWRZp5XQM6hku1Vo5/Ui721i+L+WCGkI1EjGAeHcYUQ2PRg==", + "version": "3.21.8", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.8.tgz", + "integrity": "sha512-6Bo9ZDrv0vfwe8Sg/ERc5VL0yU0gYvP4dgZi0fAXYkKHfyHaNqWRMcwYm3mu4sLsXbB8ZuXE75sR7qnaOL5JgQ==", "dev": true }, "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "version": "8.56.12", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz", + "integrity": "sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==", "dev": true, "dependencies": { "@types/estree": "*", @@ -2729,28 +2779,55 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "peer": true + }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0-alpha.30.tgz", - "integrity": "sha512-2CBUupdkfbE3eATph4QeZejvT+M+1bVur+zXlVx09WN31phap51ps/qemeclnCbGEz6kTgBDmScrr9XmmF8/Pg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.6.0.tgz", + "integrity": "sha512-UOaz/wFowmoh2G6Mr9gw60B1mm0MzUtm6Ic8G2yM1Le6gyj5Loi/N+O5mocugRGY+8OeeKmkMmbxNqUCq3B4Sg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.0.0-alpha.30", - "@typescript-eslint/type-utils": "8.0.0-alpha.30", - "@typescript-eslint/utils": "8.0.0-alpha.30", - "@typescript-eslint/visitor-keys": "8.0.0-alpha.30", + "@typescript-eslint/scope-manager": "8.6.0", + "@typescript-eslint/type-utils": "8.6.0", + "@typescript-eslint/utils": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -2774,15 +2851,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0-alpha.30.tgz", - "integrity": "sha512-tAYgFmgXU1MlCK3nbblUvJlDSibBvxtAQXGrF3IG0KmnRza9FXILZifHWL0rrwacDn40K53K607Fk2QkMjiGgw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.6.0.tgz", + "integrity": "sha512-eQcbCuA2Vmw45iGfcyG4y6rS7BhWfz9MQuk409WD47qMM+bKCGQWXxvoOs1DUp+T7UBMTtRTVT+kXr7Sh4O9Ow==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.0.0-alpha.30", - "@typescript-eslint/types": "8.0.0-alpha.30", - "@typescript-eslint/typescript-estree": "8.0.0-alpha.30", - "@typescript-eslint/visitor-keys": "8.0.0-alpha.30", + "@typescript-eslint/scope-manager": "8.6.0", + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/typescript-estree": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0", "debug": "^4.3.4" }, "engines": { @@ -2802,9 +2879,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", - "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2815,13 +2892,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.0-alpha.30.tgz", - "integrity": "sha512-FGW/iPWGyPFamAVZ60oCAthMqQrqafUGebF8UKuq/ha+e9SVG6YhJoRzurlQXOVf8dHfOhJ0ADMXyFnMc53clg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.6.0.tgz", + "integrity": "sha512-ZuoutoS5y9UOxKvpc/GkvF4cuEmpokda4wRg64JEia27wX+PysIE9q+lzDtlHHgblwUWwo5/Qn+/WyTUvDwBHw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.0.0-alpha.30", - "@typescript-eslint/visitor-keys": "8.0.0-alpha.30" + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2832,9 +2909,9 @@ } }, "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", - "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2845,13 +2922,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.0-alpha.30.tgz", - "integrity": "sha512-FrnhlCKEKZKRbpDviHkIU9tayIUGTOfa+SjvrRv6p/AJIUv6QT8oRboRjLH/cCuwUEbM0k5UtRWYug4albHUqQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.6.0.tgz", + "integrity": "sha512-dtePl4gsuenXVwC7dVNlb4mGDcKjDT/Ropsk4za/ouMBPplCLyznIaR+W65mvCvsyS97dymoBRrioEXI7k0XIg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.0.0-alpha.30", - "@typescript-eslint/utils": "8.0.0-alpha.30", + "@typescript-eslint/typescript-estree": "8.6.0", + "@typescript-eslint/utils": "8.6.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -2869,9 +2946,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.1.tgz", - "integrity": "sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -2882,15 +2959,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.0-alpha.30.tgz", - "integrity": "sha512-WSXbc9ZcXI+7yC+6q95u77i8FXz6HOLsw3ST+vMUlFy1lFbXyFL/3e6HDKQCm2Clt0krnoCPiTGvIn+GkYPn4Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.6.0.tgz", + "integrity": "sha512-MOVAzsKJIPIlLK239l5s06YXjNqpKTVhBVDnqUumQJja5+Y94V3+4VUFRA0G60y2jNnTVwRCkhyGQpavfsbq/g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.0.0-alpha.30", - "@typescript-eslint/visitor-keys": "8.0.0-alpha.30", + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/visitor-keys": "8.6.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", @@ -2910,9 +2987,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", - "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2922,10 +2999,34 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -2935,15 +3036,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.0-alpha.30.tgz", - "integrity": "sha512-rfhqfLqFyXhHNDwMnHiVGxl/Z2q/3guQ1jLlGQ0hi9Rb7inmwz42crM+NnLPR+2vEnwyw1P/g7fnQgQ3qvFx4g==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.6.0.tgz", + "integrity": "sha512-eNp9cWnYf36NaOVjkEUznf6fEgVy1TWpE0o52e4wtojjBx7D1UV2WAWGzR+8Y5lVFtpMLPwNbC67T83DWSph4A==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.0.0-alpha.30", - "@typescript-eslint/types": "8.0.0-alpha.30", - "@typescript-eslint/typescript-estree": "8.0.0-alpha.30" + "@typescript-eslint/scope-manager": "8.6.0", + "@typescript-eslint/types": "8.6.0", + "@typescript-eslint/typescript-estree": "8.6.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2957,9 +3058,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", - "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2970,12 +3071,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.0-alpha.30.tgz", - "integrity": "sha512-XZuNurZxBqmr6ZIRIwWFq7j5RZd6ZlkId/HZEWyfciK+CWoyOxSF9Pv2VXH9Rlu2ZG2PfbhLz2Veszl4Pfn7yA==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.6.0.tgz", + "integrity": "sha512-wapVFfZg9H0qOYh4grNVQiMklJGluQrOUiOhYRrQWhx7BY/+I1IYb8BczWNbbUpO+pqy0rDciv3lQH5E1bCLrg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.0.0-alpha.30", + "@typescript-eslint/types": "8.6.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -2987,9 +3088,9 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0-alpha.30.tgz", - "integrity": "sha512-4WzLlw27SO9pK9UFj/Hu7WGo8WveT0SEiIpFVsV2WwtQmLps6kouwtVCB8GJPZKJyurhZhcqCoQVQFmpv441Vg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", + "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3079,27 +3180,27 @@ } }, "node_modules/@typhonjs-typedoc/ts-lib-docs": { - "version": "2023.7.12", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2023.7.12.tgz", - "integrity": "sha512-vaiDbYGjnx7+gMM7KWSgNpGFxqr2Gw5MYpi9hvLWt8/nZ98EaTo1M4WjT6XtgbCw0w0x7greMlYWLgk7Mak/TA==", + "version": "2024.9.18", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2024.9.18.tgz", + "integrity": "sha512-LuyFXC9iC7DP0h5a3IbeLKMbRdD0Xl8CfdFA9zdUZXU5Rqp597CdCU42WwknXnX+MbNIkS6MK7+Om0L9Vn9Yxw==", "dev": true, "peerDependencies": { - "typedoc": ">=0.24.8" + "typedoc": ">=0.25.0" } }, "node_modules/@typhonjs-typedoc/typedoc-pkg": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.0.5.tgz", - "integrity": "sha512-+0sLiuJJqEpptYizN/od1tzEmJIkheWIeJ+xV8ONzbNeXtWkUAHA5PzBEmXr2xxJQRpUhV5cYI0fQOAwOFcx5Q==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.1.0.tgz", + "integrity": "sha512-wb4Yhf6kdBaVuWV29W9YAolcYKtios/Nlr87FdGwPB+Alpf40MO60BPmojxYBQfnnoXi5pBeKbczKlBySqwzpg==", "dev": true, "dependencies": { - "@typhonjs-typedoc/ts-lib-docs": "2023.7.12", - "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0-next.14", + "@typhonjs-typedoc/ts-lib-docs": "2024.9.18", + "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0", "@typhonjs-utils/file-util": "^0.1.0", "@typhonjs-utils/logger-color": "^0.1.0", "@typhonjs-utils/object": "^0.1.0", "@typhonjs-utils/package-json": "^0.7.0", - "glob": "^10.3.10", + "glob": "^11.0.0", "is-glob": "^4.0.3", "resolve.exports": "^2.0.2", "sade": "^1.8.1", @@ -3112,20 +3213,20 @@ "node": ">=18" }, "peerDependencies": { - "typedoc": ">=0.25.10 <0.26.0", + "typedoc": ">=0.26.6 < 0.27", "typescript": ">=5.1.0 <6" } }, "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { - "version": "0.2.0-next.14", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0-next.14.tgz", - "integrity": "sha512-ucMzhwtF/MKGqHxkCIpfrWMgZxdhfWLcAvwiEkgWpbmCmQUKhh6V+yGyHUG9TqRkZJCGXvgqNoziVyEYQKt/xw==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0.tgz", + "integrity": "sha512-sGb5mwRWx7S3yFFboNBCXgpUEe3mzUEFLueMyJa9hL+3s571yONLrs7kXKvbly1FI12hi6l5MRlX/tB0frpdiA==", "dev": true, "dependencies": { - "cheerio": "^1.0.0-rc.12" + "cheerio": "^1.0.0" }, "peerDependencies": { - "typedoc": ">=0.25.10" + "typedoc": ">=0.26.6" } }, "node_modules/@typhonjs-utils/file-util": { @@ -3167,136 +3268,186 @@ "node": ">=12" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "peer": true + }, "node_modules/@vitest/coverage-v8": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", - "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.1.tgz", + "integrity": "sha512-md/A7A3c42oTT8JUHSqjP5uKTWJejzUW4jalpvs+rZ27gsURsMU8DEb+8Jf8C6Kj2gwfSHJqobDNBuoqlm0cFw==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.2.1", + "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.4", + "debug": "^4.3.6", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.4", - "istanbul-reports": "^3.1.6", - "magic-string": "^0.30.5", - "magicast": "^0.3.3", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0" + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.11", + "magicast": "^0.3.4", + "std-env": "^3.7.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "1.6.0" + "@vitest/browser": "2.1.1", + "vitest": "2.1.1" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } } }, "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.1.tgz", + "integrity": "sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w==", + "dev": true, + "dependencies": { + "@vitest/spy": "2.1.1", + "@vitest/utils": "2.1.1", + "chai": "^5.1.1", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.1.tgz", + "integrity": "sha512-LNN5VwOEdJqCmJ/2XJBywB11DLlkbY0ooDJW3uRX5cZyYCrc4PI/ePX0iQhE3BiEGiQmK4GE7Q/PqCkkaiPnrA==", + "dev": true, + "dependencies": { + "@vitest/spy": "^2.1.0-beta.1", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.11" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/spy": "2.1.1", + "msw": "^2.3.5", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.1.tgz", + "integrity": "sha512-SjxPFOtuINDUW8/UkElJYQSFtnWX7tMksSGW0vfjxMneFqxVr8YJ979QpMbDW7g+BIiq88RAGDjf7en6rvLPPQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.1.tgz", + "integrity": "sha512-uTPuY6PWOYitIkLPidaY5L3t0JJITdGTSwBtwMjKzo5O6RCOEncz9PUN+0pDidX8kTHYjO0EwUIvhlGpnGpxmA==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "@vitest/utils": "2.1.1", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.1.tgz", + "integrity": "sha512-BnSku1WFy7r4mm96ha2FzN99AZJgpZOWrAhtQfoxjUU5YMRpq1zmHRq7a5K9/NjqonebO7iVDla+VvZS8BOWMw==", "dev": true, "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "2.1.1", + "magic-string": "^0.30.11", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.1.tgz", + "integrity": "sha512-ZM39BnZ9t/xZ/nF4UwRH5il0Sw93QnZXd9NAZGRpIgj0yvVwPpLd702s/Cx955rGaMlyBQkZJ2Ir7qyY48VZ+g==", "dev": true, "dependencies": { - "tinyspy": "^2.2.0" + "tinyspy": "^3.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/ui": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", - "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.1.tgz", + "integrity": "sha512-IIxo2LkQDA+1TZdPLYPclzsXukBWd5dX2CKpGqH8CCt8Wh0ZuDn4+vuQ9qlppEju6/igDGzjWF/zyorfsf+nHg==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "fast-glob": "^3.3.2", - "fflate": "^0.8.1", - "flatted": "^3.2.9", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "sirv": "^2.0.4" + "@vitest/utils": "2.1.1", + "fflate": "^0.8.2", + "flatted": "^3.3.1", + "pathe": "^1.1.2", + "sirv": "^2.0.4", + "tinyglobby": "^0.2.6", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "1.6.0" + "vitest": "2.1.1" } }, "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.1.tgz", + "integrity": "sha512-Y6Q9TsI+qJ2CC0ZKj6VBb+T8UPz593N113nnUykqwANqhgf3QkZeHFlusgKLTqrnVHbj/XDKZcDHol+dxVT+rQ==", "dev": true, "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "2.1.1", + "loupe": "^3.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/utils/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, "node_modules/acorn": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", - "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3314,18 +3465,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/acorn-walk": { - "version": "8.3.3", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", - "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", - "dev": true, - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -3343,23 +3482,14 @@ } }, "node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=8" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", - "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", - "dev": true - }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -3378,22 +3508,13 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "engines": { - "node": ">=8" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/babel-plugin-polyfill-corejs2": { @@ -3411,13 +3532,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", - "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", + "version": "0.10.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz", + "integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.1", - "core-js-compat": "^3.36.1" + "@babel/helper-define-polyfill-provider": "^0.6.2", + "core-js-compat": "^3.38.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -3448,12 +3569,13 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/braces": { @@ -3469,9 +3591,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", - "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -3488,10 +3610,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001629", - "electron-to-chromium": "^1.4.796", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.16" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -3519,9 +3641,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001636", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz", - "integrity": "sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==", + "version": "1.0.30001660", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz", + "integrity": "sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==", "dev": true, "funding": [ { @@ -3538,22 +3660,31 @@ } ] }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chalk": { @@ -3570,34 +3701,57 @@ "node": ">=4" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", + "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", "dev": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" + "domutils": "^3.1.0", + "encoding-sniffer": "^0.2.0", + "htmlparser2": "^9.1.0", + "parse5": "^7.1.2", + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^6.19.5", + "whatwg-mimetype": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": ">=18.17" }, "funding": { "url": "https://github.com/cheeriojs/cheerio?sponsor=1" @@ -3621,9 +3775,9 @@ } }, "node_modules/code-block-writer": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", - "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.2.tgz", + "integrity": "sha512-XfXzAGiStXSmCIwrkdfvc7FS5Dtj8yelCtyOf2p2skCAfvLd6zu0rGzuS9NSCO3bq1JKpFZ7tbKdKlcd5occQA==", "dev": true }, "node_modules/color-convert": { @@ -3641,6 +3795,17 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/comment-parser": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", @@ -3656,12 +3821,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", - "dev": true - }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -3669,12 +3828,12 @@ "dev": true }, "node_modules/core-js-compat": { - "version": "3.37.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", - "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "version": "3.38.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", + "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", "dev": true, "dependencies": { - "browserslist": "^4.23.0" + "browserslist": "^4.23.3" }, "funding": { "type": "opencollective", @@ -3724,21 +3883,21 @@ } }, "node_modules/cytoscape": { - "version": "3.29.2", - "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.29.2.tgz", - "integrity": "sha512-2G1ycU28Nh7OHT9rkXRLpCDP30MKH1dXJORZuBhtEhEW7pKwgPi77ImqlCWinouyE1PNepIOGZBOrE84DG7LyQ==", + "version": "3.30.2", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.30.2.tgz", + "integrity": "sha512-oICxQsjW8uSaRmn4UK/jkczKOqTrVqt5/1WL0POiJUT2EKNc9STM4hYFHv917yu55aTBMFNRzymlJhVAiWPCxw==", "dev": true, "engines": { "node": ">=0.10" } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3750,13 +3909,10 @@ } }, "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -3767,25 +3923,28 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "dev": true, + "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=6" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, + "peer": true, "dependencies": { - "path-type": "^4.0.0" + "dequal": "^2.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/dom-serializer": { @@ -3850,9 +4009,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.808", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.808.tgz", - "integrity": "sha512-0ItWyhPYnww2VOuCGF4s1LTfbrdAV2ajy/TN+ZTuhR23AHI6rWHCrBXJ/uxoXOvRRqw8qjYVrG81HFI7x/2wdQ==", + "version": "1.5.25", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.25.tgz", + "integrity": "sha512-kMb204zvK3PsSlgvvwzI3wBIcAw15tRkYk+NQdsjdDtcQWTp2RABbMQ9rUBy8KNEOM+/E6ep+XC3AykiWZld4g==", "dev": true }, "node_modules/emoji-regex": { @@ -3861,6 +4020,19 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "node_modules/encoding-sniffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", + "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", + "dev": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -3874,53 +4046,54 @@ } }, "node_modules/es-module-lexer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", - "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" @@ -3936,16 +4109,17 @@ } }, "node_modules/eslint": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", - "integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", + "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/config-array": "^0.16.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.5.0", + "@eslint/js": "9.10.0", + "@eslint/plugin-kit": "^0.1.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -3954,9 +4128,9 @@ "cross-spawn": "^7.0.2", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.1", + "eslint-scope": "^8.0.2", "eslint-visitor-keys": "^4.0.0", - "espree": "^10.0.1", + "espree": "^10.1.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3968,7 +4142,6 @@ "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", @@ -3984,12 +4157,20 @@ }, "funding": { "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", - "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -4014,15 +4195,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -4038,16 +4210,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -4094,18 +4256,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4115,30 +4265,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4169,9 +4295,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -4216,29 +4342,6 @@ "node": ">=0.10.0" } }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -4261,6 +4364,18 @@ "node": ">=8.6.0" } }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -4348,9 +4463,9 @@ "dev": true }, "node_modules/foreground-child": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", - "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.0", @@ -4377,12 +4492,6 @@ "node": ">=14.14" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -4424,51 +4533,39 @@ "node": "*" } }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/glob": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", - "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/glob-to-regexp": { @@ -4477,42 +4574,37 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/glob/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": "20 || >=22" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/globby/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/graceful-fs": { @@ -4548,20 +4640,69 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-to-html": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz", + "integrity": "sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", "dev": true, - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { "type": "github", "url": "https://github.com/sponsors/fb55" } @@ -4569,23 +4710,26 @@ "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" + "domutils": "^3.1.0", + "entities": "^4.5.0" } }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, "engines": { - "node": ">=16.17.0" + "node": ">=0.10.0" } }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "engines": { "node": ">= 4" @@ -4626,27 +4770,10 @@ "node": ">=0.8.19" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "node_modules/is-core-module": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", - "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "dependencies": { "hasown": "^2.0.2" @@ -4706,18 +4833,6 @@ "node": ">=8" } }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4769,9 +4884,9 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", - "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.23", @@ -4796,15 +4911,15 @@ } }, "node_modules/jackspeak": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", - "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4882,12 +4997,6 @@ "node": ">=6" } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -4922,20 +5031,14 @@ "node": ">= 0.8.0" } }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, + "peer": true, "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" + "uc.micro": "^2.0.0" } }, "node_modules/locate-path": { @@ -4966,9 +5069,9 @@ "dev": true }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", "dev": true, "dependencies": { "get-func-name": "^2.0.1" @@ -4987,25 +5090,26 @@ "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true + "dev": true, + "peer": true }, "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "version": "0.30.11", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", + "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", "dev": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/magicast": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", - "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", "dev": true, "dependencies": { - "@babel/parser": "^7.24.4", - "@babel/types": "^7.24.0", + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", "source-map-js": "^1.2.0" } }, @@ -5025,9 +5129,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -5036,23 +5140,52 @@ "node": ">=10" } }, - "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, "bin": { - "marked": "bin/marked.js" + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", + "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" }, - "engines": { - "node": ">= 12" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/merge-stream": { + "node_modules/mdurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, + "peer": true }, "node_modules/merge2": { "version": "1.4.1", @@ -5063,10 +5196,104 @@ "node": ">= 8" } }, + "node_modules/micromark-util-character": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "peer": true, + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "peer": true + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "peer": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "peer": true + }, + "node_modules/micromark-util-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "peer": true + }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", @@ -5076,31 +5303,16 @@ "node": ">=8.6" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/minipass": { @@ -5127,18 +5339,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mlly": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", - "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.1.1", - "ufo": "^1.5.3" - } - }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -5158,9 +5358,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/nanoid": { @@ -5188,38 +5388,11 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -5232,28 +5405,17 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/oniguruma-to-js": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.3.tgz", + "integrity": "sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==", "dev": true, + "peer": true, "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" + "regex": "^4.3.2" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/antfu" } }, "node_modules/optionator": { @@ -5274,15 +5436,15 @@ } }, "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "yocto-queue": "^1.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5303,33 +5465,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-locate/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate/node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", @@ -5373,6 +5508,18 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "dev": true, + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -5388,15 +5535,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -5413,37 +5551,28 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", + "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", "dev": true, "engines": { - "node": ">=8" + "node": "20 || >=22" } }, "node_modules/pathe": { @@ -5453,18 +5582,18 @@ "dev": true }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true }, "node_modules/picomatch": { @@ -5479,21 +5608,10 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-types": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", - "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", - "dev": true, - "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.7.0", - "pathe": "^1.1.2" - } - }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "dev": true, "funding": [ { @@ -5511,8 +5629,8 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -5528,9 +5646,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -5542,30 +5660,15 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "node_modules/property-information": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", + "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", "dev": true, - "engines": { - "node": ">=10" - }, + "peer": true, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/punycode": { @@ -5577,6 +5680,16 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -5597,12 +5710,6 @@ } ] }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -5610,9 +5717,9 @@ "dev": true }, "node_modules/regenerate-unicode-properties": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", - "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz", + "integrity": "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==", "dev": true, "dependencies": { "regenerate": "^1.4.2" @@ -5636,6 +5743,13 @@ "@babel/runtime": "^7.8.4" } }, + "node_modules/regex": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/regex/-/regex-4.3.2.tgz", + "integrity": "sha512-kK/AA3A9K6q2js89+VMymcboLOlF5lZRCYJv3gzszXFHBr6kO6qLGzbm+UIugBEV8SMMKCTR59txoY6ctRHYVw==", + "dev": true, + "peer": true + }, "node_modules/regexpu-core": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", @@ -5720,9 +5834,9 @@ } }, "node_modules/rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.3.tgz", + "integrity": "sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -5735,22 +5849,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", + "@rollup/rollup-android-arm-eabi": "4.21.3", + "@rollup/rollup-android-arm64": "4.21.3", + "@rollup/rollup-darwin-arm64": "4.21.3", + "@rollup/rollup-darwin-x64": "4.21.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.21.3", + "@rollup/rollup-linux-arm-musleabihf": "4.21.3", + "@rollup/rollup-linux-arm64-gnu": "4.21.3", + "@rollup/rollup-linux-arm64-musl": "4.21.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3", + "@rollup/rollup-linux-riscv64-gnu": "4.21.3", + "@rollup/rollup-linux-s390x-gnu": "4.21.3", + "@rollup/rollup-linux-x64-gnu": "4.21.3", + "@rollup/rollup-linux-x64-musl": "4.21.3", + "@rollup/rollup-win32-arm64-msvc": "4.21.3", + "@rollup/rollup-win32-ia32-msvc": "4.21.3", + "@rollup/rollup-win32-x64-msvc": "4.21.3", "fsevents": "~2.3.2" } }, @@ -5776,6 +5890,12 @@ "typescript": "^4.5 || ^5.0" } }, + "node_modules/rollup/node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5811,6 +5931,12 @@ "node": ">=6" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -5842,15 +5968,18 @@ } }, "node_modules/shiki": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", - "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.17.7.tgz", + "integrity": "sha512-Zf6hNtWhFyF4XP5OOsXkBTEx9JFPiN0TQx4wSe+Vqeuczewgk2vT4IZhF4gka55uelm052BD5BaHavNqUNZd+A==", "dev": true, + "peer": true, "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" + "@shikijs/core": "1.17.7", + "@shikijs/engine-javascript": "1.17.7", + "@shikijs/engine-oniguruma": "1.17.7", + "@shikijs/types": "1.17.7", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4" } }, "node_modules/siginfo": { @@ -5898,14 +6027,25 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -5950,34 +6090,25 @@ "node": ">=8" } }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/string-width-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/strip-ansi": { + "node_modules/string-width/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", @@ -5992,8 +6123,22 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "dev": true, + "peer": true, + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -6005,27 +6150,19 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { "node": ">=8" } }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -6038,24 +6175,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", - "dev": true, - "dependencies": { - "js-tokens": "^9.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/strip-literal/node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -6081,60 +6200,98 @@ } }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^9.0.4" }, "engines": { - "node": ">=8" + "node": ">=18" } }, "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/test-exclude/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" }, "funding": { "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/test-exclude/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/text-table": { @@ -6144,24 +6301,78 @@ "dev": true }, "node_modules/tinybench": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", - "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", "dev": true }, + "node_modules/tinyexec": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", + "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", + "dev": true + }, + "node_modules/tinyglobby": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.6.tgz", + "integrity": "sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==", + "dev": true, + "dependencies": { + "fdir": "^6.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.3.0.tgz", + "integrity": "sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", + "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true, "engines": { "node": ">=14.0.0" @@ -6197,6 +6408,17 @@ "node": ">=6" } }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/ts-api-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", @@ -6231,19 +6453,10 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { - "version": "4.20.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.20.1.tgz", - "integrity": "sha512-R6wDsVsoS9xYOpy8vgeBlqpdOyzJ12HNfQhC/aAKWM3YoCV9TtunJzh/QpkMgeDhkoynDcw5f1y+qF9yc/HHyg==", + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", "dev": true, "engines": { "node": ">=16" @@ -6253,30 +6466,58 @@ } }, "node_modules/typedoc": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.12.tgz", - "integrity": "sha512-F+qhkK2VoTweDXd1c42GS/By2DvI2uDF4/EpG424dTexSHdtCH52C6IcAvMA6jR3DzAWZjHpUOW+E02kyPNUNw==", + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.7.tgz", + "integrity": "sha512-gUeI/Wk99vjXXMi8kanwzyhmeFEGv1LTdTQsiyIsmSYsBebvFxhbcyAx7Zjo4cMbpLGxM4Uz3jVIjksu/I2v6Q==", "dev": true, + "peer": true, "dependencies": { "lunr": "^2.3.9", - "marked": "^4.3.0", - "minimatch": "^9.0.3", - "shiki": "^0.14.7" + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "shiki": "^1.16.2", + "yaml": "^2.5.1" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 16" + "node": ">= 18" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6287,14 +6528,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.0.0-alpha.30", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.0.0-alpha.30.tgz", - "integrity": "sha512-/vGhBMsK1TpadQh1eQ02c5pyiPGmKR9cVzX5C9plZ+LC0HPLpWoJbbTVfQN7BkIK7tUxDt2BFr3pFL5hDDrx7g==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.6.0.tgz", + "integrity": "sha512-eEhhlxCEpCd4helh3AO1hk0UP2MvbRi9CtIAJTVPQjuSXOOO2jsEacNi4UdcJzZJbeuVg1gMhtZ8UYb+NFYPrA==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.0.0-alpha.30", - "@typescript-eslint/parser": "8.0.0-alpha.30", - "@typescript-eslint/utils": "8.0.0-alpha.30" + "@typescript-eslint/eslint-plugin": "8.6.0", + "@typescript-eslint/parser": "8.6.0", + "@typescript-eslint/utils": "8.6.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6309,16 +6550,26 @@ } } }, - "node_modules/ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", - "dev": true + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "peer": true + }, + "node_modules/undici": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "dev": true, + "engines": { + "node": ">=18.17" + } }, "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", "dev": true, "engines": { "node": ">=4" @@ -6338,9 +6589,9 @@ } }, "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", - "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz", + "integrity": "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==", "dev": true, "engines": { "node": ">=4" @@ -6355,167 +6606,678 @@ "node": ">=4" } }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", "dev": true, - "engines": { - "node": ">= 10.0.0" + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/upath": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "engines": { - "node": ">=4", - "yarn": "*" + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { "type": "github", "url": "https://github.com/sponsors/ai" } ], - "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.6.tgz", + "integrity": "sha512-IeL5f8OO5nylsgzd9tq4qD2QqI0k2CQLGrWD0rCN0EQJZpBK5vJAx0I+GDkMOXxQX/OfFHMuLIx6ddAxGX/k+Q==", + "dev": true, + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.1.tgz", + "integrity": "sha512-N/mGckI1suG/5wQI35XeR9rsMsPqKXzq1CdUndzVstBj/HvyxxGctwnK6WX43NGt5L3Z5tcRf83g4TITKJhPrA==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.6", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "punycode": "^2.1.0" + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/vite": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.1.tgz", - "integrity": "sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==", + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.38", - "rollup": "^4.13.0" - }, - "bin": { - "vite": "bin/vite.js" - }, + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } + "node": ">=12" } }, - "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, "bin": { - "vite-node": "vite-node.mjs" + "esbuild": "bin/esbuild" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": ">=12" }, - "funding": { - "url": "https://opencollective.com/vitest" + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.1.tgz", + "integrity": "sha512-97We7/VC0e9X5zBVkvt7SGQMGrRtn3KtySFQG5fpaMlS+l62eeXRQO633AYhSTC3z7IMebnPPNjGXVGNRFlxBA==", + "dev": true, + "dependencies": { + "@vitest/expect": "2.1.1", + "@vitest/mocker": "2.1.1", + "@vitest/pretty-format": "^2.1.1", + "@vitest/runner": "2.1.1", + "@vitest/snapshot": "2.1.1", + "@vitest/spy": "2.1.1", + "@vitest/utils": "2.1.1", + "chai": "^5.1.1", + "debug": "^4.3.6", + "magic-string": "^0.30.11", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.0", + "tinypool": "^1.0.0", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" + "vite-node": "2.1.1", + "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" @@ -6529,8 +7291,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", + "@vitest/browser": "2.1.1", + "@vitest/ui": "2.1.1", "happy-dom": "*", "jsdom": "*" }, @@ -6555,17 +7317,26 @@ } } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "engines": { + "node": ">=18" + } }, "node_modules/which": { "version": "2.0.2", @@ -6583,9 +7354,9 @@ } }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, "dependencies": { "siginfo": "^2.0.0", @@ -6642,15 +7413,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -6704,16 +7466,16 @@ "node": ">=8" } }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { @@ -6728,11 +7490,20 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } }, "node_modules/yallist": { "version": "3.1.1", @@ -6740,17 +7511,41 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "node_modules/yaml": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "dev": true, + "peer": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "engines": { - "node": ">=12.20" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "dev": true, + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } } } } diff --git a/package.json b/package.json index ffb30819..7e447b1e 100644 --- a/package.json +++ b/package.json @@ -131,19 +131,18 @@ "types": "esm-d-ts gen -c" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/preset-env": "^7.24.7", + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.4", "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", - "@typhonjs-typedoc/typedoc-pkg": "^0.0.5", - "@vitest/coverage-v8": "^1.6.0", - "@vitest/ui": "^1.6.0", - "esbuild": "^0.21.0", - "eslint": "^9.5.0", - "rollup": "^4.18.0", - "typedoc": "0.25.12", - "typescript": "^5.4.0", - "typescript-eslint": "rc-v8", - "vitest": "^1.6.0" + "@typhonjs-typedoc/typedoc-pkg": "^0.1.0", + "@vitest/coverage-v8": "^2.1.0", + "@vitest/ui": "^2.1.0", + "esbuild": "^0.23.0", + "eslint": "^9.10.0", + "rollup": "^4.21.0", + "typescript": "^5.6.0", + "typescript-eslint": "^8.6.0", + "vitest": "^2.1.0" } } From 7ab157d5c04a39a6a9871ef43b302573d4e1c043 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Mon, 23 Sep 2024 20:17:56 -0700 Subject: [PATCH 15/16] Update dependencies. --- package-lock.json | 152 +++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/package-lock.json b/package-lock.json index 012bb553..b2e90a24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,12 +13,12 @@ "@babel/preset-env": "^7.25.4", "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", - "@typhonjs-typedoc/typedoc-pkg": "^0.1.0", + "@typhonjs-typedoc/typedoc-pkg": "^0.1.1", "@vitest/coverage-v8": "^2.1.0", "@vitest/ui": "^2.1.0", "esbuild": "^0.23.0", "eslint": "^9.10.0", - "rollup": "^4.21.0", + "rollup": "^4.22.0", "typescript": "^5.6.0", "typescript-eslint": "^8.6.0", "vitest": "^2.1.0" @@ -2463,9 +2463,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz", - "integrity": "sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.4.tgz", + "integrity": "sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==", "cpu": [ "arm" ], @@ -2476,9 +2476,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz", - "integrity": "sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.4.tgz", + "integrity": "sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==", "cpu": [ "arm64" ], @@ -2489,9 +2489,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz", - "integrity": "sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.4.tgz", + "integrity": "sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==", "cpu": [ "arm64" ], @@ -2502,9 +2502,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz", - "integrity": "sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.4.tgz", + "integrity": "sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==", "cpu": [ "x64" ], @@ -2515,9 +2515,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz", - "integrity": "sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.4.tgz", + "integrity": "sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==", "cpu": [ "arm" ], @@ -2528,9 +2528,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz", - "integrity": "sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.4.tgz", + "integrity": "sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==", "cpu": [ "arm" ], @@ -2541,9 +2541,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz", - "integrity": "sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.4.tgz", + "integrity": "sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==", "cpu": [ "arm64" ], @@ -2554,9 +2554,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz", - "integrity": "sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.4.tgz", + "integrity": "sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==", "cpu": [ "arm64" ], @@ -2567,9 +2567,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz", - "integrity": "sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.4.tgz", + "integrity": "sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==", "cpu": [ "ppc64" ], @@ -2580,9 +2580,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz", - "integrity": "sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.4.tgz", + "integrity": "sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==", "cpu": [ "riscv64" ], @@ -2593,9 +2593,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz", - "integrity": "sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.4.tgz", + "integrity": "sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==", "cpu": [ "s390x" ], @@ -2606,9 +2606,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz", - "integrity": "sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.4.tgz", + "integrity": "sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==", "cpu": [ "x64" ], @@ -2619,9 +2619,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz", - "integrity": "sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.4.tgz", + "integrity": "sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==", "cpu": [ "x64" ], @@ -2632,9 +2632,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz", - "integrity": "sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.4.tgz", + "integrity": "sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==", "cpu": [ "arm64" ], @@ -2645,9 +2645,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz", - "integrity": "sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.4.tgz", + "integrity": "sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==", "cpu": [ "ia32" ], @@ -2658,9 +2658,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz", - "integrity": "sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.4.tgz", + "integrity": "sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==", "cpu": [ "x64" ], @@ -3189,13 +3189,13 @@ } }, "node_modules/@typhonjs-typedoc/typedoc-pkg": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.1.0.tgz", - "integrity": "sha512-wb4Yhf6kdBaVuWV29W9YAolcYKtios/Nlr87FdGwPB+Alpf40MO60BPmojxYBQfnnoXi5pBeKbczKlBySqwzpg==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.1.1.tgz", + "integrity": "sha512-mJLmMnhYGZCHJF4ks0pkzWRK4/53D84MWKjAx47yY9cmNNeKj6S95ZK43tePj+M3VyieQ3O6GND/v2jcrHhesQ==", "dev": true, "dependencies": { "@typhonjs-typedoc/ts-lib-docs": "2024.9.18", - "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.0", + "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.1", "@typhonjs-utils/file-util": "^0.1.0", "@typhonjs-utils/logger-color": "^0.1.0", "@typhonjs-utils/object": "^0.1.0", @@ -3218,9 +3218,9 @@ } }, "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.0.tgz", - "integrity": "sha512-sGb5mwRWx7S3yFFboNBCXgpUEe3mzUEFLueMyJa9hL+3s571yONLrs7kXKvbly1FI12hi6l5MRlX/tB0frpdiA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.1.tgz", + "integrity": "sha512-6z/hB7aCuakDjQZT5hafI3EhpxcA13rscEHMhpNKQNh5QtoxCTrenPBRlajCqYZycVGn0NgSAaDDEKMFefmBQg==", "dev": true, "dependencies": { "cheerio": "^1.0.0" @@ -5834,9 +5834,9 @@ } }, "node_modules/rollup": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.3.tgz", - "integrity": "sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.4.tgz", + "integrity": "sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -5849,22 +5849,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.3", - "@rollup/rollup-android-arm64": "4.21.3", - "@rollup/rollup-darwin-arm64": "4.21.3", - "@rollup/rollup-darwin-x64": "4.21.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.3", - "@rollup/rollup-linux-arm-musleabihf": "4.21.3", - "@rollup/rollup-linux-arm64-gnu": "4.21.3", - "@rollup/rollup-linux-arm64-musl": "4.21.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3", - "@rollup/rollup-linux-riscv64-gnu": "4.21.3", - "@rollup/rollup-linux-s390x-gnu": "4.21.3", - "@rollup/rollup-linux-x64-gnu": "4.21.3", - "@rollup/rollup-linux-x64-musl": "4.21.3", - "@rollup/rollup-win32-arm64-msvc": "4.21.3", - "@rollup/rollup-win32-ia32-msvc": "4.21.3", - "@rollup/rollup-win32-x64-msvc": "4.21.3", + "@rollup/rollup-android-arm-eabi": "4.22.4", + "@rollup/rollup-android-arm64": "4.22.4", + "@rollup/rollup-darwin-arm64": "4.22.4", + "@rollup/rollup-darwin-x64": "4.22.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.22.4", + "@rollup/rollup-linux-arm-musleabihf": "4.22.4", + "@rollup/rollup-linux-arm64-gnu": "4.22.4", + "@rollup/rollup-linux-arm64-musl": "4.22.4", + "@rollup/rollup-linux-powerpc64le-gnu": "4.22.4", + "@rollup/rollup-linux-riscv64-gnu": "4.22.4", + "@rollup/rollup-linux-s390x-gnu": "4.22.4", + "@rollup/rollup-linux-x64-gnu": "4.22.4", + "@rollup/rollup-linux-x64-musl": "4.22.4", + "@rollup/rollup-win32-arm64-msvc": "4.22.4", + "@rollup/rollup-win32-ia32-msvc": "4.22.4", + "@rollup/rollup-win32-x64-msvc": "4.22.4", "fsevents": "~2.3.2" } }, diff --git a/package.json b/package.json index 7e447b1e..ae1a6227 100644 --- a/package.json +++ b/package.json @@ -135,12 +135,12 @@ "@babel/preset-env": "^7.25.4", "@rollup/plugin-babel": "^6.0.4", "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", - "@typhonjs-typedoc/typedoc-pkg": "^0.1.0", + "@typhonjs-typedoc/typedoc-pkg": "^0.1.1", "@vitest/coverage-v8": "^2.1.0", "@vitest/ui": "^2.1.0", "esbuild": "^0.23.0", "eslint": "^9.10.0", - "rollup": "^4.21.0", + "rollup": "^4.22.0", "typescript": "^5.6.0", "typescript-eslint": "^8.6.0", "vitest": "^2.1.0" From ecb09c0af3ab2955d6b5e599791a842b84a0d635 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Sun, 8 Dec 2024 17:53:48 -0800 Subject: [PATCH 16/16] Update dependencies / declarations / TS -> CJS support. --- dist-cdn/cjs/2022/gl-matrix-f32.cjs | 9536 ++++++++++++++++++ dist-cdn/cjs/2022/gl-matrix-f32.cjs.map | 7 + dist-cdn/cjs/2022/gl-matrix-f32.min.cjs | 6 + dist-cdn/cjs/2022/gl-matrix-f32.min.cjs.map | 7 + dist-cdn/cjs/2022/gl-matrix-f64.cjs | 9527 ++++++++++++++++++ dist-cdn/cjs/2022/gl-matrix-f64.cjs.map | 7 + dist-cdn/cjs/2022/gl-matrix-f64.min.cjs | 6 + dist-cdn/cjs/2022/gl-matrix-f64.min.cjs.map | 7 + dist-cdn/types/gl-matrix-f32.d.cts | 9911 +++++++++++++++++++ dist-cdn/types/gl-matrix-f64.d.cts | 9903 ++++++++++++++++++ dist-cdn/types/globals-f32.d.cts | 7 + dist-cdn/types/globals-f64.d.cts | 7 + dist-cdn/umd/gl-matrix-f32.js | 6 +- dist-cdn/umd/gl-matrix-f32.js.map | 2 +- dist-cdn/umd/gl-matrix-f32.min.js | 6 +- dist-cdn/umd/gl-matrix-f32.min.js.map | 2 +- dist-cdn/umd/gl-matrix-f64.js | 6 +- dist-cdn/umd/gl-matrix-f64.js.map | 2 +- dist-cdn/umd/gl-matrix-f64.min.js | 6 +- dist-cdn/umd/gl-matrix-f64.min.js.map | 2 +- esm-d-ts.config.js | 29 +- package-lock.json | 4288 ++++---- package.json | 182 +- scripts/build.js | 22 +- 24 files changed, 41061 insertions(+), 2423 deletions(-) create mode 100644 dist-cdn/cjs/2022/gl-matrix-f32.cjs create mode 100644 dist-cdn/cjs/2022/gl-matrix-f32.cjs.map create mode 100644 dist-cdn/cjs/2022/gl-matrix-f32.min.cjs create mode 100644 dist-cdn/cjs/2022/gl-matrix-f32.min.cjs.map create mode 100644 dist-cdn/cjs/2022/gl-matrix-f64.cjs create mode 100644 dist-cdn/cjs/2022/gl-matrix-f64.cjs.map create mode 100644 dist-cdn/cjs/2022/gl-matrix-f64.min.cjs create mode 100644 dist-cdn/cjs/2022/gl-matrix-f64.min.cjs.map create mode 100644 dist-cdn/types/gl-matrix-f32.d.cts create mode 100644 dist-cdn/types/gl-matrix-f64.d.cts create mode 100644 dist-cdn/types/globals-f32.d.cts create mode 100644 dist-cdn/types/globals-f64.d.cts diff --git a/dist-cdn/cjs/2022/gl-matrix-f32.cjs b/dist-cdn/cjs/2022/gl-matrix-f32.cjs new file mode 100644 index 00000000..73a696c6 --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f32.cjs @@ -0,0 +1,9536 @@ +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/cdn/index.ts +var cdn_exports = {}; +__export(cdn_exports, { + EnableSwizzles: () => EnableSwizzles, + Mat2: () => Mat2, + Mat2d: () => Mat2d, + Mat3: () => Mat3, + Mat4: () => Mat4, + Quat: () => Quat, + Quat2: () => Quat2, + Vec2: () => Vec2, + Vec3: () => Vec3, + Vec4: () => Vec4, + mat2: () => Mat2, + mat2d: () => Mat2d, + mat3: () => Mat3, + mat4: () => Mat4, + quat: () => Quat, + quat2: () => Quat2, + toDegree: () => toDegree, + toRadian: () => toRadian, + vec2: () => Vec2, + vec3: () => Vec3, + vec4: () => Vec4 +}); +module.exports = __toCommonJS(cdn_exports); + +// src/common/index.ts +var GLM_EPSILON = 1e-6; + +// src/_lib/f32/Mat2.ts +var Mat2 = class _Mat2 extends Float32Array { + static #IDENTITY_2X2 = new Float32Array([ + 1, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v + ]); + } else { + super(v, 0, 4); + } + break; + default: + super(_Mat2.#IDENTITY_2X2); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2.str(this); + } + // =================== + // Instance methods + // =================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity() { + this.set(_Mat2.#IDENTITY_2X2); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values) { + return new _Mat2(...values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + let det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2(${a.join(", ")})`; + } +}; +Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; + +// src/_lib/f32/Mat2d.ts +var Mat2d = class _Mat2d extends Float32Array { + static #IDENTITY_2X3 = new Float32Array([ + 1, + 0, + 0, + 1, + 0, + 0 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 6: + super(values); + break; + case 2: + super(values[0], values[1], 6); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 6); + } + break; + default: + super(_Mat2d.#IDENTITY_2X3); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2d.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat2d.#IDENTITY_2X3); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat2d.scale(this, this, v); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH() { + return 6 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values) { + return new _Mat2d(...values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2d(${a.join(", ")})`; + } +}; +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; + +// src/_lib/f32/Mat3.ts +var Mat3 = class _Mat3 extends Float32Array { + static #IDENTITY_3X3 = new Float32Array([ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 9: + super(values); + break; + case 2: + super(values[0], values[1], 9); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 9); + } + break; + default: + super(_Mat3.#IDENTITY_3X3); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat3.str(this); + } + // =================== + // Instance methods + // =================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat3.#IDENTITY_3X3); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat3.scale(this, this, v); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH() { + return 9 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values) { + return new _Mat3(...values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2]; + const a10 = a[3], a11 = a[4], a12 = a[5]; + const a20 = a[6], a21 = a[7], a22 = a[8]; + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + let det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + ); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat3(${a.join(", ")})`; + } +}; +Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; + +// src/_lib/f32/Mat4.ts +var Mat4 = class _Mat4 extends Float32Array { + static #IDENTITY_4X4 = new Float32Array([ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ]); + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + static #TMP_VEC3 = new Float32Array(3); + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 16: + super(values); + break; + case 2: + super(values[0], values[1], 16); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 16); + } + break; + default: + super(_Mat4.#IDENTITY_4X4); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat4.str(this); + } + // =================== + // Instance methods + // =================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat4.#IDENTITY_4X4); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH() { + return 16 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values) { + return new _Mat4(...values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a03 = a[3]; + const a12 = a[6], a13 = a[7]; + const a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out, a, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out, a, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out, a, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out, a, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, v) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out, a) { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, _Mat4.#TMP_VEC3); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out, mat) { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out, mat) { + _Mat4.getScaling(_Mat4.#TMP_VEC3, mat); + const is1 = 1 / _Mat4.#TMP_VEC3[0]; + const is2 = 1 / _Mat4.#TMP_VEC3[1]; + const is3 = 1 / _Mat4.#TMP_VEC3[2]; + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out, q, v, s) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out, q, v, s, o) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out, left, right, bottom, top, near, far = Infinity) { + return out; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static perspective(out, fovy, aspect, near, far = Infinity) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out, fov, near, far) { + const upTan = Math.tan(fov.upDegrees * Math.PI / 180); + const downTan = Math.tan(fov.downDegrees * Math.PI / 180); + const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + const xScale = 2 / (leftTan + rightTan); + const yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out, eye, center, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out, eye, target, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15] + ); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat4(${a.join(", ")})`; + } +}; +Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; + +// src/_lib/f32/Vec3.ts +var Vec3 = class _Vec3 extends Float32Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 3: + super(values); + break; + case 2: + super(values[0], values[1], 3); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v]); + } else { + super(v, 0, 3); + } + break; + } + default: + super(3); + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec3.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec3.normalize(this, this); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH() { + return 3 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out, a, b) { + const ax = a[0], ay = a[1], az = a[2]; + const bx = b[0], by = b[1], bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out, a, b, c, d, t) { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out, a, b, c, d, t) { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /* + static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + const uvx = qy * z - qz * y; + const uvy = qz * x - qx * z; + const uvz = qx * y - qy * x; + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out, a, b, rad) { + const by = b[1]; + const bz = b[2]; + const py = a[1] - by; + const pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out, a, b, rad) { + const bx = b[0]; + const bz = b[2]; + const px = a[0] - bx; + const pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out, a, b, rad) { + const bx = b[0]; + const by = b[1]; + const px = a[0] - bx; + const py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec3(${a.join(", ")})`; + } + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } +}; +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; + +// src/_lib/f32/Vec4.ts +var Vec4 = class _Vec4 extends Float32Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a() { + return this[3]; + } + set a(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec4.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec4.normalize(this, this); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out, u, v, w) { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /* + static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec4(${a.join(", ")})`; + } + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } +}; +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; + +// src/_lib/f32/Quat.ts +var Quat = class _Quat extends Float32Array { + static #DEFAULT_ANGLE_ORDER = "zyx"; + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT1 = new Float32Array(4); + static #TMP_QUAT2 = new Float32Array(4); + static #TMP_MAT3 = new Float32Array(9); + static #TMP_VEC3 = new Float32Array(3); + static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]); + static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]); + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale) { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b) { + return _Quat.dot(this, b); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH() { + return 4 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out, axis, rad) { + rad *= 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as provided in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis, q) { + const rad = Math.acos(q[3]) * 2; + const s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a, b) { + const dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quaternions. + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + 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]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out, a) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const ax = a[0], ay = a[1], az = a[2], aw = a[3]; + let bx = b[0], by = b[1], bz = b[2], bw = b[3]; + let scale0; + let scale1; + let cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /* static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to re-normalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out, m) { + const fTrace = m[0] + m[4] + m[8]; + let fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + let i = 0; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) { + const halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error(`Unknown angle order ${order}`); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat(${a.join(", ")})`; + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static normalize(out, a) { + return out; + } + /** + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static exactEquals(a, b) { + return false; + } + /** + * Returns whether the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out, a, b) { + const dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a); + if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + } + Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3); + _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(_Quat.#TMP_VEC3, a, b); + out[0] = _Quat.#TMP_VEC3[0]; + out[1] = _Quat.#TMP_VEC3[1]; + out[2] = _Quat.#TMP_VEC3[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out, a, b, c, d, t) { + _Quat.slerp(_Quat.#TMP_QUAT1, a, d, t); + _Quat.slerp(_Quat.#TMP_QUAT2, b, c, t); + _Quat.slerp(out, _Quat.#TMP_QUAT1, _Quat.#TMP_QUAT2, 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out, view, right, up) { + _Quat.#TMP_MAT3[0] = right[0]; + _Quat.#TMP_MAT3[3] = right[1]; + _Quat.#TMP_MAT3[6] = right[2]; + _Quat.#TMP_MAT3[1] = up[0]; + _Quat.#TMP_MAT3[4] = up[1]; + _Quat.#TMP_MAT3[7] = up[2]; + _Quat.#TMP_MAT3[2] = -view[0]; + _Quat.#TMP_MAT3[5] = -view[1]; + _Quat.#TMP_MAT3[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, _Quat.#TMP_MAT3)); + } +}; +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; +Quat.prototype.mul = Quat.prototype.multiply; +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; + +// src/_lib/f32/Quat2.ts +var Quat2 = class _Quat2 extends Float32Array { + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT = new Float32Array(4); + static #TMP_VEC3 = new Float32Array(3); + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 8: + super(values); + break; + case 2: + super(values[0], values[1], 8); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v, v, v, v, v]); + } else { + super(v, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat2.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH() { + return 8 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + return new _Quat2( + x1, + y1, + z1, + w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1 + ); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, t) { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out, a) { + Mat4.getRotation(_Quat2.#TMP_QUAT, a); + Mat4.getTranslation(_Quat2.#TMP_VEC3, a); + return _Quat2.fromRotationTranslation(out, _Quat2.#TMP_QUAT, _Quat2.#TMP_VEC3); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out, a) { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out, q, a) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad *= 0.5; + const s = Math.sin(rad); + const bx = s * axis[0] / axisLength; + const by = s * axis[1] / axisLength; + const bz = s * axis[2] / axisLength; + const bw = Math.cos(rad); + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out, a, b) { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const mt = 1 - t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + let magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat2(${a.join(", ")})`; + } + /** + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } +}; +Quat2.dot = Quat.dot; +Quat2.squaredLength = Quat.squaredLength; +Quat2.sqrLen = Quat.squaredLength; +Quat2.mag = Quat.magnitude; +Quat2.length = Quat.magnitude; +Quat2.len = Quat.magnitude; +Quat2.mul = Quat2.multiply; + +// src/_lib/f32/Vec2.ts +var Vec2 = class _Vec2 extends Float32Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 2: { + const v = values[0]; + if (typeof v === "number") { + super([v, values[1]]); + } else { + super(v, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v]); + } else { + super(v, 0, 2); + } + break; + } + default: + super(2); + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec2.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec2.normalize(this, this); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH() { + return 2 * Float32Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out, a, b) { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out, a, b, rad) { + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a, b) { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a) { + return `Vec2(${a.join(", ")})`; + } +}; +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; + +// src/swizzle/index.ts +var GLM_SWIZZLES_ENABLED_F32 = false; +function EnableSwizzles() { + if (GLM_SWIZZLES_ENABLED_F32) { + return; + } + const VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + const VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + const VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + const SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function() { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function() { + return new Vec3( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]] + ); + }; + case 4: + return function() { + return new Vec4( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], + this[SWIZZLE_INDEX[swizzle[3]]] + ); + }; + } + throw new Error("Illegal swizzle length"); + } + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + GLM_SWIZZLES_ENABLED_F32 = true; +} + +// src/util/angleConversion.ts +var GLM_DEG_TO_RAD = Math.PI / 180; +var GLM_RAD_TO_DEG = 180 / Math.PI; +function toDegree(value) { + return value * GLM_RAD_TO_DEG; +} +function toRadian(value) { + return value * GLM_DEG_TO_RAD; +} +//# sourceMappingURL=gl-matrix-f32.cjs.map diff --git a/dist-cdn/cjs/2022/gl-matrix-f32.cjs.map b/dist-cdn/cjs/2022/gl-matrix-f32.cjs.map new file mode 100644 index 00000000..3f94a666 --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f32.cjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/cdn/index.ts", "../../../src/common/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides an all-inclusive ESM distribution of `gl-matrix` (32-bit). All library classes extends `Float32Array`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/* v8 ignore next 6 */\r\nexport * from '#gl-matrix';\r\nexport * from '#gl-matrix/classic';\r\nexport * from '#gl-matrix/swizzle';\r\nexport * from '#gl-matrix/types';\r\nexport * from '#gl-matrix/types/swizzle';\r\nexport * from '#gl-matrix/util';\r\n", "/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float32Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float32Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float32Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,cAAc;;;ACFpB,IAAM,OAAN,MAAM,cAAa,a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AC,CAAC,CAAC;AAAA,UAAC;AAAA,QACpE;AAAA,IACJ;AAEA,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;ACxIA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", + "names": [] +} diff --git a/dist-cdn/cjs/2022/gl-matrix-f32.min.cjs b/dist-cdn/cjs/2022/gl-matrix-f32.min.cjs new file mode 100644 index 00000000..f08aff8e --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f32.min.cjs @@ -0,0 +1,6 @@ +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) +var $=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var u=(h,e)=>{for(var t in e)$(h,t,{get:e[t],enumerable:!0})},_=(h,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of K(e))!v.call(h,s)&&s!==t&&$(h,s,{get:()=>e[s],enumerable:!(n=J(e,s))||n.enumerable});return h};var ee=h=>_($({},"__esModule",{value:!0}),h);var ie={};u(ie,{EnableSwizzles:()=>te,Mat2:()=>Y,Mat2d:()=>j,Mat3:()=>Z,Mat4:()=>P,Quat:()=>S,Quat2:()=>O,Vec2:()=>B,Vec3:()=>q,Vec4:()=>E,mat2:()=>Y,mat2d:()=>j,mat3:()=>Z,mat4:()=>P,quat:()=>S,quat2:()=>O,toDegree:()=>re,toRadian:()=>ae,vec2:()=>B,vec3:()=>q,vec4:()=>E});module.exports=ee(ie);var Y=class h extends Float32Array{static#t=new Float32Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}transpose(){return h.transpose(this,this)}invert(){return h.invert(this,this)}scale(e){return h.scale(this,this,e)}rotate(e){return h.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Y.prototype.mul=Y.prototype.multiply;Y.mul=Y.multiply;Y.sub=Y.subtract;var j=class h extends Float32Array{static#t=new Float32Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}translate(e){return h.translate(this,this,e)}rotate(e){return h.rotate(this,this,e)}scale(e){return h.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],M=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*b,e[3]=r*l+i*b,e[4]=s*M+a*d+c,e[5]=r*M+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],M=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-M)<=1e-6*Math.max(1,Math.abs(c),Math.abs(M))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var Z=class h extends Float32Array{static#t=new Float32Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}transpose(){return h.transpose(this,this)}invert(){return h.invert(this,this)}translate(e){return h.translate(this,this,e)}rotate(e){return h.rotate(this,this,e)}scale(e){return h.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,b=-k*a+c*y,M=L*a-i*y,d=n*l+s*b+r*M;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=b*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=M*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],M=n[1],d=n[2];return e[0]=b*s+M*i+d*L,e[1]=b*r+M*c+d*k,e[2]=b*a+M*y+d*l,b=n[3],M=n[4],d=n[5],e[3]=b*s+M*i+d*L,e[4]=b*r+M*c+d*k,e[5]=b*a+M*y+d*l,b=n[6],M=n[7],d=n[8],e[6]=b*s+M*i+d*L,e[7]=b*r+M*c+d*k,e[8]=b*a+M*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],M=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=b*s+M*i+L,e[7]=b*r+M*c+k,e[8]=b*a+M*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),M=Math.cos(n);return e[0]=M*s+b*i,e[1]=M*r+b*c,e[2]=M*a+b*y,e[3]=M*i-b*s,e[4]=M*c-b*r,e[5]=M*y-b*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,b=r*i,M=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[3]=k-x,e[6]=b+o,e[1]=k+x,e[4]=1-L-d,e[7]=M-m,e[2]=b-o,e[5]=M+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],M=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-b*d,f=k*x-M*d,I=l*o-b*m,F=l*x-M*m,N=b*x-M*o,Q=z*N-R*F+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*F+L*I)*Q,e[1]=(y*f-i*N-L*D)*Q,e[2]=(i*F-c*f+L*A)*Q,e[3]=(r*F-s*N-a*I)*Q,e[4]=(n*N-r*f+a*D)*Q,e[5]=(s*f-n*F-a*A)*Q,e[6]=(m*T-o*V+x*w)*Q,e[7]=(o*g-d*T-x*R)*Q,e[8]=(d*V-m*g+x*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],M=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-o)<=1e-6*Math.max(1,Math.abs(c),Math.abs(o))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var P=class h extends Float32Array{static#t=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}transpose(){return h.transpose(this,this)}invert(){return h.invert(this,this)}translate(e){return h.translate(this,this,e)}rotate(e,t){return h.rotate(this,this,e,t)}scale(e){return h.scale(this,this,e)}rotateX(e){return h.rotateX(this,this,e)}rotateY(e){return h.rotateY(this,this,e)}rotateZ(e){return h.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return h.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return h.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return h.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return h.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],M=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-b*d,f=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e[13],m=e[14],o=e[15],x=t*i-n*a,z=t*c-s*a,R=n*c-s*i,g=L*d-k*M,w=L*m-l*M,V=k*m-l*d,T=t*V-n*w+s*g,A=a*V-i*w+c*g,D=L*R-k*z+l*x,f=M*R-d*z+m*x;return y*T-r*A+o*D-b*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],M=t[10],d=t[11],m=t[12],o=t[13],x=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*b+V*o,e[2]=R*a+g*L+w*M+V*x,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*b+V*o,e[6]=R*a+g*L+w*M+V*x,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*b+V*o,e[10]=R*a+g*L+w*M+V*x,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*b+V*o,e[14]=R*a+g*L+w*M+V*x,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],M=t[7],d=t[8],m=t[9],o=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=M,e[8]=d,e[9]=m,e[10]=o,e[11]=x,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+b*r+o*a+t[14],e[15]=L*s+M*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],M=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,D=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,F=i*a*k+r*y,N=r*i*k+a*y,Q=a*i*k-r*y,G=i*i*k+L;return e[0]=l*T+m*A+R*D,e[1]=b*T+o*A+g*D,e[2]=M*T+x*A+w*D,e[3]=d*T+z*A+V*D,e[4]=l*f+m*I+R*F,e[5]=b*f+o*I+g*F,e[6]=M*f+x*I+w*F,e[7]=d*f+z*I+V*F,e[8]=l*N+m*Q+R*G,e[9]=b*N+o*Q+g*G,e[10]=M*N+x*Q+w*G,e[11]=d*N+z*Q+V*G,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,b=s*L,M=r*y,d=r*L,m=a*L,o=i*c,x=i*y,z=i*L;return e[0]=1-(M+m),e[1]=l+z,e[2]=b-x,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+o,e[7]=0,e[8]=b+x,e[9]=d-o,e[10]=1-(k+M),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(h.#e[0]=(i*a+L*n+c*r-y*s)*2/k,h.#e[1]=(c*a+L*s+y*n-i*r)*2/k,h.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(h.#e[0]=(i*a+L*n+c*r-y*s)*2,h.#e[1]=(c*a+L*s+y*n-i*r)*2,h.#e[2]=(y*a+L*r+i*s-c*n)*2),h.fromRotationTranslation(e,t,h.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],M=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-b*d,f=k*x-M*d,I=l*o-b*m,F=l*x-M*m,N=b*x-M*o,Q=z*N-R*F+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*N-y*F+L*I)*Q,e[1]=(y*f-i*N-L*D)*Q,e[2]=(i*F-c*f+L*A)*Q,e[3]=0,e[4]=(r*F-s*N-a*I)*Q,e[5]=(n*N-r*f+a*D)*Q,e[6]=(s*f-n*F-a*A)*Q,e[7]=0,e[8]=(m*T-o*V+x*w)*Q,e[9]=(o*g-d*T-x*R)*Q,e[10]=(d*V-m*g+x*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){h.getScaling(h.#e,t);let n=1/h.#e[0],s=1/h.#e[1],r=1/h.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,M=t[10]*r,d=a+L+M,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-b)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>M?(m=Math.sqrt(1+a-L-M)*2,e[3]=(k-b)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>M?(m=Math.sqrt(1+L-a-M)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+b)/m):(m=Math.sqrt(1+M-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+b)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let M=1/n[0],d=1/n[1],m=1/n[2],o=r*M,x=a*d,z=i*m,R=c*M,g=y*d,w=L*m,V=k*M,T=l*d,A=b*m,D=o+g+A,f=0;return D>0?(f=Math.sqrt(D+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(x-R)/f):o>g&&o>A?(f=Math.sqrt(1+o-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(x+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-o-A)*2,e[3]=(V-z)/f,e[0]=(x+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-o-g)*2,e[3]=(x-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,b=r*L,M=r*k,d=a*L,m=a*k,o=i*k,x=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+o))*g,e[1]=(b+R)*g,e[2]=(M-z)*g,e[3]=0,e[4]=(b-R)*w,e[5]=(1-(l+o))*w,e[6]=(m+x)*w,e[7]=0,e[8]=(M+z)*V,e[9]=(m-x)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,b=a*L,M=a*k,d=a*l,m=i*k,o=i*l,x=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],D=r[1],f=r[2],I=(1-(m+x))*w,F=(M+g)*w,N=(d-R)*w,Q=(M-g)*V,G=(1-(b+x))*V,X=(o+z)*V,C=(d+R)*T,H=(o-z)*T,W=(1-(b+m))*T;return e[0]=I,e[1]=F,e[2]=N,e[3]=0,e[4]=Q,e[5]=G,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=W,e[11]=0,e[12]=n[0]+A-(I*A+Q*D+C*f),e[13]=n[1]+D-(F*A+G*D+H*f),e[14]=n[2]+f-(N*A+X*D+W*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,b=r*i,M=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[1]=k+x,e[2]=b-o,e[3]=0,e[4]=k-x,e[5]=1-L-d,e[6]=M+m,e[7]=0,e[8]=b+o,e[9]=M-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-b)<1e-6)return h.identity(e);let M=r-k,d=a-l,m=i-b,o=1/Math.sqrt(M*M+d*d+m*m);M*=o,d*=o,m*=o;let x=y*m-L*d,z=L*M-c*m,R=c*d-y*M;o=Math.sqrt(x*x+z*z+R*R),o?(o=1/o,x*=o,z*=o,R*=o):(x=0,z=0,R=0);let g=d*R-m*z,w=m*x-M*R,V=M*z-d*x;return o=Math.sqrt(g*g+w*w+V*V),o?(o=1/o,g*=o,w*=o,V*=o):(g=0,w=0,V=0),e[0]=x,e[1]=g,e[2]=M,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(x*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(M*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],b=i-n[2],M=k*k+l*l+b*b;M>0&&(M=1/Math.sqrt(M),k*=M,l*=M,b*=M);let d=y*b-L*l,m=L*k-c*b,o=c*l-y*k;return M=d*d+m*m+o*o,M>0&&(M=1/Math.sqrt(M),d*=M,m*=M,o*=M),e[0]=d,e[1]=m,e[2]=o,e[3]=0,e[4]=l*o-b*m,e[5]=b*d-k*o,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],M=e[11],d=e[12],m=e[13],o=e[14],x=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],D=t[7],f=t[8],I=t[9],F=t[10],N=t[11],Q=t[12],G=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-D)<=1e-6*Math.max(1,Math.abs(L),Math.abs(D))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(b-F)<=1e-6*Math.max(1,Math.abs(b),Math.abs(F))&&Math.abs(M-N)<=1e-6*Math.max(1,Math.abs(M),Math.abs(N))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-G)<=1e-6*Math.max(1,Math.abs(m),Math.abs(G))&&Math.abs(o-X)<=1e-6*Math.max(1,Math.abs(o),Math.abs(X))&&Math.abs(x-C)<=1e-6*Math.max(1,Math.abs(x),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class h extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return h.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return h.distance(this,e)}dist(e){return 0}squaredDistance(e){return h.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return h.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new h(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(h.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,b=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,b=s*y-r*c,M=(r*b-a*l)*2,d=(a*k-s*b)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+M,e[1]=y+l*i+d,e[2]=L+b*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&h.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class h extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return h.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return h.distance(this,e)}dist(e){return 0}squaredDistance(e){return h.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return h.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static fromValues(e,t,n,s){return new h(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],M=t[3];return e[0]=l*L-b*y+M*c,e[1]=-(k*L)+b*i-M*a,e[2]=k*y-l*i+M*r,e[3]=-(k*c)+l*a-b*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,b=L*a+i*r-c*s,M=-i*s-c*r-y*a;return e[0]=k*L+M*-i+l*-y-b*-c,e[1]=l*L+M*-c+b*-i-k*-y,e[2]=b*L+M*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var S=class h extends Float32Array{static#t="zyx";static#e=new Float32Array(4);static#r=new Float32Array(4);static#n=new Float32Array(9);static#s=new Float32Array(3);static#a=new Float32Array([1,0,0]);static#i=new Float32Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return h.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}rotateX(e){return h.rotateX(this,this,e)}rotateY(e){return h.rotateY(this,this,e)}rotateZ(e){return h.rotateZ(this,this,e)}invert(){return h.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return h.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=h.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return h.ln(e,t),h.scale(e,e,n),h.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,M,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),o=Math.sin(m);b=Math.sin((1-s)*m)/o,M=Math.sin(s*m)/o}else b=1-s,M=s;return e[0]=b*r+M*y,e[1]=b*a+M*L,e[2]=b*i+M*k,e[3]=b*c+M*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=h.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new h(e)}static fromValues(e,t,n,s){return new h(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(h.#s,h.#a,t),q.mag(h.#s)<1e-6&&q.cross(h.#s,h.#i,t),q.normalize(h.#s,h.#s),h.setAxisAngle(e,h.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(h.#s,t,n),e[0]=h.#s[0],e[1]=h.#s[1],e[2]=h.#s[2],e[3]=1+s,h.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return h.slerp(h.#e,t,r,a),h.slerp(h.#r,n,s,a),h.slerp(e,h.#e,h.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return h.#n[0]=n[0],h.#n[3]=n[1],h.#n[6]=n[2],h.#n[1]=s[0],h.#n[4]=s[1],h.#n[7]=s[2],h.#n[2]=-t[0],h.#n[5]=-t[1],h.#n[8]=-t[2],h.normalize(e,h.fromMat3(e,h.#n))}};S.set=E.set;S.add=E.add;S.lerp=E.lerp;S.normalize=E.normalize;S.squaredLength=E.squaredLength;S.sqrLen=E.squaredLength;S.exactEquals=E.exactEquals;S.equals=E.equals;S.magnitude=E.magnitude;S.prototype.mul=S.prototype.multiply;S.mul=S.multiply;S.mag=S.magnitude;S.length=S.magnitude;S.len=S.magnitude;var O=class h extends Float32Array{static#t=new Float32Array(4);static#e=new Float32Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return h.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static fromValues(e,t,n,s,r,a,i,c){return new h(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new h(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(h.#t,t),P.getTranslation(h.#e,t),h.fromRotationTranslation(e,h.#t,h.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],M=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+b,e[7]=-s*c-r*y-a*L+M,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,b=y*i+k*r+L*s-c*a,M=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return S.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+b*a-M*r,e[5]=b*i+d*r+M*s-l*a,e[6]=M*i+d*a+l*r-b*s,e[7]=d*i-l*s-b*r-M*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,b=y*i+k*r+L*s-c*a,M=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return S.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+b*a-M*r,e[5]=b*i+d*r+M*s-l*a,e[6]=M*i+d*a+l*r-b*s,e[7]=d*i-l*s-b*r-M*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,b=y*i+k*r+L*s-c*a,M=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return S.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+b*a-M*r,e[5]=b*i+d*r+M*s-l*a,e[6]=M*i+d*a+l*r-b*s,e[7]=d*i-l*s-b*r-M*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return h.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],M=t[3];e[0]=k*L+M*i+l*y-b*c,e[1]=l*L+M*c+b*i-k*y,e[2]=b*L+M*y+k*c-l*i,e[3]=M*L-k*i-l*c-b*y;let d=t[4],m=t[5],o=t[6],x=t[7];return e[4]=d*L+x*i+m*y-o*c,e[5]=m*L+x*c+o*i-d*y,e[6]=o*L+x*y+d*c-m*i,e[7]=x*L-d*i-m*c-o*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],M=t[6],d=t[7],m=n[0],o=n[1],x=n[2],z=n[3];return e[0]=s*z+i*m+r*x-a*o,e[1]=r*z+i*o+a*m-s*x,e[2]=a*z+i*x+s*o-r*m,e[3]=i*z-s*m-r*o-a*x,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+b*x-M*o,e[5]=r*k+i*y+a*c-s*L+b*z+d*o+M*m-l*x,e[6]=a*k+i*L+s*y-r*c+M*z+d*x+l*o-b*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-b*o-M*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return h.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=h.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=h.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],M=t[3],d=t[4],m=t[5],o=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};O.dot=S.dot;O.squaredLength=S.squaredLength;O.sqrLen=S.squaredLength;O.mag=S.magnitude;O.length=S.magnitude;O.len=S.magnitude;O.mul=O.multiply;var B=class h extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return h.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return h.distance(this,e)}dist(e){return 0}squaredDistance(e){return h.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return h.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static fromValues(e,t){return new h(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};B.prototype.sub=B.prototype.subtract;B.prototype.mul=B.prototype.multiply;B.prototype.div=B.prototype.divide;B.prototype.dist=B.prototype.distance;B.prototype.sqrDist=B.prototype.squaredDistance;B.sub=B.subtract;B.mul=B.multiply;B.div=B.divide;B.dist=B.distance;B.sqrDist=B.squaredDistance;B.sqrLen=B.squaredLength;B.mag=B.magnitude;B.length=B.magnitude;B.len=B.magnitude;var U=!1;function te(){if(U)return;let h=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new B(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error("Illegal swizzle length")}for(let r of h){let a=s(r);Object.defineProperty(B.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}U=!0}var ne=Math.PI/180,se=180/Math.PI;function re(h){return h*se}function ae(h){return h*ne} +//# sourceMappingURL=gl-matrix-f32.min.cjs.map diff --git a/dist-cdn/cjs/2022/gl-matrix-f32.min.cjs.map b/dist-cdn/cjs/2022/gl-matrix-f32.min.cjs.map new file mode 100644 index 00000000..8b9a23e1 --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f32.min.cjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/cdn/index.ts", "../../../src/_lib/f32/Mat2.ts", "../../../src/_lib/f32/Mat2d.ts", "../../../src/_lib/f32/Mat3.ts", "../../../src/_lib/f32/Mat4.ts", "../../../src/_lib/f32/Vec3.ts", "../../../src/_lib/f32/Vec4.ts", "../../../src/_lib/f32/Quat.ts", "../../../src/_lib/f32/Quat2.ts", "../../../src/_lib/f32/Vec2.ts", "../../../src/swizzle/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides an all-inclusive ESM distribution of `gl-matrix` (32-bit). All library classes extends `Float32Array`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/* v8 ignore next 6 */\r\nexport * from '#gl-matrix';\r\nexport * from '#gl-matrix/classic';\r\nexport * from '#gl-matrix/swizzle';\r\nexport * from '#gl-matrix/types';\r\nexport * from '#gl-matrix/types/swizzle';\r\nexport * from '#gl-matrix/util';\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float32Array {\r\n static #IDENTITY_2X2 = new Float32Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float32Array {\r\n static #IDENTITY_2X3 = new Float32Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float32Array {\r\n static #IDENTITY_3X3 = new Float32Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float32Array {\r\n static #IDENTITY_4X4 = new Float32Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float32Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float32Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float32Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float32Array(4);\r\n static #TMP_QUAT2 = new Float32Array(4);\r\n static #TMP_MAT3 = new Float32Array(9);\r\n\r\n static #TMP_VEC3 = new Float32Array(3);\r\n static #X_UNIT_VEC3 = new Float32Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float32Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float32Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float32Array(4);\r\n static #TMP_VEC3 = new Float32Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float32Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from\r\n * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please\r\n * see {@link gl-matrix/types/swizzle}.\r\n *\r\n * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix';\r\n * import { EnableSwizzles } from 'gl-matrix/swizzle';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (32-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F32 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} /\r\n * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3, EnableSwizzles } from 'gl-matrix';\r\n *\r\n * EnableSwizzles();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzles(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F32) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float32Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float32Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float32Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F32 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;6ZAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,oBAAAE,GAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,SAAAR,EAAA,UAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,aAAAI,GAAA,aAAAC,GAAA,SAAAJ,EAAA,SAAAC,EAAA,SAAAC,IAAA,eAAAG,GAAAd,ICOO,IAAMe,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAoE,CACjF,OAAQA,EAAO,OAAQ,CACrB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMH,EAAKC,EAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOD,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAIJ,EAA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EAAK,KAAKL,EAAcE,EAAQ,CAAC,CAAC,CAAC,EAAG,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,EAC7E,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,EAAG,KAAKF,EAAcE,EAAQ,CAAC,CAAC,CAAC,CAAC,CACpE,CACJ,CAEA,MAAM,IAAI,MAAM,wBAAwB,CAC1C,CAEA,QAAWA,KAAWL,EAAe,CACnC,IAAMS,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeC,EAAK,UAAWD,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeF,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CCxIA,IAAMY,GAAyB,KAAK,GAAK,IAKnCC,GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", + "names": ["cdn_exports", "__export", "EnableSwizzles", "Mat2", "Mat2d", "Mat3", "Mat4", "Quat", "Quat2", "Vec2", "Vec3", "Vec4", "toDegree", "toRadian", "__toCommonJS", "Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F32", "EnableSwizzles", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] +} diff --git a/dist-cdn/cjs/2022/gl-matrix-f64.cjs b/dist-cdn/cjs/2022/gl-matrix-f64.cjs new file mode 100644 index 00000000..e3a1a258 --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f64.cjs @@ -0,0 +1,9527 @@ +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/cdn/f64/index.ts +var f64_exports = {}; +__export(f64_exports, { + EnableSwizzlesF64: () => EnableSwizzlesF64, + Mat2: () => Mat2, + Mat2d: () => Mat2d, + Mat3: () => Mat3, + Mat4: () => Mat4, + Quat: () => Quat, + Quat2: () => Quat2, + Vec2: () => Vec2, + Vec3: () => Vec3, + Vec4: () => Vec4, + toDegree: () => toDegree, + toRadian: () => toRadian +}); +module.exports = __toCommonJS(f64_exports); + +// src/common/index.ts +var GLM_EPSILON = 1e-6; + +// src/_lib/f64/Mat2.ts +var Mat2 = class _Mat2 extends Float64Array { + static #IDENTITY_2X2 = new Float64Array([ + 1, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v + ]); + } else { + super(v, 0, 4); + } + break; + default: + super(_Mat2.#IDENTITY_2X2); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2.str(this); + } + // =================== + // Instance methods + // =================== + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity() { + this.set(_Mat2.#IDENTITY_2X2); + return this; + } + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b) { + return _Mat2.multiply(this, this, b); + } + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose() { + return _Mat2.transpose(this, this); + } + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert() { + return _Mat2.invert(this, this); + } + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v) { + return _Mat2.scale(this, this, v); + } + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad) { + return _Mat2.rotate(this, this, rad); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create() { + return new _Mat2(); + } + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a) { + return new _Mat2(a); + } + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values) { + return new _Mat2(...values); + } + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + return out; + } + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + return out; + } + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + let det = a0 * a3 - a2 * a1; + if (!det) { + return null; + } + det = 1 / det; + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + return out; + } + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[2] * a[1]; + } + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; + } + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; + } + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; + } + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; + } + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]); + } + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; + } + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU(L, D, U, a) { + L[2] = a[2] / a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; + } + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2(${a.join(", ")})`; + } +}; +Mat2.prototype.mul = Mat2.prototype.multiply; +Mat2.mul = Mat2.multiply; +Mat2.sub = Mat2.subtract; + +// src/_lib/f64/Mat2d.ts +var Mat2d = class _Mat2d extends Float64Array { + static #IDENTITY_2X3 = new Float64Array([ + 1, + 0, + 0, + 1, + 0, + 0 + ]); + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 6: + super(values); + break; + case 2: + super(values[0], values[1], 6); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 6); + } + break; + default: + super(_Mat2d.#IDENTITY_2X3); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat2d.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat2d.#IDENTITY_2X3); + return this; + } + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat2d.multiply(this, this, b); + } + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat2d.translate(this, this, v); + } + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat2d.rotate(this, this, rad); + } + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat2d.scale(this, this, v); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH() { + return 6 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create() { + return new _Mat2d(); + } + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a) { + return new _Mat2d(a); + } + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; + } + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values) { + return new _Mat2d(...values); + } + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + return out; + } + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const aa = a[0]; + const ab = a[1]; + const ac = a[2]; + const ad = a[3]; + const atx = a[4]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + } + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + return a[0] * a[3] - a[1] * a[2]; + } + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; + } + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; + } + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; + } + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; + } + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const v0 = v[0]; + const v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; + } + // TODO: Got to fromRotation + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; + } + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1); + } + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; + } + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + return out; + } + /** + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)); + } + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat2d(${a.join(", ")})`; + } +}; +Mat2d.mul = Mat2d.multiply; +Mat2d.sub = Mat2d.subtract; + +// src/_lib/f64/Mat3.ts +var Mat3 = class _Mat3 extends Float64Array { + static #IDENTITY_3X3 = new Float64Array([ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 + ]); + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 9: + super(values); + break; + case 2: + super(values[0], values[1], 9); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 9); + } + break; + default: + super(_Mat3.#IDENTITY_3X3); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat3.str(this); + } + // =================== + // Instance methods + // =================== + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat3.#IDENTITY_3X3); + return this; + } + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat3.multiply(this, this, b); + } + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat3.transpose(this, this); + } + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat3.invert(this, this); + } + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v) { + return _Mat3.translate(this, this, v); + } + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad) { + return _Mat3.rotate(this, this, rad); + } + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat3.scale(this, this, v); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH() { + return 9 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create() { + return new _Mat3(); + } + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a) { + return new _Mat3(a); + } + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values) { + return new _Mat3(...values); + } + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + return out; + } + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + return out; + } + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2]; + const a10 = a[3], a11 = a[4], a12 = a[5]; + const a20 = a[6], a21 = a[7], a22 = a[8]; + const b01 = a22 * a11 - a12 * a21; + const b11 = -a22 * a10 + a12 * a20; + const b21 = a21 * a10 - a11 * a20; + let det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + out[0] = a11 * a22 - a12 * a21; + out[1] = a02 * a21 - a01 * a22; + out[2] = a01 * a12 - a02 * a11; + out[3] = a12 * a20 - a10 * a22; + out[4] = a00 * a22 - a02 * a20; + out[5] = a02 * a10 - a00 * a12; + out[6] = a10 * a21 - a11 * a20; + out[7] = a01 * a20 - a00 * a21; + out[8] = a00 * a11 - a01 * a10; + return out; + } + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + } + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; + } + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20; + out[1] = b0 * a01 + b1 * a11 + b2 * a21; + out[2] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[3]; + b1 = b[4]; + b2 = b[5]; + out[3] = b0 * a00 + b1 * a10 + b2 * a20; + out[4] = b0 * a01 + b1 * a11 + b2 * a21; + out[5] = b0 * a02 + b1 * a12 + b2 * a22; + b0 = b[6]; + b1 = b[7]; + b2 = b[8]; + out[6] = b0 * a00 + b1 * a10 + b2 * a20; + out[7] = b0 * a01 + b1 * a11 + b2 * a21; + out[8] = b0 * a02 + b1 * a12 + b2 * a22; + return out; + } + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const x = v[0]; + const y = v[1]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a10; + out[4] = a11; + out[5] = a12; + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; + } + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out, a, rad) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[3]; + const a11 = a[4]; + const a12 = a[5]; + const a20 = a[6]; + const a21 = a[7]; + const a22 = a[8]; + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; + } + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; + } + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = -s; + out[4] = c; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; + } + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + return out; + } + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; + } + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + return out; + } + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = cy * az - cz * ay; + out[4] = cz * ax - cx * az; + out[5] = cx * ay - cy * ax; + out[6] = ay * bz - az * by; + out[7] = az * bx - ax * bz; + out[8] = ax * by - ay * bx; + return out; + } + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out, width, height) { + out[0] = 2 / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = -2 / height; + out[5] = 0; + out[6] = -1; + out[7] = 1; + out[8] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + ); + } + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; + } + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + return out; + } + /** + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)); + } + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat3(${a.join(", ")})`; + } +}; +Mat3.prototype.mul = Mat3.prototype.multiply; +Mat3.mul = Mat3.multiply; +Mat3.sub = Mat3.subtract; + +// src/_lib/f64/Mat4.ts +var Mat4 = class _Mat4 extends Float64Array { + static #IDENTITY_4X4 = new Float64Array([ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ]); + /** + * Temporary variable to prevent repeated allocations in the algorithms within Mat4. + * These are declared as TypedArrays to aid in tree-shaking. + */ + static #TMP_VEC3 = new Float64Array(3); + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 16: + super(values); + break; + case 2: + super(values[0], values[1], 16); + break; + case 1: + const v = values[0]; + if (typeof v === "number") { + super([ + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v, + v + ]); + } else { + super(v, 0, 16); + } + break; + default: + super(_Mat4.#IDENTITY_4X4); + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str() { + return _Mat4.str(this); + } + // =================== + // Instance methods + // =================== + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this.set(_Mat4.#IDENTITY_4X4); + return this; + } + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b) { + return _Mat4.multiply(this, this, b); + } + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose() { + return _Mat4.transpose(this, this); + } + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Mat4.invert(this, this); + } + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v) { + return _Mat4.translate(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad, axis) { + return _Mat4.rotate(this, this, rad, axis); + } + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v) { + return _Mat4.scale(this, this, v); + } + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad) { + return _Mat4.rotateX(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad) { + return _Mat4.rotateY(this, this, rad); + } + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad) { + return _Mat4.rotateZ(this, this, rad); + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy, aspect, near, far) { + return _Mat4.perspectiveNO(this, fovy, aspect, near, far); + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy, aspect, near, far) { + return _Mat4.perspectiveZO(this, fovy, aspect, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left, right, bottom, top, near, far) { + return _Mat4.orthoNO(this, left, right, bottom, top, near, far); + } + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left, right, bottom, top, near, far) { + return _Mat4.orthoZO(this, left, right, bottom, top, near, far); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH() { + return 16 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create() { + return new _Mat4(); + } + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a) { + return new _Mat4(a); + } + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values) { + return new _Mat4(...values); + } + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out, ...values) { + out[0] = values[0]; + out[1] = values[1]; + out[2] = values[2]; + out[3] = values[3]; + out[4] = values[4]; + out[5] = values[5]; + out[6] = values[6]; + out[7] = values[7]; + out[8] = values[8]; + out[9] = values[9]; + out[10] = values[10]; + out[11] = values[11]; + out[12] = values[12]; + out[13] = values[13]; + out[14] = values[14]; + out[15] = values[15]; + return out; + } + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out, a) { + if (out === a) { + const a01 = a[1], a02 = a[2], a03 = a[3]; + const a12 = a[6], a13 = a[7]; + const a23 = a[11]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + return out; + } + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return out; + } + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out, a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + out[0] = a11 * b11 - a12 * b10 + a13 * b09; + out[1] = a02 * b10 - a01 * b11 - a03 * b09; + out[2] = a31 * b05 - a32 * b04 + a33 * b03; + out[3] = a22 * b04 - a21 * b05 - a23 * b03; + out[4] = a12 * b08 - a10 * b11 - a13 * b07; + out[5] = a00 * b11 - a02 * b08 + a03 * b07; + out[6] = a32 * b02 - a30 * b05 - a33 * b01; + out[7] = a20 * b05 - a22 * b02 + a23 * b01; + out[8] = a10 * b10 - a11 * b08 + a13 * b06; + out[9] = a01 * b08 - a00 * b10 - a03 * b06; + out[10] = a30 * b04 - a31 * b02 + a33 * b00; + out[11] = a21 * b02 - a20 * b04 - a23 * b00; + out[12] = a11 * b07 - a10 * b09 - a12 * b06; + out[13] = a00 * b09 - a01 * b07 + a02 * b06; + out[14] = a31 * b01 - a30 * b03 - a32 * b00; + out[15] = a20 * b03 - a21 * b01 + a22 * b00; + return out; + } + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a) { + const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; + const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; + const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; + const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + const b0 = a00 * a11 - a01 * a10; + const b1 = a00 * a12 - a02 * a10; + const b2 = a01 * a12 - a02 * a11; + const b3 = a20 * a31 - a21 * a30; + const b4 = a20 * a32 - a22 * a30; + const b5 = a21 * a32 - a22 * a31; + const b6 = a00 * b5 - a01 * b4 + a02 * b3; + const b7 = a10 * b5 - a11 * b4 + a12 * b3; + const b8 = a20 * b2 - a21 * b1 + a22 * b0; + const b9 = a30 * b2 - a31 * b1 + a32 * b0; + return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9; + } + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + let b0 = b[0]; + let b1 = b[1]; + let b2 = b[2]; + let b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + return out; + } + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + out[0] = a00; + out[1] = a01; + out[2] = a02; + out[3] = a03; + out[4] = a10; + out[5] = a11; + out[6] = a12; + out[7] = a13; + out[8] = a20; + out[9] = a21; + out[10] = a22; + out[11] = a23; + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + return out; + } + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out, a, v) { + const x = v[0]; + const y = v[1]; + const z = v[2]; + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; + } + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out, a, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const b00 = x * x * t + c; + const b01 = y * x * t + z * s; + const b02 = z * x * t - y * s; + const b10 = x * y * t - z * s; + const b11 = y * y * t + c; + const b12 = z * y * t + x * s; + const b20 = x * z * t + y * s; + const b21 = y * z * t - x * s; + const b22 = z * z * t + c; + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + if (a !== out) { + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; + } + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out, a, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + if (a !== out) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; + } + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out, a, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + if (a !== out) { + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; + } + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out, a, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + if (a !== out) { + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; + } + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out, rad, axis) { + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + let len = Math.sqrt(x * x + y * y + z * z); + if (len < GLM_EPSILON) { + return null; + } + len = 1 / len; + x *= len; + y *= len; + z *= len; + const s = Math.sin(rad); + const c = Math.cos(rad); + const t = 1 - c; + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out, rad) { + const s = Math.sin(rad); + const c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, v) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out, a) { + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const magnitude = bx * bx + by * by + bz * bz + bw * bw; + if (magnitude > 0) { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; + } else { + _Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + _Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + _Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + } + _Mat4.fromRotationTranslation(out, a, _Mat4.#TMP_VEC3); + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out, a) { + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4]; + const a11 = a[5]; + const a12 = a[6]; + const a13 = a[7]; + const a20 = a[8]; + const a21 = a[9]; + const a22 = a[10]; + const a23 = a[11]; + const a30 = a[12]; + const a31 = a[13]; + const a32 = a[14]; + const a33 = a[15]; + const b00 = a00 * a11 - a01 * a10; + const b01 = a00 * a12 - a02 * a10; + const b02 = a00 * a13 - a03 * a10; + const b03 = a01 * a12 - a02 * a11; + const b04 = a01 * a13 - a03 * a11; + const b05 = a02 * a13 - a03 * a12; + const b06 = a20 * a31 - a21 * a30; + const b07 = a20 * a32 - a22 * a30; + const b08 = a20 * a33 - a23 * a30; + const b09 = a21 * a32 - a22 * a31; + const b10 = a21 * a33 - a23 * a31; + const b11 = a22 * a33 - a23 * a32; + let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[3] = 0; + out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[7] = 0; + out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out, a) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = a[4]; + const by = a[5]; + const bz = a[6]; + const cx = a[8]; + const cy = a[9]; + const cz = a[10]; + out[0] = by * cz - cz * cy; + out[1] = bz * cx - cx * cz; + out[2] = bx * cy - cy * cx; + out[3] = 0; + out[4] = cy * az - cz * ay; + out[5] = cz * ax - cx * az; + out[6] = cx * ay - cy * ax; + out[7] = 0; + out[8] = ay * bz - az * by; + out[9] = az * bx - ax * bz; + out[10] = ax * by - ay * bx; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + return out; + } + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out, mat) { + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + return out; + } + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out, mat) { + _Mat4.getScaling(_Mat4.#TMP_VEC3, mat); + const is1 = 1 / _Mat4.#TMP_VEC3[0]; + const is2 = 1 / _Mat4.#TMP_VEC3[1]; + const is3 = 1 / _Mat4.#TMP_VEC3[2]; + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + return out; + } + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r, out_t, out_s, mat) { + out_t[0] = mat[12]; + out_t[1] = mat[13]; + out_t[2] = mat[14]; + const m11 = mat[0]; + const m12 = mat[1]; + const m13 = mat[2]; + const m21 = mat[4]; + const m22 = mat[5]; + const m23 = mat[6]; + const m31 = mat[8]; + const m32 = mat[9]; + const m33 = mat[10]; + out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13); + out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23); + out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33); + const is1 = 1 / out_s[0]; + const is2 = 1 / out_s[1]; + const is3 = 1 / out_s[2]; + const sm11 = m11 * is1; + const sm12 = m12 * is2; + const sm13 = m13 * is3; + const sm21 = m21 * is1; + const sm22 = m22 * is2; + const sm23 = m23 * is3; + const sm31 = m31 * is1; + const sm32 = m32 * is2; + const sm33 = m33 * is3; + const trace = sm11 + sm22 + sm33; + let S = 0; + if (trace > 0) { + S = Math.sqrt(trace + 1) * 2; + out_r[3] = 0.25 * S; + out_r[0] = (sm23 - sm32) / S; + out_r[1] = (sm31 - sm13) / S; + out_r[2] = (sm12 - sm21) / S; + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2; + out_r[3] = (sm23 - sm32) / S; + out_r[0] = 0.25 * S; + out_r[1] = (sm12 + sm21) / S; + out_r[2] = (sm31 + sm13) / S; + } else if (sm22 > sm33) { + S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2; + out_r[3] = (sm31 - sm13) / S; + out_r[0] = (sm12 + sm21) / S; + out_r[1] = 0.25 * S; + out_r[2] = (sm23 + sm32) / S; + } else { + S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2; + out_r[3] = (sm12 - sm21) / S; + out_r[0] = (sm31 + sm13) / S; + out_r[1] = (sm23 + sm32) / S; + out_r[2] = 0.25 * S; + } + return out_r; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale(out, q, v, s) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; + } + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin(out, q, v, s, o) { + 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 xy = x * y2; + const xz = x * z2; + const yy = y * y2; + const yz = y * z2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + const sx = s[0]; + const sy = s[1]; + const sz = s[2]; + const ox = o[0]; + const oy = o[1]; + const oz = o[2]; + const out0 = (1 - (yy + zz)) * sx; + const out1 = (xy + wz) * sx; + const out2 = (xz - wy) * sx; + const out4 = (xy - wz) * sy; + const out5 = (1 - (xx + zz)) * sy; + const out6 = (yz + wx) * sy; + const out8 = (xz + wy) * sz; + const out9 = (yz - wx) * sz; + const out10 = (1 - (xx + yy)) * sz; + out[0] = out0; + out[1] = out1; + out[2] = out2; + out[3] = 0; + out[4] = out4; + out[5] = out5; + out[6] = out6; + out[7] = 0; + out[8] = out8; + out[9] = out9; + out[10] = out10; + out[11] = 0; + out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); + out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); + out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); + out[15] = 1; + return out; + } + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out, q) { + 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; + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; + } + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum(out, left, right, bottom, top, near, far = Infinity) { + return out; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO(out, left, right, bottom, top, near, far = Infinity) { + const rl = 1 / (right - left); + const tb = 1 / (top - bottom); + out[0] = near * 2 * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = near * 2 * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = (far + near) * nf; + out[14] = 2 * far * near * nf; + } else { + out[10] = -1; + out[14] = -2 * near; + } + return out; + } + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static perspective(out, fovy, aspect, near, far = Infinity) { + return out; + } + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out, fovy, aspect, near, far = Infinity) { + const f = 1 / Math.tan(fovy / 2); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[15] = 0; + if (far != null && far !== Infinity) { + const nf = 1 / (near - far); + out[10] = far * nf; + out[14] = far * near * nf; + } else { + out[10] = -1; + out[14] = -near; + } + return out; + } + /** + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView(out, fov, near, far) { + const upTan = Math.tan(fov.upDegrees * Math.PI / 180); + const downTan = Math.tan(fov.downDegrees * Math.PI / 180); + const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180); + const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180); + const xScale = 2 / (leftTan + rightTan); + const yScale = 2 / (upTan + downTan); + out[0] = xScale; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = yScale; + out[6] = 0; + out[7] = 0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = (upTan - downTan) * yScale * 0.5; + out[10] = far / (near - far); + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = far * near / (near - far); + out[15] = 0; + return out; + } + /** + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; + } + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static ortho(out, left, right, bottom, top, near, far) { + return out; + } + /** + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO(out, left, right, bottom, top, near, far) { + const lr = 1 / (left - right); + const bt = 1 / (bottom - top); + const nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = near * nf; + out[15] = 1; + return out; + } + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out, eye, center, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + const centerx = center[0]; + const centery = center[1]; + const centerz = center[2]; + if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) { + return _Mat4.identity(out); + } + let z0 = eyex - centerx; + let z1 = eyey - centery; + let z2 = eyez - centerz; + let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + let y0 = z1 * x2 - z2 * x1; + let y1 = z2 * x0 - z0 * x2; + let y2 = z0 * x1 - z1 * x0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + return out; + } + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out, eye, target, up) { + const eyex = eye[0]; + const eyey = eye[1]; + const eyez = eye[2]; + const upx = up[0]; + const upy = up[1]; + const upz = up[2]; + let z0 = eyex - target[0]; + let z1 = eyey - target[1]; + let z2 = eyez - target[2]; + let len = z0 * z0 + z1 * z1 + z2 * z2; + if (len > 0) { + len = 1 / Math.sqrt(len); + z0 *= len; + z1 *= len; + z2 *= len; + } + let x0 = upy * z2 - upz * z1; + let x1 = upz * z0 - upx * z2; + let x2 = upx * z1 - upy * z0; + len = x0 * x0 + x1 * x1 + x2 * x2; + if (len > 0) { + len = 1 / Math.sqrt(len); + x0 *= len; + x1 *= len; + x2 *= len; + } + out[0] = x0; + out[1] = x1; + out[2] = x2; + out[3] = 0; + out[4] = z1 * x2 - z2 * x1; + out[5] = z2 * x0 - z0 * x2; + out[6] = z0 * x1 - z1 * x0; + out[7] = 0; + out[8] = z0; + out[9] = z1; + out[10] = z2; + out[11] = 0; + out[12] = eyex; + out[13] = eyey; + out[14] = eyez; + out[15] = 1; + return out; + } + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a) { + return Math.sqrt( + a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15] + ); + } + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; + } + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; + } + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; + } + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + out[4] = a[4] + b[4] * scale; + out[5] = a[5] + b[5] * scale; + out[6] = a[6] + b[6] * scale; + out[7] = a[7] + b[7] * scale; + out[8] = a[8] + b[8] * scale; + out[9] = a[9] + b[9] * scale; + out[10] = a[10] + b[10] * scale; + out[11] = a[11] + b[11] * scale; + out[12] = a[12] + b[12] * scale; + out[13] = a[13] + b[13] * scale; + out[14] = a[14] + b[14] * scale; + out[15] = a[15] + b[15] * scale; + return out; + } + /** + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const a8 = a[8]; + const a9 = a[9]; + const a10 = a[10]; + const a11 = a[11]; + const a12 = a[12]; + const a13 = a[13]; + const a14 = a[14]; + const a15 = a[15]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + const b8 = b[8]; + const b9 = b[9]; + const b10 = b[10]; + const b11 = b[11]; + const b12 = b[12]; + const b13 = b[13]; + const b14 = b[14]; + const b15 = b[15]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15)); + } + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a) { + return `Mat4(${a.join(", ")})`; + } +}; +Mat4.prototype.mul = Mat4.prototype.multiply; +Mat4.sub = Mat4.subtract; +Mat4.mul = Mat4.multiply; +Mat4.frustum = Mat4.frustumNO; +Mat4.perspective = Mat4.perspectiveNO; +Mat4.ortho = Mat4.orthoNO; + +// src/_lib/f64/Vec3.ts +var Vec3 = class _Vec3 extends Float64Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 3: + super(values); + break; + case 2: + super(values[0], values[1], 3); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v]); + } else { + super(v, 0, 3); + } + break; + } + default: + super(3); + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec3.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + return this; + } + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + return this; + } + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + return this; + } + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + return this; + } + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec3.distance(this, b); + } + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec3.squaredDistance(this, b); + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + return this; + } + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; + } + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec3.normalize(this, this); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH() { + return 3 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create() { + return new _Vec3(); + } + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a) { + return new _Vec3(a); + } + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x, y, z) { + return new _Vec3(x, y, z); + } + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; + } + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; + } + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; + } + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return [0, 0, 0]; + } + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; + } + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return [0, 0, 0]; + } + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; + } + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out, a, b) { + return [0, 0, 0]; + } + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; + } + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; + } + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; + } + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; + } + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /* + static round(out: Vec3Like, a: Readonly): Vec3Like { + out[0] = glMatrix.round(a[0]); + out[1] = glMatrix.round(a[1]); + out[2] = glMatrix.round(a[2]); + return out; + }*/ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + return out; + } + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return Math.sqrt(x * x + y * y + z * z); + } + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + return x * x + y * y + z * z; + } + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; + } + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + return out; + } + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + let len = x * x + y * y + z * z; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + return out; + } + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out, a, b) { + const ax = a[0], ay = a[1], az = a[2]; + const bx = b[0], by = b[1], bz = b[2]; + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; + } + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; + } + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1)); + const sinTotal = Math.sin(angle); + const ratioA = Math.sin((1 - t) * angle) / sinTotal; + const ratioB = Math.sin(t * angle) / sinTotal; + out[0] = ratioA * a[0] + ratioB * b[0]; + out[1] = ratioA * a[1] + ratioB * b[1]; + out[2] = ratioA * a[2] + ratioB * b[2]; + return out; + } + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite(out, a, b, c, d, t) { + const factorTimes2 = t * t; + const factor1 = factorTimes2 * (2 * t - 3) + 1; + const factor2 = factorTimes2 * (t - 2) + t; + const factor3 = factorTimes2 * (t - 1); + const factor4 = factorTimes2 * (3 - 2 * t); + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier(out, a, b, c, d, t) { + const inverseFactor = 1 - t; + const inverseFactorTimesTwo = inverseFactor * inverseFactor; + const factorTimes2 = t * t; + const factor1 = inverseFactorTimesTwo * inverseFactor; + const factor2 = 3 * t * inverseFactorTimesTwo; + const factor3 = 3 * factorTimes2 * inverseFactor; + const factor4 = factorTimes2 * t; + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /* + static random(out: Vec3Like, scale) { + scale = scale === undefined ? 1.0 : scale; + + let r = glMatrix.RANDOM() * 2.0 * Math.PI; + let z = glMatrix.RANDOM() * 2.0 - 1.0; + let zScale = Math.sqrt(1.0 - z * z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; + }*/ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; + } + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out, a, m) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; + } + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = a[0]; + const y = a[1]; + const z = a[2]; + const uvx = qy * z - qz * y; + const uvy = qz * x - qx * z; + const uvz = qx * y - qy * x; + const uuvx = (qy * uvz - qz * uvy) * 2; + const uuvy = (qz * uvx - qx * uvz) * 2; + const uuvz = (qx * uvy - qy * uvx) * 2; + out[0] = x + uvx * w2 + uuvx; + out[1] = y + uvy * w2 + uuvy; + out[2] = z + uvz * w2 + uuvz; + return out; + } + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out, a, b, rad) { + const by = b[1]; + const bz = b[2]; + const py = a[1] - by; + const pz = a[2] - bz; + out[0] = a[0]; + out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by; + out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out, a, b, rad) { + const bx = b[0]; + const bz = b[2]; + const px = a[0] - bx; + const pz = a[2] - bz; + out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx; + out[1] = a[1]; + out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz; + return out; + } + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out, a, b, rad) { + const bx = b[0]; + const by = b[1]; + const px = a[0] - bx; + const py = a[1] - by; + out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx; + out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by; + out[2] = b[2]; + return out; + } + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)); + const cosine = mag && _Vec3.dot(a, b) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec3(${a.join(", ")})`; + } + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)); + } +}; +Vec3.prototype.sub = Vec3.prototype.subtract; +Vec3.prototype.mul = Vec3.prototype.multiply; +Vec3.prototype.div = Vec3.prototype.divide; +Vec3.prototype.dist = Vec3.prototype.distance; +Vec3.prototype.sqrDist = Vec3.prototype.squaredDistance; +Vec3.sub = Vec3.subtract; +Vec3.mul = Vec3.multiply; +Vec3.div = Vec3.divide; +Vec3.dist = Vec3.distance; +Vec3.sqrDist = Vec3.squaredDistance; +Vec3.sqrLen = Vec3.squaredLength; +Vec3.mag = Vec3.magnitude; +Vec3.length = Vec3.magnitude; +Vec3.len = Vec3.magnitude; + +// src/_lib/f64/Vec4.ts +var Vec4 = class _Vec4 extends Float64Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b() { + return this[2]; + } + set b(value) { + this[2] = value; + } + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a() { + return this[3]; + } + set a(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec4.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + this[2] += b[2]; + this[3] += b[3]; + return this; + } + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + this[2] -= b[2]; + this[3] -= b[3]; + return this; + } + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + this[2] *= b[2]; + this[3] *= b[3]; + return this; + } + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + this[2] /= b[2]; + this[3] /= b[3]; + return this; + } + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + this[2] *= b; + this[3] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + this[2] += b[2] * scale; + this[3] += b[3] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec4.distance(this, b); + } + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec4.squaredDistance(this, b); + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + this[2] *= -1; + this[3] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + this[2] = 1 / this[2]; + this[3] = 1 / this[3]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + this[2] = Math.abs(this[2]); + this[3] = Math.abs(this[3]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; + } + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec4.normalize(this, this); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create() { + return new _Vec4(); + } + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a) { + return new _Vec4(a); + } + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x, y, z, w) { + return new _Vec4(x, y, z, w); + } + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; + } + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; + } + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return out; + } + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; + } + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; + } + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out, a, b) { + return out; + } + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; + } + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; + } + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; + } + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; + } + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; + } + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + out[2] = a[2] + b[2] * scale; + out[3] = a[3] + b[3] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return Math.hypot(x, y, z, w); + } + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + const z = b[2] - a[2]; + const w = b[3] - a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + return x * x + y * y + z * z + w * w; + } + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + out[2] = 1 / a[2]; + out[3] = 1 / a[3]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + out[2] = Math.abs(a[2]); + out[3] = Math.abs(a[3]); + return out; + } + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + let len = x * x + y * y + z * z + w * w; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out, u, v, w) { + const a = v[0] * w[1] - v[1] * w[0]; + const b = v[0] * w[2] - v[2] * w[0]; + const c = v[0] * w[3] - v[3] * w[0]; + const d = v[1] * w[2] - v[2] * w[1]; + const e = v[1] * w[3] - v[3] * w[1]; + const f = v[2] * w[3] - v[3] * w[2]; + const g = u[0]; + const h = u[1]; + const i = u[2]; + const j = u[3]; + out[0] = h * f - i * e + j * d; + out[1] = -(g * f) + i * c - j * b; + out[2] = g * e - h * c + j * a; + out[3] = -(g * d) + h * b - i * a; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; + } + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /* + static random(out: Vec4Like, scale): Vec4Like { + scale = scale || 1.0; + + // Marsaglia, George. Choosing a Point from the Surface of a + // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. + // http://projecteuclid.org/euclid.aoms/1177692644; + var v1, v2, v3, v4; + var s1, s2; + do { + v1 = glMatrix.RANDOM() * 2 - 1; + v2 = glMatrix.RANDOM() * 2 - 1; + s1 = v1 * v1 + v2 * v2; + } while (s1 >= 1); + do { + v3 = glMatrix.RANDOM() * 2 - 1; + v4 = glMatrix.RANDOM() * 2 - 1; + s2 = v3 * v3 + v4 * v4; + } while (s2 >= 1); + + var d = Math.sqrt((1 - s1) / s2); + out[0] = scale * v1; + out[1] = scale * v2; + out[2] = scale * v3 * d; + out[3] = scale * v4 * d; + return out; + }*/ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; + } + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out, a, q) { + const x = a[0]; + const y = a[1]; + const z = a[2]; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const ix = qw * x + qy * z - qz * y; + const iy = qw * y + qz * x - qx * z; + const iz = qw * z + qx * y - qy * x; + const iw = -qx * x - qy * y - qz * z; + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; + } + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Vec4(${a.join(", ")})`; + } + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)); + } +}; +Vec4.prototype.sub = Vec4.prototype.subtract; +Vec4.prototype.mul = Vec4.prototype.multiply; +Vec4.prototype.div = Vec4.prototype.divide; +Vec4.prototype.dist = Vec4.prototype.distance; +Vec4.prototype.sqrDist = Vec4.prototype.squaredDistance; +Vec4.sub = Vec4.subtract; +Vec4.mul = Vec4.multiply; +Vec4.div = Vec4.divide; +Vec4.dist = Vec4.distance; +Vec4.sqrDist = Vec4.squaredDistance; +Vec4.sqrLen = Vec4.squaredLength; +Vec4.mag = Vec4.magnitude; +Vec4.length = Vec4.magnitude; +Vec4.len = Vec4.magnitude; + +// src/_lib/f64/Quat.ts +var Quat = class _Quat extends Float64Array { + static #DEFAULT_ANGLE_ORDER = "zyx"; + // Temporary variables to prevent repeated allocations in the algorithms within Quat. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT1 = new Float64Array(4); + static #TMP_QUAT2 = new Float64Array(4); + static #TMP_MAT3 = new Float64Array(9); + static #TMP_VEC3 = new Float64Array(3); + static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]); + static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]); + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 4: + super(values); + break; + case 2: + super(values[0], values[1], 4); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v]); + } else { + super(v, 0, 4); + } + break; + } + default: + super(4); + this[3] = 1; + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z() { + return this[2]; + } + set z(value) { + this[2] = value; + } + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w() { + return this[3]; + } + set w(value) { + this[3] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + const x = this[0]; + const y = this[1]; + const z = this[2]; + const w = this[3]; + return Math.sqrt(x * x + y * y + z * z + w * w); + } + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity() { + this[0] = 0; + this[1] = 0; + this[2] = 0; + this[3] = 1; + return this; + } + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + return _Quat.multiply(this, this, b); + } + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad) { + return _Quat.rotateX(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad) { + return _Quat.rotateY(this, this, rad); + } + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad) { + return _Quat.rotateZ(this, this, rad); + } + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + return _Quat.invert(this, this); + } + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale) { + this[0] *= scale; + this[1] *= scale; + this[2] *= scale; + this[3] *= scale; + return this; + } + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b) { + return _Quat.dot(this, b); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH() { + return 4 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create() { + return new _Quat(); + } + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out, axis, rad) { + rad *= 0.5; + const s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; + } + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as provided in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis, q) { + const rad = Math.acos(q[3]) * 2; + const s = Math.sin(rad / 2); + if (s > GLM_EPSILON) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; + } + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a, b) { + const dotproduct = _Quat.dot(a, b); + return Math.acos(2 * dotproduct * dotproduct - 1); + } + /** + * Multiplies two quaternions. + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out, a, b) { + 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]; + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; + } + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const by = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; + } + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + rad *= 0.5; + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bz = Math.sin(rad); + const bw = Math.cos(rad); + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; + } + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out, a) { + const x = a[0], y = a[1], z = a[2]; + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z)); + return out; + } + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const et = Math.exp(w); + const s = r > 0 ? et * Math.sin(r) / r : 0; + out[0] = x * s; + out[1] = y * s; + out[2] = z * s; + out[3] = et * Math.cos(r); + return out; + } + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out, a) { + const x = a[0], y = a[1], z = a[2], w = a[3]; + const r = Math.sqrt(x * x + y * y + z * z); + const t = r > 0 ? Math.atan2(r, w) / r : 0; + out[0] = x * t; + out[1] = y * t; + out[2] = z * t; + out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); + return out; + } + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out, a, b) { + _Quat.ln(out, a); + _Quat.scale(out, out, b); + _Quat.exp(out, out); + return out; + } + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out, a, b, t) { + const ax = a[0], ay = a[1], az = a[2], aw = a[3]; + let bx = b[0], by = b[1], bz = b[2], bw = b[3]; + let scale0; + let scale1; + let cosom = ax * bx + ay * by + az * bz + aw * bw; + if (cosom < 0) { + cosom = -cosom; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + if (1 - cosom > GLM_EPSILON) { + const omega = Math.acos(cosom); + const sinom = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + scale0 = 1 - t; + scale1 = t; + } + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + return out; + } + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /* static random(out: QuatLike): QuatLike { + // Implementation of http://planning.cs.uiuc.edu/node198.html + // TODO: Calling random 3 times is probably not the fastest solution + let u1 = glMatrix.RANDOM(); + let u2 = glMatrix.RANDOM(); + let u3 = glMatrix.RANDOM(); + + let sqrt1MinusU1 = Math.sqrt(1 - u1); + let sqrtU1 = Math.sqrt(u1); + + out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); + out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); + out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); + out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); + return out; + }*/ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + out[0] = -a0 * invDot; + out[1] = -a1 * invDot; + out[2] = -a2 * invDot; + out[3] = a3 * invDot; + return out; + } + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; + } + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to re-normalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out, m) { + const fTrace = m[0] + m[4] + m[8]; + let fRoot; + if (fTrace > 0) { + fRoot = Math.sqrt(fTrace + 1); + out[3] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[0] = (m[5] - m[7]) * fRoot; + out[1] = (m[6] - m[2]) * fRoot; + out[2] = (m[1] - m[3]) * fRoot; + } else { + let i = 0; + if (m[4] > m[0]) { + i = 1; + } + if (m[8] > m[i * 3 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; + out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + } + return out; + } + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out, x, y, z, order = _Quat.#DEFAULT_ANGLE_ORDER) { + const halfToRad = 0.5 * Math.PI / 180; + x *= halfToRad; + y *= halfToRad; + z *= halfToRad; + const sx = Math.sin(x); + const cx = Math.cos(x); + const sy = Math.sin(y); + const cy = Math.cos(y); + const sz = Math.sin(z); + const cz = Math.cos(z); + switch (order) { + case "xyz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "xzy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yxz": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz - sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + case "yzx": + out[0] = sx * cy * cz + cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zxy": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz + sx * sy * cz; + out[3] = cx * cy * cz - sx * sy * sz; + break; + case "zyx": + out[0] = sx * cy * cz - cx * sy * sz; + out[1] = cx * sy * cz + sx * cy * sz; + out[2] = cx * cy * sz - sx * sy * cz; + out[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error(`Unknown angle order ${order}`); + } + return out; + } + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat(${a.join(", ")})`; + } + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a) { + return new _Quat(a); + } + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x, y, z, w) { + return new _Quat(x, y, z, w); + } + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static set(out, x, y, z, w) { + return out; + } + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static add(out, a, b) { + return out; + } + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out, a, scale) { + out[0] = a[0] * scale; + out[1] = a[1] * scale; + out[2] = a[2] * scale; + out[3] = a[3] * scale; + return out; + } + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static lerp(out, a, b, t) { + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mag(a) { + return 0; + } + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static normalize(out, a) { + return out; + } + /** + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static exactEquals(a, b) { + return false; + } + /** + * Returns whether the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static equals(a, b) { + return false; + } + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out, a, b) { + const dot = Vec3.dot(a, b); + if (dot < -0.999999) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#X_UNIT_VEC3, a); + if (Vec3.mag(_Quat.#TMP_VEC3) < 1e-6) { + Vec3.cross(_Quat.#TMP_VEC3, _Quat.#Y_UNIT_VEC3, a); + } + Vec3.normalize(_Quat.#TMP_VEC3, _Quat.#TMP_VEC3); + _Quat.setAxisAngle(out, _Quat.#TMP_VEC3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + Vec3.cross(_Quat.#TMP_VEC3, a, b); + out[0] = _Quat.#TMP_VEC3[0]; + out[1] = _Quat.#TMP_VEC3[1]; + out[2] = _Quat.#TMP_VEC3[2]; + out[3] = 1 + dot; + return _Quat.normalize(out, out); + } + } + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp(out, a, b, c, d, t) { + _Quat.slerp(_Quat.#TMP_QUAT1, a, d, t); + _Quat.slerp(_Quat.#TMP_QUAT2, b, c, t); + _Quat.slerp(out, _Quat.#TMP_QUAT1, _Quat.#TMP_QUAT2, 2 * t * (1 - t)); + return out; + } + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out, view, right, up) { + _Quat.#TMP_MAT3[0] = right[0]; + _Quat.#TMP_MAT3[3] = right[1]; + _Quat.#TMP_MAT3[6] = right[2]; + _Quat.#TMP_MAT3[1] = up[0]; + _Quat.#TMP_MAT3[4] = up[1]; + _Quat.#TMP_MAT3[7] = up[2]; + _Quat.#TMP_MAT3[2] = -view[0]; + _Quat.#TMP_MAT3[5] = -view[1]; + _Quat.#TMP_MAT3[8] = -view[2]; + return _Quat.normalize(out, _Quat.fromMat3(out, _Quat.#TMP_MAT3)); + } +}; +Quat.set = Vec4.set; +Quat.add = Vec4.add; +Quat.lerp = Vec4.lerp; +Quat.normalize = Vec4.normalize; +Quat.squaredLength = Vec4.squaredLength; +Quat.sqrLen = Vec4.squaredLength; +Quat.exactEquals = Vec4.exactEquals; +Quat.equals = Vec4.equals; +Quat.magnitude = Vec4.magnitude; +Quat.prototype.mul = Quat.prototype.multiply; +Quat.mul = Quat.multiply; +Quat.mag = Quat.magnitude; +Quat.length = Quat.magnitude; +Quat.len = Quat.magnitude; + +// src/_lib/f64/Quat2.ts +var Quat2 = class _Quat2 extends Float64Array { + // Temporary variables to prevent repeated allocations in the algorithms within Quat2. + // These are declared as TypedArrays to aid in tree-shaking. + static #TMP_QUAT = new Float64Array(4); + static #TMP_VEC3 = new Float64Array(3); + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 8: + super(values); + break; + case 2: + super(values[0], values[1], 8); + break; + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v, v, v, v, v, v, v]); + } else { + super(v, 0, 8); + } + break; + } + default: + super(8); + this[3] = 1; + break; + } + } + // ============ + // Accessors + // ============ + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str() { + return _Quat2.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a) { + super.set(a); + return this; + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH() { + return 8 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create() { + return new _Quat2(); + } + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a) { + return new _Quat2(a); + } + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) { + return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2); + } + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) { + const ax = x2 * 0.5; + const ay = y2 * 0.5; + const az = z2 * 0.5; + return new _Quat2( + x1, + y1, + z1, + w1, + ax * w1 + ay * z1 - az * y1, + ay * w1 + az * x1 - ax * z1, + az * w1 + ax * y1 - ay * x1, + -ax * x1 - ay * y1 - az * z1 + ); + } + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out, q, t) { + const ax = t[0] * 0.5; + const ay = t[1] * 0.5; + const az = t[2] * 0.5; + const bx = q[0]; + const by = q[1]; + const bz = q[2]; + const bw = q[3]; + out[0] = bx; + out[1] = by; + out[2] = bz; + out[3] = bw; + out[4] = ax * bw + ay * bz - az * by; + out[5] = ay * bw + az * bx - ax * bz; + out[6] = az * bw + ax * by - ay * bx; + out[7] = -ax * bx - ay * by - az * bz; + return out; + } + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out, t) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = t[0] * 0.5; + out[5] = t[1] * 0.5; + out[6] = t[2] * 0.5; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out, q) { + out[0] = q[0]; + out[1] = q[1]; + out[2] = q[2]; + out[3] = q[3]; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out, a) { + Mat4.getRotation(_Quat2.#TMP_QUAT, a); + Mat4.getTranslation(_Quat2.#TMP_VEC3, a); + return _Quat2.fromRotationTranslation(out, _Quat2.#TMP_QUAT, _Quat2.#TMP_VEC3); + } + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + return out; + } + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + return out; + } + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set(out, x1, y1, z1, w1, x2, y2, z2, w2) { + out[0] = x1; + out[1] = y1; + out[2] = z1; + out[3] = w1; + out[4] = x2; + out[5] = y2; + out[6] = z2; + out[7] = w2; + return out; + } + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out, a) { + out[0] = a[4]; + out[1] = a[5]; + out[2] = a[6]; + out[3] = a[7]; + return out; + } + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; + } + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out, a) { + out[4] = a[0]; + out[5] = a[1]; + out[6] = a[2]; + out[7] = a[3]; + return out; + } + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out, a) { + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const bx = -a[0]; + const by = -a[1]; + const bz = -a[2]; + const bw = a[3]; + out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; + out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; + out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; + return out; + } + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out, a, v) { + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + const bx1 = v[0] * 0.5; + const by1 = v[1] * 0.5; + const bz1 = v[2] * 0.5; + const ax2 = a[4]; + const ay2 = a[5]; + const az2 = a[6]; + const aw2 = a[7]; + out[0] = ax1; + out[1] = ay1; + out[2] = az1; + out[3] = aw1; + out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2; + out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2; + out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2; + out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2; + return out; + } + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateX(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateY(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out, a, rad) { + let bx = -a[0]; + let by = -a[1]; + let bz = -a[2]; + let bw = a[3]; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + const ax1 = ax * bw + aw * bx + ay * bz - az * by; + const ay1 = ay * bw + aw * by + az * bx - ax * bz; + const az1 = az * bw + aw * bz + ax * by - ay * bx; + const aw1 = aw * bw - ax * bx - ay * by - az * bz; + Quat.rotateZ(out, a, rad); + bx = out[0]; + by = out[1]; + bz = out[2]; + bw = out[3]; + out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out, a, q) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let ax = a[0]; + let ay = a[1]; + let az = a[2]; + let aw = a[3]; + out[0] = ax * qw + aw * qx + ay * qz - az * qy; + out[1] = ay * qw + aw * qy + az * qx - ax * qz; + out[2] = az * qw + aw * qz + ax * qy - ay * qx; + out[3] = aw * qw - ax * qx - ay * qy - az * qz; + ax = a[4]; + ay = a[5]; + az = a[6]; + aw = a[7]; + out[4] = ax * qw + aw * qx + ay * qz - az * qy; + out[5] = ay * qw + aw * qy + az * qx - ax * qz; + out[6] = az * qw + aw * qz + ax * qy - ay * qx; + out[7] = aw * qw - ax * qx - ay * qy - az * qz; + return out; + } + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out, q, a) { + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + let bx = a[0]; + let by = a[1]; + let bz = a[2]; + let bw = a[3]; + out[0] = qx * bw + qw * bx + qy * bz - qz * by; + out[1] = qy * bw + qw * by + qz * bx - qx * bz; + out[2] = qz * bw + qw * bz + qx * by - qy * bx; + out[3] = qw * bw - qx * bx - qy * by - qz * bz; + bx = a[4]; + by = a[5]; + bz = a[6]; + bw = a[7]; + out[4] = qx * bw + qw * bx + qy * bz - qz * by; + out[5] = qy * bw + qw * by + qz * bx - qx * bz; + out[6] = qz * bw + qw * bz + qx * by - qy * bx; + out[7] = qw * bw - qx * bx - qy * by - qz * bz; + return out; + } + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out, a, axis, rad) { + if (Math.abs(rad) < GLM_EPSILON) { + return _Quat2.copy(out, a); + } + const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + rad *= 0.5; + const s = Math.sin(rad); + const bx = s * axis[0] / axisLength; + const by = s * axis[1] / axisLength; + const bz = s * axis[2] / axisLength; + const bw = Math.cos(rad); + const ax1 = a[0]; + const ay1 = a[1]; + const az1 = a[2]; + const aw1 = a[3]; + out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by; + out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz; + out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx; + out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz; + const ax = a[4]; + const ay = a[5]; + const az = a[6]; + const aw = a[7]; + out[4] = ax * bw + aw * bx + ay * bz - az * by; + out[5] = ay * bw + aw * by + az * bx - ax * bz; + out[6] = az * bw + aw * bz + ax * by - ay * bx; + out[7] = aw * bw - ax * bx - ay * by - az * bz; + return out; + } + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + return out; + } + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out, a, b) { + const ax0 = a[0]; + const ay0 = a[1]; + const az0 = a[2]; + const aw0 = a[3]; + const bx1 = b[4]; + const by1 = b[5]; + const bz1 = b[6]; + const bw1 = b[7]; + const ax1 = a[4]; + const ay1 = a[5]; + const az1 = a[6]; + const aw1 = a[7]; + const bx0 = b[0]; + const by0 = b[1]; + const bz0 = b[2]; + const bw0 = b[3]; + out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0; + out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0; + out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0; + out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0; + out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0; + out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0; + out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0; + out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0; + return out; + } + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return out; + } + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + return out; + } + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dot(a, b) { + return 0; + } + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const mt = 1 - t; + if (_Quat2.dot(a, b) < 0) { + t = -t; + } + out[0] = a[0] * mt + b[0] * t; + out[1] = a[1] * mt + b[1] * t; + out[2] = a[2] * mt + b[2] * t; + out[3] = a[3] * mt + b[3] * t; + out[4] = a[4] * mt + b[4] * t; + out[5] = a[5] * mt + b[5] * t; + out[6] = a[6] * mt + b[6] * t; + out[7] = a[7] * mt + b[7] * t; + return out; + } + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out, a) { + const sqlen = _Quat2.squaredLength(a); + out[0] = -a[0] / sqlen; + out[1] = -a[1] / sqlen; + out[2] = -a[2] / sqlen; + out[3] = a[3] / sqlen; + out[4] = -a[4] / sqlen; + out[5] = -a[5] / sqlen; + out[6] = -a[6] / sqlen; + out[7] = a[7] / sqlen; + return out; + } + /** + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + out[4] = -a[4]; + out[5] = -a[5]; + out[6] = -a[6]; + out[7] = a[7]; + return out; + } + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static magnitude(a) { + return 0; + } + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static squaredLength(a) { + return 0; + } + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out, a) { + let magnitude = _Quat2.squaredLength(a); + if (magnitude > 0) { + magnitude = Math.sqrt(magnitude); + const a0 = a[0] / magnitude; + const a1 = a[1] / magnitude; + const a2 = a[2] / magnitude; + const a3 = a[3] / magnitude; + const b0 = a[4]; + const b1 = a[5]; + const b2 = a[6]; + const b3 = a[7]; + const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = (b0 - a0 * a_dot_b) / magnitude; + out[5] = (b1 - a1 * a_dot_b) / magnitude; + out[6] = (b2 - a2 * a_dot_b) / magnitude; + out[7] = (b3 - a3 * a_dot_b) / magnitude; + } + return out; + } + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a) { + return `Quat2(${a.join(", ")})`; + } + /** + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(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]; + } + /** + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const a2 = a[2]; + const a3 = a[3]; + const a4 = a[4]; + const a5 = a[5]; + const a6 = a[6]; + const a7 = a[7]; + const b0 = b[0]; + const b1 = b[1]; + const b2 = b[2]; + const b3 = b[3]; + const b4 = b[4]; + const b5 = b[5]; + const b6 = b[6]; + const b7 = b[7]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)); + } +}; +Quat2.dot = Quat.dot; +Quat2.squaredLength = Quat.squaredLength; +Quat2.sqrLen = Quat.squaredLength; +Quat2.mag = Quat.magnitude; +Quat2.length = Quat.magnitude; +Quat2.len = Quat.magnitude; +Quat2.mul = Quat2.multiply; + +// src/_lib/f64/Vec2.ts +var Vec2 = class _Vec2 extends Float64Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values) { + switch (values.length) { + case 2: { + const v = values[0]; + if (typeof v === "number") { + super([v, values[1]]); + } else { + super(v, values[1], 2); + } + break; + } + case 1: { + const v = values[0]; + if (typeof v === "number") { + super([v, v]); + } else { + super(v, 0, 2); + } + break; + } + default: + super(2); + break; + } + } + // ============ + // Accessors + // ============ + // Getters and setters to make component access read better. + // These are likely to be a little bit slower than direct array access. + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x() { + return this[0]; + } + set x(value) { + this[0] = value; + } + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y() { + return this[1]; + } + set y(value) { + this[1] = value; + } + // Alternate set of getters and setters in case this is being used to define + // a color. + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r() { + return this[0]; + } + set r(value) { + this[0] = value; + } + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g() { + return this[1]; + } + set g(value) { + this[1] = value; + } + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude() { + return Math.hypot(this[0], this[1]); + } + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag() { + return this.magnitude; + } + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude() { + const x = this[0]; + const y = this[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag() { + return this.squaredMagnitude; + } + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str() { + return _Vec2.str(this); + } + // =================== + // Instances methods + // =================== + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a) { + this.set(a); + return this; + } + // Instead of zero(), use a.fill(0) for instances; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b) { + this[0] += b[0]; + this[1] += b[1]; + return this; + } + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b) { + this[0] -= b[0]; + this[1] -= b[1]; + return this; + } + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b) { + this[0] *= b[0]; + this[1] *= b[1]; + return this; + } + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b) { + this[0] /= b[0]; + this[1] /= b[1]; + return this; + } + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b) { + return this; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b) { + this[0] *= b; + this[1] *= b; + return this; + } + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b, scale) { + this[0] += b[0] * scale; + this[1] += b[1] * scale; + return this; + } + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b) { + return _Vec2.distance(this, b); + } + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b) { + return _Vec2.squaredDistance(this, b); + } + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate() { + this[0] *= -1; + this[1] *= -1; + return this; + } + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert() { + this[0] = 1 / this[0]; + this[1] = 1 / this[1]; + return this; + } + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs() { + this[0] = Math.abs(this[0]); + this[1] = Math.abs(this[1]); + return this; + } + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b) { + return this[0] * b[0] + this[1] * b[1]; + } + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize() { + return _Vec2.normalize(this, this); + } + // =================== + // Static accessors + // =================== + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH() { + return 2 * Float64Array.BYTES_PER_ELEMENT; + } + // =================== + // Static methods + // =================== + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create() { + return new _Vec2(); + } + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a) { + return new _Vec2(a); + } + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x, y) { + return new _Vec2(x, y); + } + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + } + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + } + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + } + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sub(out, a, b) { + return [0, 0]; + } + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; + } + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static mul(out, a, b) { + return [0, 0]; + } + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; + } + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static div(out, a, b) { + return [0, 0]; + } + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; + } + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; + } + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; + } + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; + } + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; + } + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + } + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + } + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a, b) { + return Math.hypot(b[0] - a[0], b[1] - a[1]); + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static dist(a, b) { + return 0; + } + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a, b) { + const x = b[0] - a[0]; + const y = b[1] - a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrDist(a, b) { + return 0; + } + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a) { + const x = a[0]; + const y = a[1]; + return Math.sqrt(x * x + y * y); + } + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + // Length conflicts with Function.length + static length(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a) { + return 0; + } + // eslint-disable-line @typescript-eslint/no-unused-vars + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a) { + const x = a[0]; + const y = a[1]; + return x * x + y * y; + } + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + static sqrLen(a, b) { + return 0; + } + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + } + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out, a) { + out[0] = 1 / a[0]; + out[1] = 1 / a[1]; + return out; + } + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out, a) { + out[0] = Math.abs(a[0]); + out[1] = Math.abs(a[1]); + return out; + } + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out, a) { + const x = a[0]; + const y = a[1]; + let len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + } + out[0] = a[0] * len; + out[1] = a[1] * len; + return out; + } + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out, a, b) { + const z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; + } + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out, a, b, t) { + const ax = a[0]; + const ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; + } + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out, a, m) { + const x = a[0]; + const y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; + } + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out, a, b, rad) { + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + out[0] = p0 * cosC - p1 * sinC + b[0]; + out[1] = p0 * sinC + p1 * cosC + b[1]; + return out; + } + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a, b) { + const x1 = a[0]; + const y1 = a[1]; + const x2 = b[0]; + const y2 = b[1]; + const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2); + const cosine = mag && (x1 * x2 + y1 * y2) / mag; + return Math.acos(Math.min(Math.max(cosine, -1), 1)); + } + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out) { + out[0] = 0; + out[1] = 0; + return out; + } + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a, b) { + const a0 = a[0]; + const a1 = a[1]; + const b0 = b[0]; + const b1 = b[1]; + return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)); + } + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a) { + return `Vec2(${a.join(", ")})`; + } +}; +Vec2.prototype.sub = Vec2.prototype.subtract; +Vec2.prototype.mul = Vec2.prototype.multiply; +Vec2.prototype.div = Vec2.prototype.divide; +Vec2.prototype.dist = Vec2.prototype.distance; +Vec2.prototype.sqrDist = Vec2.prototype.squaredDistance; +Vec2.sub = Vec2.subtract; +Vec2.mul = Vec2.multiply; +Vec2.div = Vec2.divide; +Vec2.dist = Vec2.distance; +Vec2.sqrDist = Vec2.squaredDistance; +Vec2.sqrLen = Vec2.squaredLength; +Vec2.mag = Vec2.magnitude; +Vec2.length = Vec2.magnitude; +Vec2.len = Vec2.magnitude; + +// src/swizzle/f64/index.ts +var GLM_SWIZZLES_ENABLED_F64 = false; +function EnableSwizzlesF64() { + if (GLM_SWIZZLES_ENABLED_F64) { + return; + } + const VEC2_SWIZZLES = ["xx", "xy", "yx", "yy", "xxx", "xxy", "xyx", "xyy", "yxx", "yxy", "yyx", "yyy", "xxxx", "xxxy", "xxyx", "xxyy", "xyxx", "xyxy", "xyyx", "xyyy", "yxxx", "yxxy", "yxyx", "yxyy", "yyxx", "yyxy", "yyyx", "yyyy", "rr", "rg", "gr", "gg", "rrr", "rrg", "rgr", "rgg", "grr", "grg", "ggr", "ggg", "rrrr", "rrrg", "rrgr", "rrgg", "rgrr", "rgrg", "rggr", "rggg", "grrr", "grrg", "grgr", "grgg", "ggrr", "ggrg", "gggr", "gggg"]; + const VEC3_SWIZZLES = ["xz", "yz", "zx", "zy", "zz", "xxz", "xyz", "xzx", "xzy", "xzz", "yxz", "yyz", "yzx", "yzy", "yzz", "zxx", "zxy", "zxz", "zyx", "zyy", "zyz", "zzx", "zzy", "zzz", "xxxz", "xxyz", "xxzx", "xxzy", "xxzz", "xyxz", "xyyz", "xyzx", "xyzy", "xyzz", "xzxx", "xzxy", "xzxz", "xzyx", "xzyy", "xzyz", "xzzx", "xzzy", "xzzz", "yxxz", "yxyz", "yxzx", "yxzy", "yxzz", "yyxz", "yyyz", "yyzx", "yyzy", "yyzz", "yzxx", "yzxy", "yzxz", "yzyx", "yzyy", "yzyz", "yzzx", "yzzy", "yzzz", "zxxx", "zxxy", "zxxz", "zxyx", "zxyy", "zxyz", "zxzx", "zxzy", "zxzz", "zyxx", "zyxy", "zyxz", "zyyx", "zyyy", "zyyz", "zyzx", "zyzy", "zyzz", "zzxx", "zzxy", "zzxz", "zzyx", "zzyy", "zzyz", "zzzx", "zzzy", "zzzz", "rb", "gb", "br", "bg", "bb", "rrb", "rgb", "rbr", "rbg", "rbb", "grb", "ggb", "gbr", "gbg", "gbb", "brr", "brg", "brb", "bgr", "bgg", "bgb", "bbr", "bbg", "bbb", "rrrb", "rrgb", "rrbr", "rrbg", "rrbb", "rgrb", "rggb", "rgbr", "rgbg", "rgbb", "rbrr", "rbrg", "rbrb", "rbgr", "rbgg", "rbgb", "rbbr", "rbbg", "rbbb", "grrb", "grgb", "grbr", "grbg", "grbb", "ggrb", "gggb", "ggbr", "ggbg", "ggbb", "gbrr", "gbrg", "gbrb", "gbgr", "gbgg", "gbgb", "gbbr", "gbbg", "gbbb", "brrr", "brrg", "brrb", "brgr", "brgg", "brgb", "brbr", "brbg", "brbb", "bgrr", "bgrg", "bgrb", "bggr", "bggg", "bggb", "bgbr", "bgbg", "bgbb", "bbrr", "bbrg", "bbrb", "bbgr", "bbgg", "bbgb", "bbbr", "bbbg", "bbbb"]; + const VEC4_SWIZZLES = ["xw", "yw", "zw", "wx", "wy", "wz", "ww", "xxw", "xyw", "xzw", "xwx", "xwy", "xwz", "xww", "yxw", "yyw", "yzw", "ywx", "ywy", "ywz", "yww", "zxw", "zyw", "zzw", "zwx", "zwy", "zwz", "zww", "wxx", "wxy", "wxz", "wxw", "wyx", "wyy", "wyz", "wyw", "wzx", "wzy", "wzz", "wzw", "wwx", "wwy", "wwz", "www", "xxxw", "xxyw", "xxzw", "xxwx", "xxwy", "xxwz", "xxww", "xyxw", "xyyw", "xyzw", "xywx", "xywy", "xywz", "xyww", "xzxw", "xzyw", "xzzw", "xzwx", "xzwy", "xzwz", "xzww", "xwxx", "xwxy", "xwxz", "xwxw", "xwyx", "xwyy", "xwyz", "xwyw", "xwzx", "xwzy", "xwzz", "xwzw", "xwwx", "xwwy", "xwwz", "xwww", "yxxw", "yxyw", "yxzw", "yxwx", "yxwy", "yxwz", "yxww", "yyxw", "yyyw", "yyzw", "yywx", "yywy", "yywz", "yyww", "yzxw", "yzyw", "yzzw", "yzwx", "yzwy", "yzwz", "yzww", "ywxx", "ywxy", "ywxz", "ywxw", "ywyx", "ywyy", "ywyz", "ywyw", "ywzx", "ywzy", "ywzz", "ywzw", "ywwx", "ywwy", "ywwz", "ywww", "zxxw", "zxyw", "zxzw", "zxwx", "zxwy", "zxwz", "zxww", "zyxw", "zyyw", "zyzw", "zywx", "zywy", "zywz", "zyww", "zzxw", "zzyw", "zzzw", "zzwx", "zzwy", "zzwz", "zzww", "zwxx", "zwxy", "zwxz", "zwxw", "zwyx", "zwyy", "zwyz", "zwyw", "zwzx", "zwzy", "zwzz", "zwzw", "zwwx", "zwwy", "zwwz", "zwww", "wxxx", "wxxy", "wxxz", "wxxw", "wxyx", "wxyy", "wxyz", "wxyw", "wxzx", "wxzy", "wxzz", "wxzw", "wxwx", "wxwy", "wxwz", "wxww", "wyxx", "wyxy", "wyxz", "wyxw", "wyyx", "wyyy", "wyyz", "wyyw", "wyzx", "wyzy", "wyzz", "wyzw", "wywx", "wywy", "wywz", "wyww", "wzxx", "wzxy", "wzxz", "wzxw", "wzyx", "wzyy", "wzyz", "wzyw", "wzzx", "wzzy", "wzzz", "wzzw", "wzwx", "wzwy", "wzwz", "wzww", "wwxx", "wwxy", "wwxz", "wwxw", "wwyx", "wwyy", "wwyz", "wwyw", "wwzx", "wwzy", "wwzz", "wwzw", "wwwx", "wwwy", "wwwz", "wwww", "ra", "ga", "ba", "ar", "ag", "ab", "aa", "rra", "rga", "rba", "rar", "rag", "rab", "raa", "gra", "gga", "gba", "gar", "gag", "gab", "gaa", "bra", "bga", "bba", "bar", "bag", "bab", "baa", "arr", "arg", "arb", "ara", "agr", "agg", "agb", "aga", "abr", "abg", "abb", "aba", "aar", "aag", "aab", "aaa", "rrra", "rrga", "rrba", "rrar", "rrag", "rrab", "rraa", "rgra", "rgga", "rgba", "rgar", "rgag", "rgab", "rgaa", "rbra", "rbga", "rbba", "rbar", "rbag", "rbab", "rbaa", "rarr", "rarg", "rarb", "rara", "ragr", "ragg", "ragb", "raga", "rabr", "rabg", "rabb", "raba", "raar", "raag", "raab", "raaa", "grra", "grga", "grba", "grar", "grag", "grab", "graa", "ggra", "ggga", "ggba", "ggar", "ggag", "ggab", "ggaa", "gbra", "gbga", "gbba", "gbar", "gbag", "gbab", "gbaa", "garr", "garg", "garb", "gara", "gagr", "gagg", "gagb", "gaga", "gabr", "gabg", "gabb", "gaba", "gaar", "gaag", "gaab", "gaaa", "brra", "brga", "brba", "brar", "brag", "brab", "braa", "bgra", "bgga", "bgba", "bgar", "bgag", "bgab", "bgaa", "bbra", "bbga", "bbba", "bbar", "bbag", "bbab", "bbaa", "barr", "barg", "barb", "bara", "bagr", "bagg", "bagb", "baga", "babr", "babg", "babb", "baba", "baar", "baag", "baab", "baaa", "arrr", "arrg", "arrb", "arra", "argr", "argg", "argb", "arga", "arbr", "arbg", "arbb", "arba", "arar", "arag", "arab", "araa", "agrr", "agrg", "agrb", "agra", "aggr", "aggg", "aggb", "agga", "agbr", "agbg", "agbb", "agba", "agar", "agag", "agab", "agaa", "abrr", "abrg", "abrb", "abra", "abgr", "abgg", "abgb", "abga", "abbr", "abbg", "abbb", "abba", "abar", "abag", "abab", "abaa", "aarr", "aarg", "aarb", "aara", "aagr", "aagg", "aagb", "aaga", "aabr", "aabg", "aabb", "aaba", "aaar", "aaag", "aaab", "aaaa"]; + const SWIZZLE_INDEX = { + x: 0, + r: 0, + y: 1, + g: 1, + z: 2, + b: 2, + w: 3, + a: 3 + }; + function getSwizzleImpl(swizzle) { + switch (swizzle.length) { + case 2: + return function() { + return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]); + }; + case 3: + return function() { + return new Vec3( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]] + ); + }; + case 4: + return function() { + return new Vec4( + this[SWIZZLE_INDEX[swizzle[0]]], + this[SWIZZLE_INDEX[swizzle[1]]], + this[SWIZZLE_INDEX[swizzle[2]]], + this[SWIZZLE_INDEX[swizzle[3]]] + ); + }; + } + throw new Error("Illegal swizzle length"); + } + for (const swizzle of VEC2_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec2.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC3_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec3.prototype, swizzle, { + get: impl + }); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + for (const swizzle of VEC4_SWIZZLES) { + const impl = getSwizzleImpl(swizzle); + Object.defineProperty(Vec4.prototype, swizzle, { + get: impl + }); + } + GLM_SWIZZLES_ENABLED_F64 = true; +} + +// src/util/angleConversion.ts +var GLM_DEG_TO_RAD = Math.PI / 180; +var GLM_RAD_TO_DEG = 180 / Math.PI; +function toDegree(value) { + return value * GLM_RAD_TO_DEG; +} +function toRadian(value) { + return value * GLM_DEG_TO_RAD; +} +//# sourceMappingURL=gl-matrix-f64.cjs.map diff --git a/dist-cdn/cjs/2022/gl-matrix-f64.cjs.map b/dist-cdn/cjs/2022/gl-matrix-f64.cjs.map new file mode 100644 index 00000000..de74a322 --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f64.cjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/cdn/f64/index.ts", "../../../src/common/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides an all-inclusive ESM distribution of `gl-matrix` (64-bit). All library classes extends `Float64Array`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/* v8 ignore next 5 */\r\nexport * from '#gl-matrix/f64';\r\nexport * from '#gl-matrix/swizzle/f64';\r\nexport * from '#gl-matrix/types';\r\nexport * from '#gl-matrix/types/swizzle/f64';\r\nexport * from '#gl-matrix/util';\r\n", "/**\r\n * Provides common resources and constants shared across `gl-matrix`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/**\r\n * A small constant used to determine the acceptable error margin in floating-point calculations.\r\n */\r\nexport const GLM_EPSILON = 0.000001;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float64Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float64Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float64Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,cAAc;;;ACFpB,IAAM,OAAN,MAAM,cAAa,aAAa;AAAA,EACrC,OAAO,gB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C;AAAA,QACpE;AAAA,IACJ;AAEA,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AACD,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAW,WAAW,eAAe;AACnC,UAAM,OAAO,eAAe,OAAO;AACnC,WAAO,eAAe,KAAK,WAAW,SAAS;AAAA,MAC7C,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,6BAA2B;AAC7B;;;ACzIA,IAAM,iBAAyB,KAAK,KAAK;AAKzC,IAAM,iBAAyB,MAAM,KAAK;AAQnC,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;AAQO,SAAS,SAAS,OAAuB;AAC9C,SAAO,QAAQ;AACjB;", + "names": [] +} diff --git a/dist-cdn/cjs/2022/gl-matrix-f64.min.cjs b/dist-cdn/cjs/2022/gl-matrix-f64.min.cjs new file mode 100644 index 00000000..ef65a711 --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f64.min.cjs @@ -0,0 +1,6 @@ +// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library. +// @author Brandon Jones +// @author Colin MacKenzie IV +// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md) +var $=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var u=(h,e)=>{for(var t in e)$(h,t,{get:e[t],enumerable:!0})},_=(h,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of K(e))!v.call(h,s)&&s!==t&&$(h,s,{get:()=>e[s],enumerable:!(n=J(e,s))||n.enumerable});return h};var ee=h=>_($({},"__esModule",{value:!0}),h);var ie={};u(ie,{EnableSwizzlesF64:()=>te,Mat2:()=>Z,Mat2d:()=>j,Mat3:()=>G,Mat4:()=>P,Quat:()=>N,Quat2:()=>O,Vec2:()=>B,Vec3:()=>q,Vec4:()=>E,toDegree:()=>re,toRadian:()=>ae});module.exports=ee(ie);var Z=class h extends Float64Array{static#t=new Float64Array([1,0,0,1]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}transpose(){return h.transpose(this,this)}invert(){return h.invert(this,this)}scale(e){return h.scale(this,this,e)}rotate(e){return h.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(", ")})`}};Z.prototype.mul=Z.prototype.multiply;Z.mul=Z.multiply;Z.sub=Z.subtract;var j=class h extends Float64Array{static#t=new Float64Array([1,0,0,1,0,0]);constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}translate(e){return h.translate(this,this,e)}rotate(e){return h.rotate(this,this,e)}scale(e){return h.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],b=n[3],M=n[4],d=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*b,e[3]=r*l+i*b,e[4]=s*M+a*d+c,e[5]=r*M+i*d+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],b=t[4],M=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-M)<=1e-6*Math.max(1,Math.abs(c),Math.abs(M))}static str(e){return`Mat2d(${e.join(", ")})`}};j.mul=j.multiply;j.sub=j.subtract;var G=class h extends Float64Array{static#t=new Float64Array([1,0,0,0,1,0,0,0,1]);constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}transpose(){return h.transpose(this,this)}invert(){return h.invert(this,this)}translate(e){return h.translate(this,this,e)}rotate(e){return h.rotate(this,this,e)}scale(e){return h.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,b=-k*a+c*y,M=L*a-i*y,d=n*l+s*b+r*M;return d?(d=1/d,e[0]=l*d,e[1]=(-k*s+r*L)*d,e[2]=(c*s-r*i)*d,e[3]=b*d,e[4]=(k*n-r*y)*d,e[5]=(-c*n+r*a)*d,e[6]=M*d,e[7]=(-L*n+s*y)*d,e[8]=(i*n-s*a)*d,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],M=n[1],d=n[2];return e[0]=b*s+M*i+d*L,e[1]=b*r+M*c+d*k,e[2]=b*a+M*y+d*l,b=n[3],M=n[4],d=n[5],e[3]=b*s+M*i+d*L,e[4]=b*r+M*c+d*k,e[5]=b*a+M*y+d*l,b=n[6],M=n[7],d=n[8],e[6]=b*s+M*i+d*L,e[7]=b*r+M*c+d*k,e[8]=b*a+M*y+d*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=n[0],M=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=b*s+M*i+L,e[7]=b*r+M*c+k,e[8]=b*a+M*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=Math.sin(n),M=Math.cos(n);return e[0]=M*s+b*i,e[1]=M*r+b*c,e[2]=M*a+b*y,e[3]=M*i-b*s,e[4]=M*c-b*r,e[5]=M*y-b*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,b=r*i,M=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[3]=k-x,e[6]=b+o,e[1]=k+x,e[4]=1-L-d,e[7]=M-m,e[2]=b-o,e[5]=M+m,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],M=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-b*d,f=k*x-M*d,I=l*o-b*m,S=l*x-M*m,F=b*x-M*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(y*f-i*F-L*D)*Q,e[2]=(i*S-c*f+L*A)*Q,e[3]=(r*S-s*F-a*I)*Q,e[4]=(n*F-r*f+a*D)*Q,e[5]=(s*f-n*S-a*A)*Q,e[6]=(m*T-o*V+x*w)*Q,e[7]=(o*g-d*T-x*R)*Q,e[8]=(d*V-m*g+x*z)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],b=t[1],M=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-d)<=1e-6*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-m)<=1e-6*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(c-o)<=1e-6*Math.max(1,Math.abs(c),Math.abs(o))&&Math.abs(y-x)<=1e-6*Math.max(1,Math.abs(y),Math.abs(x))&&Math.abs(L-z)<=1e-6*Math.max(1,Math.abs(L),Math.abs(z))&&Math.abs(k-R)<=1e-6*Math.max(1,Math.abs(k),Math.abs(R))}static str(e){return`Mat3(${e.join(", ")})`}};G.prototype.mul=G.prototype.multiply;G.mul=G.multiply;G.sub=G.subtract;var P=class h extends Float64Array{static#t=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(h.#t);break}}get str(){return h.str(this)}copy(e){return this.set(e),this}identity(){return this.set(h.#t),this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}transpose(){return h.transpose(this,this)}invert(){return h.invert(this,this)}translate(e){return h.translate(this,this,e)}rotate(e,t){return h.rotate(this,this,e,t)}scale(e){return h.scale(this,this,e)}rotateX(e){return h.rotateX(this,this,e)}rotateY(e){return h.rotateY(this,this,e)}rotateZ(e){return h.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return h.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return h.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return h.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return h.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new h(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],M=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-b*d,f=k*x-M*d,I=l*o-b*m,S=l*x-M*m,F=b*x-M*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(r*S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-k*z+l*x,f=M*R-d*z+m*x;return y*T-r*A+o*D-b*f}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],b=t[9],M=t[10],d=t[11],m=t[12],o=t[13],x=t[14],z=t[15],R=n[0],g=n[1],w=n[2],V=n[3];return e[0]=R*s+g*c+w*l+V*m,e[1]=R*r+g*y+w*b+V*o,e[2]=R*a+g*L+w*M+V*x,e[3]=R*i+g*k+w*d+V*z,R=n[4],g=n[5],w=n[6],V=n[7],e[4]=R*s+g*c+w*l+V*m,e[5]=R*r+g*y+w*b+V*o,e[6]=R*a+g*L+w*M+V*x,e[7]=R*i+g*k+w*d+V*z,R=n[8],g=n[9],w=n[10],V=n[11],e[8]=R*s+g*c+w*l+V*m,e[9]=R*r+g*y+w*b+V*o,e[10]=R*a+g*L+w*M+V*x,e[11]=R*i+g*k+w*d+V*z,R=n[12],g=n[13],w=n[14],V=n[15],e[12]=R*s+g*c+w*l+V*m,e[13]=R*r+g*y+w*b+V*o,e[14]=R*a+g*L+w*M+V*x,e[15]=R*i+g*k+w*d+V*z,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],b=t[6],M=t[7],d=t[8],m=t[9],o=t[10],x=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=b,e[7]=M,e[8]=d,e[9]=m,e[10]=o,e[11]=x,e[12]=i*s+k*r+d*a+t[12],e[13]=c*s+l*r+m*a+t[13],e[14]=y*s+b*r+o*a+t[14],e[15]=L*s+M*r+x*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],b=t[1],M=t[2],d=t[3],m=t[4],o=t[5],x=t[6],z=t[7],R=t[8],g=t[9],w=t[10],V=t[11],T=r*r*k+L,A=a*r*k+i*y,D=i*r*k-a*y,f=r*a*k-i*y,I=a*a*k+L,S=i*a*k+r*y,F=r*i*k+a*y,Q=a*i*k-r*y,Y=i*i*k+L;return e[0]=l*T+m*A+R*D,e[1]=b*T+o*A+g*D,e[2]=M*T+x*A+w*D,e[3]=d*T+z*A+V*D,e[4]=l*f+m*I+R*S,e[5]=b*f+o*I+g*S,e[6]=M*f+x*I+w*S,e[7]=d*f+z*I+V*S,e[8]=l*F+m*Q+R*Y,e[9]=b*F+o*Q+g*Y,e[10]=M*F+x*Q+w*Y,e[11]=d*F+z*Q+V*Y,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+b*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=b*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],b=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-b*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+b*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],b=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+b*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=b*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,b=s*L,M=r*y,d=r*L,m=a*L,o=i*c,x=i*y,z=i*L;return e[0]=1-(M+m),e[1]=l+z,e[2]=b-x,e[3]=0,e[4]=l-z,e[5]=1-(k+m),e[6]=d+o,e[7]=0,e[8]=b+x,e[9]=d-o,e[10]=1-(k+M),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(h.#e[0]=(i*a+L*n+c*r-y*s)*2/k,h.#e[1]=(c*a+L*s+y*n-i*r)*2/k,h.#e[2]=(y*a+L*r+i*s-c*n)*2/k):(h.#e[0]=(i*a+L*n+c*r-y*s)*2,h.#e[1]=(c*a+L*s+y*n-i*r)*2,h.#e[2]=(y*a+L*r+i*s-c*n)*2),h.fromRotationTranslation(e,t,h.#e),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],b=t[10],M=t[11],d=t[12],m=t[13],o=t[14],x=t[15],z=n*c-s*i,R=n*y-r*i,g=n*L-a*i,w=s*y-r*c,V=s*L-a*c,T=r*L-a*y,A=k*m-l*d,D=k*o-b*d,f=k*x-M*d,I=l*o-b*m,S=l*x-M*m,F=b*x-M*o,Q=z*F-R*S+g*I+w*f-V*D+T*A;return Q?(Q=1/Q,e[0]=(c*F-y*S+L*I)*Q,e[1]=(y*f-i*F-L*D)*Q,e[2]=(i*S-c*f+L*A)*Q,e[3]=0,e[4]=(r*S-s*F-a*I)*Q,e[5]=(n*F-r*f+a*D)*Q,e[6]=(s*f-n*S-a*A)*Q,e[7]=0,e[8]=(m*T-o*V+x*w)*Q,e[9]=(o*g-d*T-x*R)*Q,e[10]=(d*V-m*g+x*z)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){h.getScaling(h.#e,t);let n=1/h.#e[0],s=1/h.#e[1],r=1/h.#e[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,b=t[9]*s,M=t[10]*r,d=a+L+M,m=0;return d>0?(m=Math.sqrt(d+1)*2,e[3]=.25*m,e[0]=(k-b)/m,e[1]=(l-c)/m,e[2]=(i-y)/m):a>L&&a>M?(m=Math.sqrt(1+a-L-M)*2,e[3]=(k-b)/m,e[0]=.25*m,e[1]=(i+y)/m,e[2]=(l+c)/m):L>M?(m=Math.sqrt(1+L-a-M)*2,e[3]=(l-c)/m,e[0]=(i+y)/m,e[1]=.25*m,e[2]=(k+b)/m):(m=Math.sqrt(1+M-a-L)*2,e[3]=(i-y)/m,e[0]=(l+c)/m,e[1]=(k+b)/m,e[2]=.25*m),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],b=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+b*b);let M=1/n[0],d=1/n[1],m=1/n[2],o=r*M,x=a*d,z=i*m,R=c*M,g=y*d,w=L*m,V=k*M,T=l*d,A=b*m,D=o+g+A,f=0;return D>0?(f=Math.sqrt(D+1)*2,e[3]=.25*f,e[0]=(w-T)/f,e[1]=(V-z)/f,e[2]=(x-R)/f):o>g&&o>A?(f=Math.sqrt(1+o-g-A)*2,e[3]=(w-T)/f,e[0]=.25*f,e[1]=(x+R)/f,e[2]=(V+z)/f):g>A?(f=Math.sqrt(1+g-o-A)*2,e[3]=(V-z)/f,e[0]=(x+R)/f,e[1]=.25*f,e[2]=(w+T)/f):(f=Math.sqrt(1+A-o-g)*2,e[3]=(x-R)/f,e[0]=(V+z)/f,e[1]=(w+T)/f,e[2]=.25*f),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,b=r*L,M=r*k,d=a*L,m=a*k,o=i*k,x=c*y,z=c*L,R=c*k,g=s[0],w=s[1],V=s[2];return e[0]=(1-(d+o))*g,e[1]=(b+R)*g,e[2]=(M-z)*g,e[3]=0,e[4]=(b-R)*w,e[5]=(1-(l+o))*w,e[6]=(m+x)*w,e[7]=0,e[8]=(M+z)*V,e[9]=(m-x)*V,e[10]=(1-(l+d))*V,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,b=a*L,M=a*k,d=a*l,m=i*k,o=i*l,x=c*l,z=y*L,R=y*k,g=y*l,w=s[0],V=s[1],T=s[2],A=r[0],D=r[1],f=r[2],I=(1-(m+x))*w,S=(M+g)*w,F=(d-R)*w,Q=(M-g)*V,Y=(1-(b+x))*V,X=(o+z)*V,C=(d+R)*T,H=(o-z)*T,W=(1-(b+m))*T;return e[0]=I,e[1]=S,e[2]=F,e[3]=0,e[4]=Q,e[5]=Y,e[6]=X,e[7]=0,e[8]=C,e[9]=H,e[10]=W,e[11]=0,e[12]=n[0]+A-(I*A+Q*D+C*f),e[13]=n[1]+D-(S*A+Y*D+H*f),e[14]=n[2]+f-(F*A+X*D+W*f),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,b=r*i,M=r*c,d=r*y,m=a*i,o=a*c,x=a*y;return e[0]=1-l-d,e[1]=k+x,e[2]=b-o,e[3]=0,e[4]=k-x,e[5]=1-L-d,e[6]=M+m,e[7]=0,e[8]=b+o,e[9]=M-m,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],b=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-b)<1e-6)return h.identity(e);let M=r-k,d=a-l,m=i-b,o=1/Math.sqrt(M*M+d*d+m*m);M*=o,d*=o,m*=o;let x=y*m-L*d,z=L*M-c*m,R=c*d-y*M;o=Math.sqrt(x*x+z*z+R*R),o?(o=1/o,x*=o,z*=o,R*=o):(x=0,z=0,R=0);let g=d*R-m*z,w=m*x-M*R,V=M*z-d*x;return o=Math.sqrt(g*g+w*w+V*V),o?(o=1/o,g*=o,w*=o,V*=o):(g=0,w=0,V=0),e[0]=x,e[1]=g,e[2]=M,e[3]=0,e[4]=z,e[5]=w,e[6]=d,e[7]=0,e[8]=R,e[9]=V,e[10]=m,e[11]=0,e[12]=-(x*r+z*a+R*i),e[13]=-(g*r+w*a+V*i),e[14]=-(M*r+d*a+m*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],b=i-n[2],M=k*k+l*l+b*b;M>0&&(M=1/Math.sqrt(M),k*=M,l*=M,b*=M);let d=y*b-L*l,m=L*k-c*b,o=c*l-y*k;return M=d*d+m*m+o*o,M>0&&(M=1/Math.sqrt(M),d*=M,m*=M,o*=M),e[0]=d,e[1]=m,e[2]=o,e[3]=0,e[4]=l*o-b*m,e[5]=b*d-k*o,e[6]=k*m-l*d,e[7]=0,e[8]=k,e[9]=l,e[10]=b,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],b=e[10],M=e[11],d=e[12],m=e[13],o=e[14],x=e[15],z=t[0],R=t[1],g=t[2],w=t[3],V=t[4],T=t[5],A=t[6],D=t[7],f=t[8],I=t[9],S=t[10],F=t[11],Q=t[12],Y=t[13],X=t[14],C=t[15];return Math.abs(n-z)<=1e-6*Math.max(1,Math.abs(n),Math.abs(z))&&Math.abs(s-R)<=1e-6*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(r-g)<=1e-6*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(i-V)<=1e-6*Math.max(1,Math.abs(i),Math.abs(V))&&Math.abs(c-T)<=1e-6*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(y-A)<=1e-6*Math.max(1,Math.abs(y),Math.abs(A))&&Math.abs(L-D)<=1e-6*Math.max(1,Math.abs(L),Math.abs(D))&&Math.abs(k-f)<=1e-6*Math.max(1,Math.abs(k),Math.abs(f))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(b-S)<=1e-6*Math.max(1,Math.abs(b),Math.abs(S))&&Math.abs(M-F)<=1e-6*Math.max(1,Math.abs(M),Math.abs(F))&&Math.abs(d-Q)<=1e-6*Math.max(1,Math.abs(d),Math.abs(Q))&&Math.abs(m-Y)<=1e-6*Math.max(1,Math.abs(m),Math.abs(Y))&&Math.abs(o-X)<=1e-6*Math.max(1,Math.abs(o),Math.abs(X))&&Math.abs(x-C)<=1e-6*Math.max(1,Math.abs(x),Math.abs(C))}static str(e){return`Mat4(${e.join(", ")})`}};P.prototype.mul=P.prototype.multiply;P.sub=P.subtract;P.mul=P.multiply;P.frustum=P.frustumNO;P.perspective=P.perspectiveNO;P.ortho=P.orthoNO;var q=class h extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return h.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return h.distance(this,e)}dist(e){return 0}squaredDistance(e){return h.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return h.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new h(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(h.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,b=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*b,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*b,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*b,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,b=s*y-r*c,M=(r*b-a*l)*2,d=(a*k-s*b)*2,m=(s*l-r*k)*2;return e[0]=c+k*i+M,e[1]=y+l*i+d,e[2]=L+b*i+m,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&h.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var E=class h extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return h.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return h.distance(this,e)}dist(e){return 0}squaredDistance(e){return h.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return h.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static fromValues(e,t,n,s){return new h(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],b=t[2],M=t[3];return e[0]=l*L-b*y+M*c,e[1]=-(k*L)+b*i-M*a,e[2]=k*y-l*i+M*r,e[3]=-(k*c)+l*a-b*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,b=L*a+i*r-c*s,M=-i*s-c*r-y*a;return e[0]=k*L+M*-i+l*-y-b*-c,e[1]=l*L+M*-c+b*-i-k*-y,e[2]=b*L+M*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};E.prototype.sub=E.prototype.subtract;E.prototype.mul=E.prototype.multiply;E.prototype.div=E.prototype.divide;E.prototype.dist=E.prototype.distance;E.prototype.sqrDist=E.prototype.squaredDistance;E.sub=E.subtract;E.mul=E.multiply;E.div=E.divide;E.dist=E.distance;E.sqrDist=E.squaredDistance;E.sqrLen=E.squaredLength;E.mag=E.magnitude;E.length=E.magnitude;E.len=E.magnitude;var N=class h extends Float64Array{static#t="zyx";static#e=new Float64Array(4);static#r=new Float64Array(4);static#n=new Float64Array(9);static#s=new Float64Array(3);static#a=new Float64Array([1,0,0]);static#i=new Float64Array([0,1,0]);constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return h.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return h.multiply(this,this,e)}mul(e){return this}rotateX(e){return h.rotateX(this,this,e)}rotateY(e){return h.rotateY(this,this,e)}rotateZ(e){return h.rotateZ(this,this,e)}invert(){return h.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return h.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=h.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return h.ln(e,t),h.scale(e,e,n),h.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],b,M,d=r*y+a*L+i*k+c*l;if(d<0&&(d=-d,y=-y,L=-L,k=-k,l=-l),1-d>1e-6){let m=Math.acos(d),o=Math.sin(m);b=Math.sin((1-s)*m)/o,M=Math.sin(s*m)/o}else b=1-s,M=s;return e[0]=b*r+M*y,e[1]=b*a+M*L,e[2]=b*i+M*k,e[3]=b*c+M*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=h.#t){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case"xyz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"xzy":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case"yxz":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case"yzx":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case"zxy":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case"zyx":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(", ")})`}static clone(e){return new h(e)}static fromValues(e,t,n,s){return new h(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=q.dot(t,n);return s<-.999999?(q.cross(h.#s,h.#a,t),q.mag(h.#s)<1e-6&&q.cross(h.#s,h.#i,t),q.normalize(h.#s,h.#s),h.setAxisAngle(e,h.#s,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(q.cross(h.#s,t,n),e[0]=h.#s[0],e[1]=h.#s[1],e[2]=h.#s[2],e[3]=1+s,h.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return h.slerp(h.#e,t,r,a),h.slerp(h.#r,n,s,a),h.slerp(e,h.#e,h.#r,2*a*(1-a)),e}static setAxes(e,t,n,s){return h.#n[0]=n[0],h.#n[3]=n[1],h.#n[6]=n[2],h.#n[1]=s[0],h.#n[4]=s[1],h.#n[7]=s[2],h.#n[2]=-t[0],h.#n[5]=-t[1],h.#n[8]=-t[2],h.normalize(e,h.fromMat3(e,h.#n))}};N.set=E.set;N.add=E.add;N.lerp=E.lerp;N.normalize=E.normalize;N.squaredLength=E.squaredLength;N.sqrLen=E.squaredLength;N.exactEquals=E.exactEquals;N.equals=E.equals;N.magnitude=E.magnitude;N.prototype.mul=N.prototype.multiply;N.mul=N.multiply;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var O=class h extends Float64Array{static#t=new Float64Array(4);static#e=new Float64Array(3);constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t=="number"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return h.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static fromValues(e,t,n,s,r,a,i,c){return new h(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new h(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return P.getRotation(h.#t,t),P.getTranslation(h.#e,t),h.fromRotationTranslation(e,h.#t,h.#e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],b=t[6],M=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+b,e[7]=-s*c-r*y-a*L+M,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,b=y*i+k*r+L*s-c*a,M=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+b*a-M*r,e[5]=b*i+d*r+M*s-l*a,e[6]=M*i+d*a+l*r-b*s,e[7]=d*i-l*s-b*r-M*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,b=y*i+k*r+L*s-c*a,M=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+b*a-M*r,e[5]=b*i+d*r+M*s-l*a,e[6]=M*i+d*a+l*r-b*s,e[7]=d*i-l*s-b*r-M*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,b=y*i+k*r+L*s-c*a,M=L*i+k*a+c*r-y*s,d=k*i-c*s-y*r-L*a;return N.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+d*s+b*a-M*r,e[5]=b*i+d*r+M*s-l*a,e[6]=M*i+d*a+l*r-b*s,e[7]=d*i-l*s-b*r-M*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return h.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],b=t[2],M=t[3];e[0]=k*L+M*i+l*y-b*c,e[1]=l*L+M*c+b*i-k*y,e[2]=b*L+M*y+k*c-l*i,e[3]=M*L-k*i-l*c-b*y;let d=t[4],m=t[5],o=t[6],x=t[7];return e[4]=d*L+x*i+m*y-o*c,e[5]=m*L+x*c+o*i-d*y,e[6]=o*L+x*y+d*c-m*i,e[7]=x*L-d*i-m*c-o*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],b=t[5],M=t[6],d=t[7],m=n[0],o=n[1],x=n[2],z=n[3];return e[0]=s*z+i*m+r*x-a*o,e[1]=r*z+i*o+a*m-s*x,e[2]=a*z+i*x+s*o-r*m,e[3]=i*z-s*m-r*o-a*x,e[4]=s*k+i*c+r*L-a*y+l*z+d*m+b*x-M*o,e[5]=r*k+i*y+a*c-s*L+b*z+d*o+M*m-l*x,e[6]=a*k+i*L+s*y-r*c+M*z+d*x+l*o-b*m,e[7]=i*k-s*c-r*y-a*L+d*z-l*m-b*o-M*x,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return h.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=h.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=h.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(", ")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],b=t[2],M=t[3],d=t[4],m=t[5],o=t[6],x=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-b)<=1e-6*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-x)<=1e-6*Math.max(1,Math.abs(L),Math.abs(x))}};O.dot=N.dot;O.squaredLength=N.squaredLength;O.sqrLen=N.squaredLength;O.mag=N.magnitude;O.length=N.magnitude;O.len=N.magnitude;O.mul=O.multiply;var B=class h extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t=="number"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t=="number"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return h.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return h.distance(this,e)}dist(e){return 0}squaredDistance(e){return h.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return h.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new h}static clone(e){return new h(e)}static fromValues(e,t){return new h(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(", ")})`}};B.prototype.sub=B.prototype.subtract;B.prototype.mul=B.prototype.multiply;B.prototype.div=B.prototype.divide;B.prototype.dist=B.prototype.distance;B.prototype.sqrDist=B.prototype.squaredDistance;B.sub=B.subtract;B.mul=B.multiply;B.div=B.divide;B.dist=B.distance;B.sqrDist=B.squaredDistance;B.sqrLen=B.squaredLength;B.mag=B.magnitude;B.length=B.magnitude;B.len=B.magnitude;var U=!1;function te(){if(U)return;let h=["xx","xy","yx","yy","xxx","xxy","xyx","xyy","yxx","yxy","yyx","yyy","xxxx","xxxy","xxyx","xxyy","xyxx","xyxy","xyyx","xyyy","yxxx","yxxy","yxyx","yxyy","yyxx","yyxy","yyyx","yyyy","rr","rg","gr","gg","rrr","rrg","rgr","rgg","grr","grg","ggr","ggg","rrrr","rrrg","rrgr","rrgg","rgrr","rgrg","rggr","rggg","grrr","grrg","grgr","grgg","ggrr","ggrg","gggr","gggg"],e=["xz","yz","zx","zy","zz","xxz","xyz","xzx","xzy","xzz","yxz","yyz","yzx","yzy","yzz","zxx","zxy","zxz","zyx","zyy","zyz","zzx","zzy","zzz","xxxz","xxyz","xxzx","xxzy","xxzz","xyxz","xyyz","xyzx","xyzy","xyzz","xzxx","xzxy","xzxz","xzyx","xzyy","xzyz","xzzx","xzzy","xzzz","yxxz","yxyz","yxzx","yxzy","yxzz","yyxz","yyyz","yyzx","yyzy","yyzz","yzxx","yzxy","yzxz","yzyx","yzyy","yzyz","yzzx","yzzy","yzzz","zxxx","zxxy","zxxz","zxyx","zxyy","zxyz","zxzx","zxzy","zxzz","zyxx","zyxy","zyxz","zyyx","zyyy","zyyz","zyzx","zyzy","zyzz","zzxx","zzxy","zzxz","zzyx","zzyy","zzyz","zzzx","zzzy","zzzz","rb","gb","br","bg","bb","rrb","rgb","rbr","rbg","rbb","grb","ggb","gbr","gbg","gbb","brr","brg","brb","bgr","bgg","bgb","bbr","bbg","bbb","rrrb","rrgb","rrbr","rrbg","rrbb","rgrb","rggb","rgbr","rgbg","rgbb","rbrr","rbrg","rbrb","rbgr","rbgg","rbgb","rbbr","rbbg","rbbb","grrb","grgb","grbr","grbg","grbb","ggrb","gggb","ggbr","ggbg","ggbb","gbrr","gbrg","gbrb","gbgr","gbgg","gbgb","gbbr","gbbg","gbbb","brrr","brrg","brrb","brgr","brgg","brgb","brbr","brbg","brbb","bgrr","bgrg","bgrb","bggr","bggg","bggb","bgbr","bgbg","bgbb","bbrr","bbrg","bbrb","bbgr","bbgg","bbgb","bbbr","bbbg","bbbb"],t=["xw","yw","zw","wx","wy","wz","ww","xxw","xyw","xzw","xwx","xwy","xwz","xww","yxw","yyw","yzw","ywx","ywy","ywz","yww","zxw","zyw","zzw","zwx","zwy","zwz","zww","wxx","wxy","wxz","wxw","wyx","wyy","wyz","wyw","wzx","wzy","wzz","wzw","wwx","wwy","wwz","www","xxxw","xxyw","xxzw","xxwx","xxwy","xxwz","xxww","xyxw","xyyw","xyzw","xywx","xywy","xywz","xyww","xzxw","xzyw","xzzw","xzwx","xzwy","xzwz","xzww","xwxx","xwxy","xwxz","xwxw","xwyx","xwyy","xwyz","xwyw","xwzx","xwzy","xwzz","xwzw","xwwx","xwwy","xwwz","xwww","yxxw","yxyw","yxzw","yxwx","yxwy","yxwz","yxww","yyxw","yyyw","yyzw","yywx","yywy","yywz","yyww","yzxw","yzyw","yzzw","yzwx","yzwy","yzwz","yzww","ywxx","ywxy","ywxz","ywxw","ywyx","ywyy","ywyz","ywyw","ywzx","ywzy","ywzz","ywzw","ywwx","ywwy","ywwz","ywww","zxxw","zxyw","zxzw","zxwx","zxwy","zxwz","zxww","zyxw","zyyw","zyzw","zywx","zywy","zywz","zyww","zzxw","zzyw","zzzw","zzwx","zzwy","zzwz","zzww","zwxx","zwxy","zwxz","zwxw","zwyx","zwyy","zwyz","zwyw","zwzx","zwzy","zwzz","zwzw","zwwx","zwwy","zwwz","zwww","wxxx","wxxy","wxxz","wxxw","wxyx","wxyy","wxyz","wxyw","wxzx","wxzy","wxzz","wxzw","wxwx","wxwy","wxwz","wxww","wyxx","wyxy","wyxz","wyxw","wyyx","wyyy","wyyz","wyyw","wyzx","wyzy","wyzz","wyzw","wywx","wywy","wywz","wyww","wzxx","wzxy","wzxz","wzxw","wzyx","wzyy","wzyz","wzyw","wzzx","wzzy","wzzz","wzzw","wzwx","wzwy","wzwz","wzww","wwxx","wwxy","wwxz","wwxw","wwyx","wwyy","wwyz","wwyw","wwzx","wwzy","wwzz","wwzw","wwwx","wwwy","wwwz","wwww","ra","ga","ba","ar","ag","ab","aa","rra","rga","rba","rar","rag","rab","raa","gra","gga","gba","gar","gag","gab","gaa","bra","bga","bba","bar","bag","bab","baa","arr","arg","arb","ara","agr","agg","agb","aga","abr","abg","abb","aba","aar","aag","aab","aaa","rrra","rrga","rrba","rrar","rrag","rrab","rraa","rgra","rgga","rgba","rgar","rgag","rgab","rgaa","rbra","rbga","rbba","rbar","rbag","rbab","rbaa","rarr","rarg","rarb","rara","ragr","ragg","ragb","raga","rabr","rabg","rabb","raba","raar","raag","raab","raaa","grra","grga","grba","grar","grag","grab","graa","ggra","ggga","ggba","ggar","ggag","ggab","ggaa","gbra","gbga","gbba","gbar","gbag","gbab","gbaa","garr","garg","garb","gara","gagr","gagg","gagb","gaga","gabr","gabg","gabb","gaba","gaar","gaag","gaab","gaaa","brra","brga","brba","brar","brag","brab","braa","bgra","bgga","bgba","bgar","bgag","bgab","bgaa","bbra","bbga","bbba","bbar","bbag","bbab","bbaa","barr","barg","barb","bara","bagr","bagg","bagb","baga","babr","babg","babb","baba","baar","baag","baab","baaa","arrr","arrg","arrb","arra","argr","argg","argb","arga","arbr","arbg","arbb","arba","arar","arag","arab","araa","agrr","agrg","agrb","agra","aggr","aggg","aggb","agga","agbr","agbg","agbb","agba","agar","agag","agab","agaa","abrr","abrg","abrb","abra","abgr","abgg","abgb","abga","abbr","abbg","abbb","abba","abar","abag","abab","abaa","aarr","aarg","aarb","aara","aagr","aagg","aagb","aaga","aabr","aabg","aabb","aaba","aaar","aaag","aaab","aaaa"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new B(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new E(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error("Illegal swizzle length")}for(let r of h){let a=s(r);Object.defineProperty(B.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(q.prototype,r,{get:a}),Object.defineProperty(E.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(E.prototype,r,{get:a})}U=!0}var ne=Math.PI/180,se=180/Math.PI;function re(h){return h*se}function ae(h){return h*ne} +//# sourceMappingURL=gl-matrix-f64.min.cjs.map diff --git a/dist-cdn/cjs/2022/gl-matrix-f64.min.cjs.map b/dist-cdn/cjs/2022/gl-matrix-f64.min.cjs.map new file mode 100644 index 00000000..9c0977ec --- /dev/null +++ b/dist-cdn/cjs/2022/gl-matrix-f64.min.cjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/cdn/f64/index.ts", "../../../src/_lib/f64/Mat2.ts", "../../../src/_lib/f64/Mat2d.ts", "../../../src/_lib/f64/Mat3.ts", "../../../src/_lib/f64/Mat4.ts", "../../../src/_lib/f64/Vec3.ts", "../../../src/_lib/f64/Vec4.ts", "../../../src/_lib/f64/Quat.ts", "../../../src/_lib/f64/Quat2.ts", "../../../src/_lib/f64/Vec2.ts", "../../../src/swizzle/f64/index.ts", "../../../src/util/angleConversion.ts"], + "sourcesContent": ["/**\r\n * Provides an all-inclusive ESM distribution of `gl-matrix` (64-bit). All library classes extends `Float64Array`.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\n/* v8 ignore next 5 */\r\nexport * from '#gl-matrix/f64';\r\nexport * from '#gl-matrix/swizzle/f64';\r\nexport * from '#gl-matrix/types';\r\nexport * from '#gl-matrix/types/swizzle/f64';\r\nexport * from '#gl-matrix/util';\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x2 Matrix\r\n */\r\nexport class Mat2 extends Float64Array {\r\n static #IDENTITY_2X2 = new Float64Array([\r\n 1, 0,\r\n 0, 1\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n default:\r\n super(Mat2.#IDENTITY_2X2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2} into `this`.\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2.identity(this)\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n identity(): this {\r\n this.set(Mat2.#IDENTITY_2X2);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2} against another one\r\n * Equivalent to `Mat2.multiply(this, this, b);`\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat2}\r\n * Equivalent to `Mat2.transpose(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n transpose(): this {\r\n return Mat2.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat2}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n *\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n invert(): this {\r\n return Mat2.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2.scale(this, this, v);`\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2} by the given angle around the given axis\r\n * Equivalent to `Mat2.rotate(this, this, rad);`\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n * @category Methods\r\n */\r\n rotate(rad: number): this {\r\n return Mat2.rotate(this, this, rad) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2}\r\n */\r\n static create(): Mat2 {\r\n return new Mat2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2}\r\n */\r\n static clone(a: Readonly): Mat2 {\r\n return new Mat2(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2Like, a: Readonly): Mat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2}\r\n */\r\n static fromValues(...values: number[]): Mat2 {\r\n return new Mat2(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2Like, ...values: number[]): Mat2Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2Like): Mat2Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat2Like, a: Readonly): Mat2Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache\r\n // some values\r\n if (out === a) {\r\n const a1 = a[1];\r\n out[1] = a[2];\r\n out[2] = a1;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[2];\r\n out[2] = a[1];\r\n out[3] = a[3];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n // Calculate the determinant\r\n let det = a0 * a3 - a2 * a1;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = a3 * det;\r\n out[1] = -a1 * det;\r\n out[2] = -a2 * det;\r\n out[3] = a0 * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like {\r\n // Caching this value is necessary if out == a\r\n const a0 = a[0];\r\n out[0] = a[3];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[2] * a[1];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n return out;\r\n }\r\n /**\r\n * Alias for {@link Mat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like { return out; }\r\n\r\n /**\r\n * Rotates a {@link Mat2} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2Like, rad: number): Mat2Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2Like, v: Readonly): Mat2Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @category Static\r\n *\r\n * @param L - the lower triangular matrix\r\n * @param D - the diagonal matrix\r\n * @param U - the upper triangular matrix\r\n * @param a - the input matrix to factorize\r\n */\r\n\r\n static LDU(L: Mat2Like, D: Readonly, U: Mat2Like, a: Readonly):\r\n [Mat2Like, Readonly, Mat2Like] {\r\n L[2] = a[2] / a[0];\r\n U[0] = a[0];\r\n U[1] = a[1];\r\n U[3] = a[3] - L[2] * U[1];\r\n return [L, D, U];\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat2.prototype.mul = Mat2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat2.mul = Mat2.multiply;\r\nMat2.sub = Mat2.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 2x3 Matrix\r\n */\r\nexport class Mat2d extends Float64Array {\r\n static #IDENTITY_2X3 = new Float64Array([\r\n 1, 0,\r\n 0, 1,\r\n 0, 0,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 6:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 6); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v,\r\n v, v,\r\n v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 6);\r\n }\r\n break;\r\n default:\r\n super(Mat2d.#IDENTITY_2X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat2d.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat2d.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat2d} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat2d.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat2d.#IDENTITY_2X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat2d} against another one\r\n * Equivalent to `Mat2d.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat2d.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Translate this {@link Mat2d} by the given vector\r\n * Equivalent to `Mat2d.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat2d.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat2d} by the given angle around the given axis\r\n * Equivalent to `Mat2d.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat2d.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat2d.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat2d.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat2d}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 6 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat2d}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat2d}\r\n */\r\n static create(): Mat2d {\r\n return new Mat2d();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat2d}\r\n */\r\n static clone(a: Readonly): Mat2d {\r\n return new Mat2d(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat2d} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat2dLike, a: Readonly): Mat2dLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat2d} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat2d}\r\n */\r\n static fromValues(...values: number[]): Mat2d {\r\n return new Mat2d(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat2d} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat2dLike, ...values: number[]): Mat2dLike {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat2d} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat2dLike): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null {\r\n const aa = a[0];\r\n const ab = a[1];\r\n const ac = a[2];\r\n const ad = a[3];\r\n const atx = a[4];\r\n const aty = a[5];\r\n\r\n let det = aa * ad - ab * ac;\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = ad * det;\r\n out[1] = -ab * det;\r\n out[2] = -ac * det;\r\n out[3] = aa * det;\r\n out[4] = (ac * aty - ad * atx) * det;\r\n out[5] = (ab * atx - aa * aty) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n return a[0] * a[3] - a[1] * a[2];\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat2d}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n out[0] = a0 * b0 + a2 * b1;\r\n out[1] = a1 * b0 + a3 * b1;\r\n out[2] = a0 * b2 + a2 * b3;\r\n out[3] = a1 * b2 + a3 * b3;\r\n out[4] = a0 * b4 + a2 * b5 + a4;\r\n out[5] = a1 * b4 + a3 * b5 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat2d.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat2d} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n out[4] = a0 * v0 + a2 * v1 + a4;\r\n out[5] = a1 * v0 + a3 * v1 + a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat2d} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = a0 * c + a2 * s;\r\n out[1] = a1 * c + a3 * s;\r\n out[2] = a0 * -s + a2 * c;\r\n out[3] = a1 * -s + a3 * c;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const v0 = v[0];\r\n const v1 = v[1];\r\n out[0] = a0 * v0;\r\n out[1] = a1 * v0;\r\n out[2] = a2 * v1;\r\n out[3] = a3 * v1;\r\n out[4] = a4;\r\n out[5] = a5;\r\n return out;\r\n }\r\n\r\n // TODO: Got to fromRotation\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = v[0];\r\n out[5] = v[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.rotate(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat2dLike, rad: number): Mat2dLike {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = -s;\r\n out[3] = c;\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat2d} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * Mat2d.identity(dest);\r\n * Mat2d.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat2d} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = v[1];\r\n out[4] = 0;\r\n out[5] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat2d} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number):\r\n Mat2dLike {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat2d}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat2d(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Static method alias assignments\r\nMat2d.mul = Mat2d.multiply;\r\nMat2d.sub = Mat2d.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2dLike, Mat3Like, Mat4Like, Vec2Like, QuatLike } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 3x3 Matrix\r\n */\r\nexport class Mat3 extends Float64Array {\r\n static #IDENTITY_3X3 = new Float64Array([\r\n 1, 0, 0,\r\n 0, 1, 0,\r\n 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Create a {@link Mat3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 9:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 9); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v,\r\n v, v, v,\r\n v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 9);\r\n }\r\n break;\r\n default:\r\n super(Mat3.#IDENTITY_3X3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat3.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat3.#IDENTITY_3X3);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat3} against another one\r\n * Equivalent to `Mat3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat3.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat3}\r\n * Equivalent to `Mat3.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat3.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat3}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat3.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat3} by the given vector\r\n * Equivalent to `Mat3.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat3.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat3} by the given angle around the given axis\r\n * Equivalent to `Mat3.rotate(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotate(rad: number): this {\r\n return Mat3.rotate(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat3.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec2} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat3.scale(this, this, v) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 9 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat3}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat3}\r\n */\r\n static create(): Mat3 {\r\n return new Mat3();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat3} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat3}\r\n */\r\n static clone(a: Readonly): Mat3 {\r\n return new Mat3(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat3} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new {@link Mat3} with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat3}\r\n */\r\n static fromValues(...values: number[]): Mat3 {\r\n return new Mat3(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Mat3} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat3Like, ...values: number[]): Mat3Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat3} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat3Like): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat3Like, a: Readonly): Mat3Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a12 = a[5];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a01;\r\n out[5] = a[7];\r\n out[6] = a02;\r\n out[7] = a12;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[3];\r\n out[2] = a[6];\r\n out[3] = a[1];\r\n out[4] = a[4];\r\n out[5] = a[7];\r\n out[6] = a[2];\r\n out[7] = a[5];\r\n out[8] = a[8];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2];\r\n const a10 = a[3],\r\n a11 = a[4],\r\n a12 = a[5];\r\n const a20 = a[6],\r\n a21 = a[7],\r\n a22 = a[8];\r\n\r\n const b01 = a22 * a11 - a12 * a21;\r\n const b11 = -a22 * a10 + a12 * a20;\r\n const b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n let det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = b01 * det;\r\n out[1] = (-a22 * a01 + a02 * a21) * det;\r\n out[2] = (a12 * a01 - a02 * a11) * det;\r\n out[3] = b11 * det;\r\n out[4] = (a22 * a00 - a02 * a20) * det;\r\n out[5] = (-a12 * a00 + a02 * a10) * det;\r\n out[6] = b21 * det;\r\n out[7] = (-a21 * a00 + a01 * a20) * det;\r\n out[8] = (a11 * a00 - a01 * a10) * det;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n out[0] = a11 * a22 - a12 * a21;\r\n out[1] = a02 * a21 - a01 * a22;\r\n out[2] = a01 * a12 - a02 * a11;\r\n out[3] = a12 * a20 - a10 * a22;\r\n out[4] = a00 * a22 - a02 * a20;\r\n out[5] = a02 * a10 - a00 * a12;\r\n out[6] = a10 * a21 - a11 * a20;\r\n out[7] = a01 * a20 - a00 * a21;\r\n out[8] = a00 * a11 - a01 * a10;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n return (\r\n a00 * (a22 * a11 - a12 * a21) +\r\n a01 * (-a22 * a10 + a12 * a20) +\r\n a02 * (a21 * a10 - a11 * a20)\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Mat3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[3];\r\n b1 = b[4];\r\n b2 = b[5];\r\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\r\n\r\n b0 = b[6];\r\n b1 = b[7];\r\n b2 = b[8];\r\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\r\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\r\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat3} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n\r\n out[3] = a10;\r\n out[4] = a11;\r\n out[5] = a12;\r\n\r\n out[6] = x * a00 + y * a10 + a20;\r\n out[7] = x * a01 + y * a11 + a21;\r\n out[8] = x * a02 + y * a12 + a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat3} by the given angle\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a10 = a[3];\r\n const a11 = a[4];\r\n const a12 = a[5];\r\n const a20 = a[6];\r\n const a21 = a[7];\r\n const a22 = a[8];\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c * a00 + s * a10;\r\n out[1] = c * a01 + s * a11;\r\n out[2] = c * a02 + s * a12;\r\n\r\n out[3] = c * a10 - s * a00;\r\n out[4] = c * a11 - s * a01;\r\n out[5] = c * a12 - s * a02;\r\n\r\n out[6] = a20;\r\n out[7] = a21;\r\n out[8] = a22;\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec2} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like {\r\n const x = v[0];\r\n const y = v[1];\r\n\r\n out[0] = x * a[0];\r\n out[1] = x * a[1];\r\n out[2] = x * a[2];\r\n\r\n out[3] = y * a[3];\r\n out[4] = y * a[4];\r\n out[5] = y * a[5];\r\n\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = v[0];\r\n out[7] = v[1];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Mat3Like, rad: number): Mat3Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n\r\n out[3] = -s;\r\n out[4] = c;\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat3} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat3Like, v: Readonly): Mat3Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n\r\n out[3] = 0;\r\n out[4] = v[1];\r\n out[5] = 0;\r\n\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 2x3 matrix\r\n * @returns `out`\r\n */\r\n static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = 0;\r\n\r\n out[3] = a[2];\r\n out[4] = a[3];\r\n out[5] = 0;\r\n\r\n out[6] = a[4];\r\n out[7] = a[5];\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - {@link Mat3} receiving operation result\r\n * @param q - {@link Quat} to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat3Like, q: Readonly): Mat3Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[3] = yx - wz;\r\n out[6] = zx + wy;\r\n\r\n out[1] = yx + wz;\r\n out[4] = 1 - xx - zz;\r\n out[7] = zy - wx;\r\n\r\n out[2] = zx - wy;\r\n out[5] = zy + wx;\r\n out[8] = 1 - xx - yy;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\r\n * {@link Mat3}.\r\n * @category Static\r\n *\r\n * @param out - the receiving 3x3 matrix\r\n * @param a - the source 4x4 matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Mat3Like, a: Readonly): Mat3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n * @category Static\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n\r\n out[3] = cy * az - cz * ay;\r\n out[4] = cz * ax - cx * az;\r\n out[5] = cx * ay - cy * ax;\r\n\r\n out[6] = ay * bz - az * by;\r\n out[7] = az * bx - ax * bz;\r\n out[8] = ax * by - ay * bx;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a 2D projection matrix with the given bounds\r\n * @category Static\r\n *\r\n * @param out mat3 frustum matrix will be written into\r\n * @param width Width of your gl context\r\n * @param height Height of gl context\r\n * @returns `out`\r\n */\r\n static projection(out: Mat3Like, width: number, height: number): Mat3Like {\r\n out[0] = 2 / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -2 / height;\r\n out[5] = 0;\r\n out[6] = -1;\r\n out[7] = 1;\r\n out[8] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8]\r\n );\r\n }\r\n\r\n /**\r\n * Multiply each element of a {@link Mat3} by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat3}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat3(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat3.prototype.mul = Mat3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat3.mul = Mat3.multiply;\r\nMat3.sub = Mat3.subtract;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * A 4x4 Matrix\r\n */\r\nexport class Mat4 extends Float64Array {\r\n static #IDENTITY_4X4 = new Float64Array([\r\n 1, 0, 0, 0,\r\n 0, 1, 0, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 0, 1,\r\n ]);\r\n\r\n /**\r\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\r\n * These are declared as TypedArrays to aid in tree-shaking.\r\n */\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Mat4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 16:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 16); break;\r\n case 1:\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v,\r\n v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 16);\r\n }\r\n break;\r\n default:\r\n super(Mat4.#IDENTITY_4X4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Mat4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Mat4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instance methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Mat4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity matrix\r\n * Equivalent to Mat4.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this.set(Mat4.#IDENTITY_4X4);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies this {@link Mat4} against another one\r\n * Equivalent to `Mat4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Mat4.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Transpose this {@link Mat4}\r\n * Equivalent to `Mat4.transpose(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n transpose(): this {\r\n return Mat4.transpose(this, this) as this;\r\n }\r\n\r\n /**\r\n * Inverts this {@link Mat4}\r\n * Equivalent to `Mat4.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Mat4.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Translate this {@link Mat4} by the given vector\r\n * Equivalent to `Mat4.translate(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to translate by\r\n * @returns `this`\r\n */\r\n translate(v: Readonly): this {\r\n return Mat4.translate(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the given axis\r\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `this`\r\n */\r\n rotate(rad: number, axis: Readonly): this {\r\n return Mat4.rotate(this, this, rad, axis) as this;\r\n }\r\n\r\n /**\r\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\r\n * Equivalent to `Mat4.scale(this, this, v);`\r\n * @category Methods\r\n *\r\n * @param v - The {@link Vec3} to scale the matrix by\r\n * @returns `this`\r\n */\r\n scale(v: Readonly): this {\r\n return Mat4.scale(this, this, v) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the X axis\r\n * Equivalent to `Mat4.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Mat4.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Y axis\r\n * Equivalent to `Mat4.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Mat4.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates this {@link Mat4} by the given angle around the Z axis\r\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Mat4.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveNO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveNO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\r\n * @category Methods\r\n *\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `this`\r\n */\r\n perspectiveZO(fovy: number, aspect: number, near: number, far: number): this {\r\n return Mat4.perspectiveZO(this, fovy, aspect, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoNO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\r\n * @category Methods\r\n *\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `this`\r\n */\r\n orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this {\r\n return Mat4.orthoZO(this, left, right, bottom, top, near, far) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Mat4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 16 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, identity {@link Mat4}\r\n * @category Static\r\n *\r\n * @returns A new {@link Mat4}\r\n */\r\n static create(): Mat4 {\r\n return new Mat4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Mat4} initialized with values from an existing matrix\r\n * @category Static\r\n *\r\n * @param a - Matrix to clone\r\n * @returns A new {@link Mat4}\r\n */\r\n static clone(a: Readonly): Mat4 {\r\n return new Mat4(a);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Mat4} to another\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - Matrix to copy\r\n * @returns `out`\r\n */\r\n static copy(out: Mat4Like, a: Readonly): Mat4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Create a new mat4 with the given values\r\n * @category Static\r\n *\r\n * @param values - Matrix components\r\n * @returns A new {@link Mat4}\r\n */\r\n static fromValues(...values: number[]): Mat4 {\r\n return new Mat4(...values);\r\n }\r\n\r\n /**\r\n * Set the components of a mat4 to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving matrix\r\n * @param values - Matrix components\r\n * @returns `out`\r\n */\r\n static set(out: Mat4Like, ...values: number[]): Mat4Like {\r\n out[0] = values[0];\r\n out[1] = values[1];\r\n out[2] = values[2];\r\n out[3] = values[3];\r\n out[4] = values[4];\r\n out[5] = values[5];\r\n out[6] = values[6];\r\n out[7] = values[7];\r\n out[8] = values[8];\r\n out[9] = values[9];\r\n out[10] = values[10];\r\n out[11] = values[11];\r\n out[12] = values[12];\r\n out[13] = values[13];\r\n out[14] = values[14];\r\n out[15] = values[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Mat4} to the identity matrix\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @returns `out`\r\n */\r\n static identity(out: Mat4Like): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transpose the values of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static transpose(out: Mat4Like, a: Readonly): Mat4Like {\r\n // If we are transposing ourselves we can skip a few steps but have to cache some values\r\n if (out === a) {\r\n const a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a12 = a[6],\r\n a13 = a[7];\r\n const a23 = a[11];\r\n\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a01;\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a02;\r\n out[9] = a12;\r\n out[11] = a[14];\r\n out[12] = a03;\r\n out[13] = a13;\r\n out[14] = a23;\r\n } else {\r\n out[0] = a[0];\r\n out[1] = a[4];\r\n out[2] = a[8];\r\n out[3] = a[12];\r\n out[4] = a[1];\r\n out[5] = a[5];\r\n out[6] = a[9];\r\n out[7] = a[13];\r\n out[8] = a[2];\r\n out[9] = a[6];\r\n out[10] = a[10];\r\n out[11] = a[14];\r\n out[12] = a[3];\r\n out[13] = a[7];\r\n out[14] = a[11];\r\n out[15] = a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Inverts a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the adjugate of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the source matrix\r\n * @returns `out`\r\n */\r\n static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\r\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\r\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\r\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\r\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\r\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\r\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\r\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\r\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\r\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\r\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\r\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\r\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\r\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\r\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\r\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the determinant of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the source matrix\r\n * @returns determinant of a\r\n */\r\n static determinant(a: Readonly): number {\r\n const a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n const a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n const a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n const a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n const b0 = a00 * a11 - a01 * a10;\r\n const b1 = a00 * a12 - a02 * a10;\r\n const b2 = a01 * a12 - a02 * a11;\r\n const b3 = a20 * a31 - a21 * a30;\r\n const b4 = a20 * a32 - a22 * a30;\r\n const b5 = a21 * a32 - a22 * a31;\r\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\r\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\r\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\r\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\r\n\r\n // Calculate the determinant\r\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Mat4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving Matrix\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0];\r\n let b1 = b[1];\r\n let b2 = b[2];\r\n let b3 = b[3];\r\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Translate a {@link Mat4} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n if (a === out) {\r\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n } else {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n out[0] = a00;\r\n out[1] = a01;\r\n out[2] = a02;\r\n out[3] = a03;\r\n out[4] = a10;\r\n out[5] = a11;\r\n out[6] = a12;\r\n out[7] = a13;\r\n out[8] = a20;\r\n out[9] = a21;\r\n out[10] = a22;\r\n out[11] = a23;\r\n\r\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\r\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\r\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\r\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param v - the {@link Vec3} to scale the matrix by\r\n * @returns `out`\r\n **/\r\n static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like {\r\n const x = v[0];\r\n const y = v[1];\r\n const z = v[2];\r\n\r\n out[0] = a[0] * x;\r\n out[1] = a[1] * x;\r\n out[2] = a[2] * x;\r\n out[3] = a[3] * x;\r\n out[4] = a[4] * y;\r\n out[5] = a[5] * y;\r\n out[6] = a[6] * y;\r\n out[7] = a[7] * y;\r\n out[8] = a[8] * z;\r\n out[9] = a[9] * z;\r\n out[10] = a[10] * z;\r\n out[11] = a[11] * z;\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Mat4} by the given angle around the given axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if axis has a length of 0\r\n */\r\n static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n const b00 = x * x * t + c;\r\n const b01 = y * x * t + z * s;\r\n const b02 = z * x * t - y * s;\r\n const b10 = x * y * t - z * s;\r\n const b11 = y * y * t + c;\r\n const b12 = z * y * t + x * s;\r\n const b20 = x * z * t + y * s;\r\n const b21 = y * z * t - x * s;\r\n const b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[4] = a10 * c + a20 * s;\r\n out[5] = a11 * c + a21 * s;\r\n out[6] = a12 * c + a22 * s;\r\n out[7] = a13 * c + a23 * s;\r\n out[8] = a20 * c - a10 * s;\r\n out[9] = a21 * c - a11 * s;\r\n out[10] = a22 * c - a12 * s;\r\n out[11] = a23 * c - a13 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged rows\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c - a20 * s;\r\n out[1] = a01 * c - a21 * s;\r\n out[2] = a02 * c - a22 * s;\r\n out[3] = a03 * c - a23 * s;\r\n out[8] = a00 * s + a20 * c;\r\n out[9] = a01 * s + a21 * c;\r\n out[10] = a02 * s + a22 * c;\r\n out[11] = a03 * s + a23 * c;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a matrix by the given angle around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to rotate\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n\r\n if (a !== out) {\r\n // If the source and destination differ, copy the unchanged last row\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n }\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = a00 * c + a10 * s;\r\n out[1] = a01 * c + a11 * s;\r\n out[2] = a02 * c + a12 * s;\r\n out[3] = a03 * c + a13 * s;\r\n out[4] = a10 * c - a00 * s;\r\n out[5] = a11 * c - a01 * s;\r\n out[6] = a12 * c - a02 * s;\r\n out[7] = a13 * c - a03 * s;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param v - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromScaling(out: Mat4Like, v: Readonly): Mat4Like {\r\n out[0] = v[0];\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = v[1];\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = v[2];\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a {@link Mat4} from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - {@link Mat4} receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @param axis - the axis to rotate around\r\n * @returns `out` or `null` if `axis` has a length of 0\r\n */\r\n static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null {\r\n let x = axis[0];\r\n let y = axis[1];\r\n let z = axis[2];\r\n let len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (len < GLM_EPSILON) {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n const t = 1 - c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n out[0] = x * x * t + c;\r\n out[1] = y * x * t + z * s;\r\n out[2] = z * x * t - y * s;\r\n out[3] = 0;\r\n out[4] = x * y * t - z * s;\r\n out[5] = y * y * t + c;\r\n out[6] = z * y * t + x * s;\r\n out[7] = 0;\r\n out[8] = x * z * t + y * s;\r\n out[9] = y * z * t - x * s;\r\n out[10] = z * z * t + c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromXRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = c;\r\n out[6] = s;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = -s;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromYRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = 0;\r\n out[2] = -s;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = s;\r\n out[9] = 0;\r\n out[10] = c;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param rad - the angle to rotate the matrix by\r\n * @returns `out`\r\n */\r\n static fromZRotation(out: Mat4Like, rad: number): Mat4Like {\r\n const s = Math.sin(rad);\r\n const c = Math.cos(rad);\r\n\r\n // Perform axis-specific matrix multiplication\r\n out[0] = c;\r\n out[1] = s;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = -s;\r\n out[5] = c;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Mat4} from a {@link Quat2}.\r\n * @category Static\r\n *\r\n * @param out - Matrix\r\n * @param a - Dual Quaternion\r\n * @returns `out`\r\n */\r\n static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like {\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n\r\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\r\n\r\n // Only scale if it makes sense\r\n if (magnitude > 0) {\r\n Mat4.#TMP_VEC3[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\r\n Mat4.#TMP_VEC3[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\r\n } else {\r\n Mat4.#TMP_VEC3[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n Mat4.#TMP_VEC3[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n Mat4.#TMP_VEC3[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n }\r\n Mat4.fromRotationTranslation(out, a as QuatLike, Mat4.#TMP_VEC3);\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out` or `null` if the matrix is not invertible\r\n */\r\n static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null {\r\n const a00 = a[0];\r\n const a01 = a[1];\r\n const a02 = a[2];\r\n const a03 = a[3];\r\n const a10 = a[4];\r\n const a11 = a[5];\r\n const a12 = a[6];\r\n const a13 = a[7];\r\n const a20 = a[8];\r\n const a21 = a[9];\r\n const a22 = a[10];\r\n const a23 = a[11];\r\n const a30 = a[12];\r\n const a31 = a[13];\r\n const a32 = a[14];\r\n const a33 = a[15];\r\n\r\n const b00 = a00 * a11 - a01 * a10;\r\n const b01 = a00 * a12 - a02 * a10;\r\n const b02 = a00 * a13 - a03 * a10;\r\n const b03 = a01 * a12 - a02 * a11;\r\n const b04 = a01 * a13 - a03 * a11;\r\n const b05 = a02 * a13 - a03 * a12;\r\n const b06 = a20 * a31 - a21 * a30;\r\n const b07 = a20 * a32 - a22 * a30;\r\n const b08 = a20 * a33 - a23 * a30;\r\n const b09 = a21 * a32 - a22 * a31;\r\n const b10 = a21 * a33 - a23 * a31;\r\n const b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n let det =\r\n b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det) {\r\n return null;\r\n }\r\n det = 1.0 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n out[3] = 0;\r\n\r\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n out[7] = 0;\r\n\r\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\r\n * This version omits the calculation of the constant factor (1/determinant), so\r\n * any normals transformed with it will need to be renormalized.\r\n * From https://stackoverflow.com/a/27616419/25968\r\n * @category Static\r\n *\r\n * @param out - Matrix receiving operation result\r\n * @param a - Mat4 to derive the normal matrix from\r\n * @returns `out`\r\n */\r\n static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n\r\n const bx = a[4];\r\n const by = a[5];\r\n const bz = a[6];\r\n\r\n const cx = a[8];\r\n const cy = a[9];\r\n const cz = a[10];\r\n\r\n out[0] = by * cz - cz * cy;\r\n out[1] = bz * cx - cx * cz;\r\n out[2] = bx * cy - cy * cx;\r\n out[3] = 0;\r\n\r\n out[4] = cy * az - cz * ay;\r\n out[5] = cz * ax - cx * az;\r\n out[6] = cx * ay - cy * ax;\r\n out[7] = 0;\r\n\r\n out[8] = ay * bz - az * by;\r\n out[9] = az * bx - ax * bz;\r\n out[10] = ax * by - ay * bx;\r\n out[11] = 0;\r\n\r\n // No translation\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like {\r\n out[0] = mat[12];\r\n out[1] = mat[13];\r\n out[2] = mat[14];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion parameter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @category Static\r\n *\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\r\n static getScaling(out: Vec3Like, mat: Readonly): Vec3Like {\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @category Static\r\n *\r\n * @param out - Quaternion to receive the rotation component\r\n * @param mat - Matrix to be decomposed (input)\r\n * @return `out`\r\n */\r\n static getRotation(out: QuatLike, mat: Readonly): QuatLike {\r\n Mat4.getScaling(Mat4.#TMP_VEC3, mat);\r\n\r\n const is1 = 1 / Mat4.#TMP_VEC3[0];\r\n const is2 = 1 / Mat4.#TMP_VEC3[1];\r\n const is3 = 1 / Mat4.#TMP_VEC3[2];\r\n\r\n const sm11 = mat[0] * is1;\r\n const sm12 = mat[1] * is2;\r\n const sm13 = mat[2] * is3;\r\n const sm21 = mat[4] * is1;\r\n const sm22 = mat[5] * is2;\r\n const sm23 = mat[6] * is3;\r\n const sm31 = mat[8] * is1;\r\n const sm32 = mat[9] * is2;\r\n const sm33 = mat[10] * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out[3] = 0.25 * S;\r\n out[0] = (sm23 - sm32) / S;\r\n out[1] = (sm31 - sm13) / S;\r\n out[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out[3] = (sm23 - sm32) / S;\r\n out[0] = 0.25 * S;\r\n out[1] = (sm12 + sm21) / S;\r\n out[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out[3] = (sm31 - sm13) / S;\r\n out[0] = (sm12 + sm21) / S;\r\n out[1] = 0.25 * S;\r\n out[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out[3] = (sm12 - sm21) / S;\r\n out[0] = (sm31 + sm13) / S;\r\n out[1] = (sm23 + sm32) / S;\r\n out[2] = 0.25 * S;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Decomposes a transformation matrix into its rotation, translation\r\n * and scale components. Returns only the rotation component\r\n * @category Static\r\n *\r\n * @param out_r - Quaternion to receive the rotation component\r\n * @param out_t - Vector to receive the translation vector\r\n * @param out_s - Vector to receive the scaling factor\r\n * @param mat - Matrix to be decomposed (input)\r\n * @returns `out_r`\r\n */\r\n static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike {\r\n out_t[0] = mat[12];\r\n out_t[1] = mat[13];\r\n out_t[2] = mat[14];\r\n\r\n const m11 = mat[0];\r\n const m12 = mat[1];\r\n const m13 = mat[2];\r\n const m21 = mat[4];\r\n const m22 = mat[5];\r\n const m23 = mat[6];\r\n const m31 = mat[8];\r\n const m32 = mat[9];\r\n const m33 = mat[10];\r\n\r\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\r\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\r\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\r\n\r\n const is1 = 1 / out_s[0];\r\n const is2 = 1 / out_s[1];\r\n const is3 = 1 / out_s[2];\r\n\r\n const sm11 = m11 * is1;\r\n const sm12 = m12 * is2;\r\n const sm13 = m13 * is3;\r\n const sm21 = m21 * is1;\r\n const sm22 = m22 * is2;\r\n const sm23 = m23 * is3;\r\n const sm31 = m31 * is1;\r\n const sm32 = m32 * is2;\r\n const sm33 = m33 * is3;\r\n\r\n const trace = sm11 + sm22 + sm33;\r\n let S = 0;\r\n\r\n if (trace > 0) {\r\n S = Math.sqrt(trace + 1.0) * 2;\r\n out_r[3] = 0.25 * S;\r\n out_r[0] = (sm23 - sm32) / S;\r\n out_r[1] = (sm31 - sm13) / S;\r\n out_r[2] = (sm12 - sm21) / S;\r\n } else if (sm11 > sm22 && sm11 > sm33) {\r\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\r\n out_r[3] = (sm23 - sm32) / S;\r\n out_r[0] = 0.25 * S;\r\n out_r[1] = (sm12 + sm21) / S;\r\n out_r[2] = (sm31 + sm13) / S;\r\n } else if (sm22 > sm33) {\r\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\r\n out_r[3] = (sm31 - sm13) / S;\r\n out_r[0] = (sm12 + sm21) / S;\r\n out_r[1] = 0.25 * S;\r\n out_r[2] = (sm23 + sm32) / S;\r\n } else {\r\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\r\n out_r[3] = (sm12 - sm21) / S;\r\n out_r[0] = (sm31 + sm13) / S;\r\n out_r[1] = (sm23 + sm32) / S;\r\n out_r[2] = 0.25 * S;\r\n }\r\n\r\n return out_r;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScale(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n out[0] = (1 - (yy + zz)) * sx;\r\n out[1] = (xy + wz) * sx;\r\n out[2] = (xz - wy) * sx;\r\n out[3] = 0;\r\n out[4] = (xy - wz) * sy;\r\n out[5] = (1 - (xx + zz)) * sy;\r\n out[6] = (yz + wx) * sy;\r\n out[7] = 0;\r\n out[8] = (xz + wy) * sz;\r\n out[9] = (yz - wx) * sz;\r\n out[10] = (1 - (xx + yy)) * sz;\r\n out[11] = 0;\r\n out[12] = v[0];\r\n out[13] = v[1];\r\n out[14] = v[2];\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\r\n * given origin. This is equivalent to (but much faster than):\r\n * ```js\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n * ```\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Rotation quaternion\r\n * @param v - Translation vector\r\n * @param s - Scaling vector\r\n * @param o - The origin vector around which to scale and rotate\r\n * @returns `out`\r\n */\r\n static fromRotationTranslationScaleOrigin(out: Mat4Like, q: Readonly, v: Readonly,\r\n s: Readonly, o: Readonly): Mat4Like {\r\n // Quaternion math\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const xy = x * y2;\r\n const xz = x * z2;\r\n const yy = y * y2;\r\n const yz = y * z2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n const sx = s[0];\r\n const sy = s[1];\r\n const sz = s[2];\r\n\r\n const ox = o[0];\r\n const oy = o[1];\r\n const oz = o[2];\r\n\r\n const out0 = (1 - (yy + zz)) * sx;\r\n const out1 = (xy + wz) * sx;\r\n const out2 = (xz - wy) * sx;\r\n const out4 = (xy - wz) * sy;\r\n const out5 = (1 - (xx + zz)) * sy;\r\n const out6 = (yz + wx) * sy;\r\n const out8 = (xz + wy) * sz;\r\n const out9 = (yz - wx) * sz;\r\n const out10 = (1 - (xx + yy)) * sz;\r\n\r\n out[0] = out0;\r\n out[1] = out1;\r\n out[2] = out2;\r\n out[3] = 0;\r\n out[4] = out4;\r\n out[5] = out5;\r\n out[6] = out6;\r\n out[7] = 0;\r\n out[8] = out8;\r\n out[9] = out9;\r\n out[10] = out10;\r\n out[11] = 0;\r\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\r\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\r\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n * @category Static\r\n *\r\n * @param out - mat4 receiving operation result\r\n * @param q - Quaternion to create matrix from\r\n * @returns `out`\r\n */\r\n static fromQuat(out: Mat4Like, q: Readonly): Mat4Like {\r\n const x = q[0];\r\n const y = q[1];\r\n const z = q[2];\r\n const w = q[3];\r\n const x2 = x + x;\r\n const y2 = y + y;\r\n const z2 = z + z;\r\n\r\n const xx = x * x2;\r\n const yx = y * x2;\r\n const yy = y * y2;\r\n const zx = z * x2;\r\n const zy = z * y2;\r\n const zz = z * z2;\r\n const wx = w * x2;\r\n const wy = w * y2;\r\n const wz = w * z2;\r\n\r\n out[0] = 1 - yy - zz;\r\n out[1] = yx + wz;\r\n out[2] = zx - wy;\r\n out[3] = 0;\r\n\r\n out[4] = yx - wz;\r\n out[5] = 1 - xx - zz;\r\n out[6] = zy + wx;\r\n out[7] = 0;\r\n\r\n out[8] = zx + wy;\r\n out[9] = zy - wx;\r\n out[10] = 1 - xx - yy;\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.frustumNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\r\n */\r\n static frustum(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like { return out; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Generates a frustum matrix with the given bounds\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static frustumZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far = Infinity): Mat4Like {\r\n const rl = 1 / (right - left);\r\n const tb = 1 / (top - bottom);\r\n out[0] = near * 2 * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = near * 2 * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\r\n * which matches WebGL/OpenGL's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = (far + near) * nf;\r\n out[14] = 2 * far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -2 * near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.perspectiveNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\r\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\r\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fovy - Vertical field of view in radians\r\n * @param aspect - Aspect ratio. typically viewport width/height\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum, can be null or Infinity\r\n * @returns `out`\r\n */\r\n static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far = Infinity): Mat4Like {\r\n const f = 1.0 / Math.tan(fovy / 2);\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[11] = -1;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[15] = 0;\r\n if (far != null && far !== Infinity) {\r\n const nf = 1 / (near - far);\r\n out[10] = far * nf;\r\n out[14] = far * near * nf;\r\n } else {\r\n out[10] = -1;\r\n out[14] = -near;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\r\n * projection matrices to be used with the still experimental WebVR API.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n * @deprecated\r\n */\r\n static perspectiveFromFieldOfView(out: Mat4Like,\r\n fov: { upDegrees: number, downDegrees: number, leftDegrees: number, rightDegrees: number }, near: number,\r\n far: number): Mat4Like {\r\n\r\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\r\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\r\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\r\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\r\n const xScale = 2.0 / (leftTan + rightTan);\r\n const yScale = 2.0 / (upTan + downTan);\r\n\r\n out[0] = xScale;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n out[4] = 0.0;\r\n out[5] = yScale;\r\n out[6] = 0.0;\r\n out[7] = 0.0;\r\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\r\n out[9] = (upTan - downTan) * yScale * 0.5;\r\n out[10] = far / (near - far);\r\n out[11] = -1.0;\r\n out[12] = 0.0;\r\n out[13] = 0.0;\r\n out[14] = (far * near) / (near - far);\r\n out[15] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoNO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.orthoNO}\r\n * @category Static\r\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static ortho(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number, far: number):\r\n Mat4Like {\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\r\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param left - Left bound of the frustum\r\n * @param right - Right bound of the frustum\r\n * @param bottom - Bottom bound of the frustum\r\n * @param top - Top bound of the frustum\r\n * @param near - Near bound of the frustum\r\n * @param far - Far bound of the frustum\r\n * @returns `out`\r\n */\r\n static orthoZO(out: Mat4Like, left: number, right: number, bottom: number, top: number, near: number,\r\n far: number): Mat4Like {\r\n const lr = 1 / (left - right);\r\n const bt = 1 / (bottom - top);\r\n const nf = 1 / (near - far);\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = nf;\r\n out[11] = 0;\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = near * nf;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\r\n * actually makes an object look at another object, you should use targetTo instead.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param center - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n const centerx = center[0];\r\n const centery = center[1];\r\n const centerz = center[2];\r\n\r\n if (\r\n Math.abs(eyex - centerx) < GLM_EPSILON &&\r\n Math.abs(eyey - centery) < GLM_EPSILON &&\r\n Math.abs(eyez - centerz) < GLM_EPSILON\r\n ) {\r\n return Mat4.identity(out);\r\n }\r\n\r\n let z0 = eyex - centerx;\r\n let z1 = eyey - centery;\r\n let z2 = eyez - centerz;\r\n\r\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n if (!len) {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n } else {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n let y0 = z1 * x2 - z2 * x1;\r\n let y1 = z2 * x0 - z0 * x2;\r\n let y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n if (!len) {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n } else {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a matrix that makes something look at something else.\r\n * @category Static\r\n *\r\n * @param out - mat4 frustum matrix will be written into\r\n * @param eye - Position of the viewer\r\n * @param target - Point the viewer is looking at\r\n * @param up - vec3 pointing up\r\n * @returns `out`\r\n */\r\n static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly):\r\n Mat4Like {\r\n const eyex = eye[0];\r\n const eyey = eye[1];\r\n const eyez = eye[2];\r\n const upx = up[0];\r\n const upy = up[1];\r\n const upz = up[2];\r\n\r\n let z0 = eyex - target[0];\r\n let z1 = eyey - target[1];\r\n let z2 = eyez - target[2];\r\n\r\n let len = z0 * z0 + z1 * z1 + z2 * z2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n }\r\n\r\n let x0 = upy * z2 - upz * z1;\r\n let x1 = upz * z0 - upx * z2;\r\n let x2 = upx * z1 - upy * z0;\r\n\r\n len = x0 * x0 + x1 * x1 + x2 * x2;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = x1;\r\n out[2] = x2;\r\n out[3] = 0;\r\n out[4] = z1 * x2 - z2 * x1;\r\n out[5] = z2 * x0 - z0 * x2;\r\n out[6] = z0 * x1 - z1 * x0;\r\n out[7] = 0;\r\n out[8] = z0;\r\n out[9] = z1;\r\n out[10] = z2;\r\n out[11] = 0;\r\n out[12] = eyex;\r\n out[13] = eyey;\r\n out[14] = eyez;\r\n out[15] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns Frobenius norm of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - the matrix to calculate Frobenius norm of\r\n * @returns Frobenius norm\r\n */\r\n static frob(a: Readonly): number {\r\n return Math.sqrt(\r\n a[0] * a[0] +\r\n a[1] * a[1] +\r\n a[2] * a[2] +\r\n a[3] * a[3] +\r\n a[4] * a[4] +\r\n a[5] * a[5] +\r\n a[6] * a[6] +\r\n a[7] * a[7] +\r\n a[8] * a[8] +\r\n a[9] * a[9] +\r\n a[10] * a[10] +\r\n a[11] * a[11] +\r\n a[12] * a[12] +\r\n a[13] * a[13] +\r\n a[14] * a[14] +\r\n a[15] * a[15]\r\n );\r\n }\r\n\r\n /**\r\n * Adds two {@link Mat4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n out[8] = a[8] + b[8];\r\n out[9] = a[9] + b[9];\r\n out[10] = a[10] + b[10];\r\n out[11] = a[11] + b[11];\r\n out[12] = a[12] + b[12];\r\n out[13] = a[13] + b[13];\r\n out[14] = a[14] + b[14];\r\n out[15] = a[15] + b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts matrix b from matrix a\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n out[4] = a[4] - b[4];\r\n out[5] = a[5] - b[5];\r\n out[6] = a[6] - b[6];\r\n out[7] = a[7] - b[7];\r\n out[8] = a[8] - b[8];\r\n out[9] = a[9] - b[9];\r\n out[10] = a[10] - b[10];\r\n out[11] = a[11] - b[11];\r\n out[12] = a[12] - b[12];\r\n out[13] = a[13] - b[13];\r\n out[14] = a[14] - b[14];\r\n out[15] = a[15] - b[15];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Mat4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like { return out; }\r\n\r\n /**\r\n * Multiply each element of the matrix by a scalar.\r\n * @category Static\r\n *\r\n * @param out - the receiving matrix\r\n * @param a - the matrix to scale\r\n * @param b - amount to scale the matrix's elements by\r\n * @returns `out`\r\n */\r\n static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n out[8] = a[8] * b;\r\n out[9] = a[9] * b;\r\n out[10] = a[10] * b;\r\n out[11] = a[11] * b;\r\n out[12] = a[12] * b;\r\n out[13] = a[13] * b;\r\n out[14] = a[14] * b;\r\n out[15] = a[15] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b's elements by before adding\r\n * @returns `out`\r\n */\r\n static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n out[4] = a[4] + b[4] * scale;\r\n out[5] = a[5] + b[5] * scale;\r\n out[6] = a[6] + b[6] * scale;\r\n out[7] = a[7] + b[7] * scale;\r\n out[8] = a[8] + b[8] * scale;\r\n out[9] = a[9] + b[9] * scale;\r\n out[10] = a[10] + b[10] * scale;\r\n out[11] = a[11] + b[11] * scale;\r\n out[12] = a[12] + b[12] * scale;\r\n out[13] = a[13] + b[13] * scale;\r\n out[14] = a[14] + b[14] * scale;\r\n out[15] = a[15] + b[15] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7] &&\r\n a[8] === b[8] &&\r\n a[9] === b[9] &&\r\n a[10] === b[10] &&\r\n a[11] === b[11] &&\r\n a[12] === b[12] &&\r\n a[13] === b[13] &&\r\n a[14] === b[14] &&\r\n a[15] === b[15]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first matrix.\r\n * @param b - The second matrix.\r\n * @returns True if the matrices are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const a8 = a[8];\r\n const a9 = a[9];\r\n const a10 = a[10];\r\n const a11 = a[11];\r\n const a12 = a[12];\r\n const a13 = a[13];\r\n const a14 = a[14];\r\n const a15 = a[15];\r\n\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n const b8 = b[8];\r\n const b9 = b[9];\r\n const b10 = b[10];\r\n const b11 = b[11];\r\n const b12 = b[12];\r\n const b13 = b[13];\r\n const b14 = b[14];\r\n const b15 = b[15];\r\n\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) &&\r\n Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) &&\r\n Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) &&\r\n Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) &&\r\n Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) &&\r\n Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) &&\r\n Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) &&\r\n Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) &&\r\n Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Mat4}\r\n * @category Static\r\n *\r\n * @param a - matrix to represent as a string\r\n * @returns string representation of the matrix\r\n */\r\n static str(a: Readonly): string {\r\n return `Mat4(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nMat4.prototype.mul = Mat4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nMat4.sub = Mat4.subtract;\r\nMat4.mul = Mat4.multiply;\r\nMat4.frustum = Mat4.frustumNO;\r\nMat4.perspective = Mat4.perspectiveNO;\r\nMat4.ortho = Mat4.orthoNO;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, Mat4Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 3 Dimensional Vector\r\n */\r\nexport class Vec3 extends Float64Array {\r\n /**\r\n * Create a {@link Vec3}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 3:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 3); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 3);\r\n }\r\n break;\r\n }\r\n default:\r\n super(3); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec3.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec3.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec3.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec3.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec3} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec3} to `this`.\r\n * Equivalent to `Vec3.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec3} from `this`.\r\n * Equivalent to `Vec3.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec3}.\r\n * Equivalent to `Vec3.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec3.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec3.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\r\n * Equivalent to `Vec3.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec3.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec3.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec3.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to its absolute value.\r\n * Equivalent to `Vec3.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec3}.\r\n * Equivalent to `Vec3.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec3.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec3.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec3}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 3 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty vec3\r\n * @category Static\r\n *\r\n * @returns a new 3D vector\r\n */\r\n static create(): Vec3 {\r\n return new Vec3();\r\n }\r\n\r\n /**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 3D vector\r\n */\r\n static clone(a: Readonly): Vec3 {\r\n return new Vec3(a);\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n /**\r\n * Alias for {@link Vec3.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec3.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Creates a new vec3 initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns a new 3D vector\r\n */\r\n static fromValues(x: number, y: number, z: number): Vec3 {\r\n return new Vec3(x, y, z);\r\n }\r\n\r\n /**\r\n * Copy the values from one vec3 to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @returns `out`\r\n */\r\n static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec3}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Multiplies two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; }\r\n\r\n /**\r\n * Divides two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like { return [0, 0, 0]; };\r\n\r\n /**\r\n * Math.ceil the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * symmetric round the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n /*\r\n static round(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = glMatrix.round(a[0]);\r\n out[1] = glMatrix.round(a[1]);\r\n out[2] = glMatrix.round(a[2]);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Scales a vec3 by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number) {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /**\r\n * Alias for {@link Vec3.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared length of a vec3\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec3.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec3}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec3Like, a: Readonly): Vec3Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a vec3\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec3Like, a: Readonly): Vec3Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n let len = x * x + y * y + z * z;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n out[2] = a[2] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two vec3's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like {\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2];\r\n const bx = b[0],\r\n by = b[1],\r\n bz = b[2];\r\n\r\n out[0] = ay * bz - az * by;\r\n out[1] = az * bx - ax * bz;\r\n out[2] = ax * by - ay * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two vec3's\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like {\r\n const angle = Math.acos(Math.min(Math.max(Vec3.dot(a, b), -1), 1));\r\n const sinTotal = Math.sin(angle);\r\n\r\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\r\n const ratioB = Math.sin(t * angle) / sinTotal;\r\n out[0] = ratioA * a[0] + ratioB * b[0];\r\n out[1] = ratioA * a[1] + ratioB * b[1];\r\n out[2] = ratioA * a[2] + ratioB * b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a hermite interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static hermite(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const factorTimes2 = t * t;\r\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\r\n const factor2 = factorTimes2 * (t - 2) + t;\r\n const factor3 = factorTimes2 * (t - 1);\r\n const factor4 = factorTimes2 * (3 - 2 * t);\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a bezier interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static bezier(out: Vec3Like, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): Vec3Like {\r\n const inverseFactor = 1 - t;\r\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\r\n const factorTimes2 = t * t;\r\n const factor1 = inverseFactorTimesTwo * inverseFactor;\r\n const factor2 = 3 * t * inverseFactorTimesTwo;\r\n const factor3 = 3 * factorTimes2 * inverseFactor;\r\n const factor4 = factorTimes2 * t;\r\n\r\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\r\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\r\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec3Like, scale) {\r\n scale = scale === undefined ? 1.0 : scale;\r\n\r\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\r\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\r\n let zScale = Math.sqrt(1.0 - z * z) * scale;\r\n\r\n out[0] = Math.cos(r) * zScale;\r\n out[1] = Math.sin(r) * zScale;\r\n out[2] = z * scale;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1.0;\r\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\r\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\r\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a mat3.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - the 3x3 matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n out[0] = x * m[0] + y * m[3] + z * m[6];\r\n out[1] = x * m[1] + y * m[4] + z * m[7];\r\n out[2] = x * m[2] + y * m[5] + z * m[8];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like {\r\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const w2 = q[3] * 2;\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n // var qvec = [qx, qy, qz];\r\n // var uv = vec3.cross([], qvec, a);\r\n const uvx = (qy * z - qz * y);\r\n const uvy = (qz * x - qx * z);\r\n const uvz = (qx * y - qy * x);\r\n // var uuv = vec3.cross([], qvec, uv);\r\n // vec3.scale(uuv, uuv, 2);\r\n const uuvx = (qy * uvz - qz * uvy) * 2;\r\n const uuvy = (qz * uvx - qx * uvz) * 2;\r\n const uuvz = (qx * uvy - qy * uvx) * 2;\r\n // vec3.scale(uv, uv, 2 * w);\r\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\r\n out[0] = x + (uvx * w2) + uuvx;\r\n out[1] = y + (uvy * w2) + uuvy;\r\n out[2] = z + (uvz * w2) + uuvz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the x-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const by = b[1];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const py = a[1] - by;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = a[0];\r\n out[1] = (py * Math.cos(rad) - pz * Math.sin(rad)) + by;\r\n out[2] = (py * Math.sin(rad) + pz * Math.cos(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the y-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const bz = b[2];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const pz = a[2] - bz;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (pz * Math.sin(rad) + px * Math.cos(rad)) + bx;\r\n out[1] = a[1];\r\n out[2] = (pz * Math.cos(rad) - px * Math.sin(rad)) + bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 3D vector around the z-axis\r\n * @category Static\r\n *\r\n * @param out - The receiving vec3\r\n * @param a - The vec3 point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like {\r\n const bx = b[0];\r\n const by = b[1];\r\n\r\n // Translate point to the origin\r\n const px = a[0] - bx;\r\n const py = a[1] - by;\r\n\r\n // perform rotation\r\n // translate to correct position\r\n out[0] = (px * Math.cos(rad) - py * Math.sin(rad)) + bx;\r\n out[1] = (px * Math.sin(rad) + py * Math.cos(rad)) + by;\r\n out[2] = b[2];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 3D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly) {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\r\n const cosine = mag && Vec3.dot(a, b) / mag;\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a vec3 to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec3Like): Vec3Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec3(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec3.prototype.sub = Vec3.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.mul = Vec3.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.div = Vec3.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.dist = Vec3.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec3.sub = Vec3.subtract;\r\nVec3.mul = Vec3.multiply;\r\nVec3.div = Vec3.divide;\r\nVec3.dist = Vec3.distance;\r\nVec3.sqrDist = Vec3.squaredDistance;\r\nVec3.sqrLen = Vec3.squaredLength;\r\nVec3.mag = Vec3.magnitude;\r\nVec3.length = Vec3.magnitude;\r\nVec3.len = Vec3.magnitude;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Vec4Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 4 Dimensional Vector\r\n */\r\nexport class Vec4 extends Float64Array {\r\n /**\r\n * Create a {@link Vec4}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the vector. Equivalent to `this[2];`\r\n * @category Vector Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the vector. Equivalent to `this[3];`\r\n * @category Vector Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The b component of the vector. Equivalent to `this[2];`\r\n * @category Color Components\r\n */\r\n get b(): number { return this[2]; }\r\n set b(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The a component of the vector. Equivalent to `this[3];`\r\n * @category Color Components\r\n */\r\n get a(): number { return this[3]; }\r\n set a(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec4.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec4.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec4.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec4} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a {@link Vec4} to `this`.\r\n * Equivalent to `Vec4.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n this[2] += b[2];\r\n this[3] += b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec4} from `this`.\r\n * Equivalent to `Vec4.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n this[2] -= b[2];\r\n this[3] -= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n this[2] *= b[2];\r\n this[3] *= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec4}.\r\n * Equivalent to `Vec4.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n this[2] /= b[2];\r\n this[3] /= b[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec4.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n this[2] *= b;\r\n this[3] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n this[2] += b[2] * scale;\r\n this[3] += b[3] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec4.distance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\r\n * Equivalent to `Vec4.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec4.squaredDistance(this, b);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec4.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n this[2] *= -1;\r\n this[3] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec4.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n this[2] = 1.0 / this[2];\r\n this[3] = 1.0 / this[3];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec4.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n this[2] = Math.abs(this[2]);\r\n this[3] = Math.abs(this[3]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec4}.\r\n * Equivalent to `Vec4.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec4.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec4.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec4}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec4}\r\n * @category Static\r\n *\r\n * @returns a new 4D vector\r\n */\r\n static create(): Vec4 {\r\n return new Vec4();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - vector to clone\r\n * @returns a new 4D vector\r\n */\r\n static clone(a: Vec4Like): Vec4 {\r\n return new Vec4(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec4} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new 4D vector\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Vec4 {\r\n return new Vec4(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec4} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like {\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n out[2] = a[2] - b[2];\r\n out[3] = a[3] - b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Multiplies two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n out[2] = a[2] * b[2];\r\n out[3] = a[3] * b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Divides two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n out[2] = a[2] / b[2];\r\n out[3] = a[3] / b[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like { return out; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n out[2] = Math.ceil(a[2]);\r\n out[3] = Math.ceil(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n out[2] = Math.floor(a[2]);\r\n out[3] = Math.floor(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n out[2] = Math.min(a[2], b[2]);\r\n out[3] = Math.min(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n out[2] = Math.max(a[2], b[2]);\r\n out[3] = Math.max(a[3], b[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n out[2] = Math.round(a[2]);\r\n out[3] = Math.round(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec4} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param scale - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param scale - the amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n out[2] = a[2] + b[2] * scale;\r\n out[3] = a[3] + b[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns distance between a and b\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return Math.hypot(x, y, z, w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns squared distance between a and b\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n const z = b[2] - a[2];\r\n const w = b[3] - a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Alias for {@link Vec4.squaredDistance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of `a`\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec4.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec4.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec4.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = -a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n out[2] = 1.0 / a[2];\r\n out[3] = 1.0 / a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec4Like, a: Readonly): Vec4Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n out[2] = Math.abs(a[2]);\r\n out[3] = Math.abs(a[3]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec4Like, a: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n let len = x * x + y * y + z * z + w * w;\r\n if (len > 0) {\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = x * len;\r\n out[1] = y * len;\r\n out[2] = z * len;\r\n out[3] = w * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n * @category Static\r\n *\r\n * @param out the receiving vector\r\n * @param u - the first vector\r\n * @param v - the second vector\r\n * @param w - the third vector\r\n * @returns result\r\n */\r\n static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like {\r\n const a = v[0] * w[1] - v[1] * w[0];\r\n const b = v[0] * w[2] - v[2] * w[0];\r\n const c = v[0] * w[3] - v[3] * w[0];\r\n const d = v[1] * w[2] - v[2] * w[1];\r\n const e = v[1] * w[3] - v[3] * w[1];\r\n const f = v[2] * w[3] - v[3] * w[2];\r\n const g = u[0];\r\n const h = u[1];\r\n const i = u[2];\r\n const j = u[3];\r\n\r\n out[0] = h * f - i * e + j * d;\r\n out[1] = -(g * f) + i * c - j * b;\r\n out[2] = g * e - h * c + j * a;\r\n out[3] = -(g * d) + h * b - i * a;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec4}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n out[2] = az + t * (b[2] - az);\r\n out[3] = aw + t * (b[3] - aw);\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random vector with the given scale\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns `out`\r\n */\r\n /*\r\n static random(out: Vec4Like, scale): Vec4Like {\r\n scale = scale || 1.0;\r\n\r\n // Marsaglia, George. Choosing a Point from the Surface of a\r\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\r\n // http://projecteuclid.org/euclid.aoms/1177692644;\r\n var v1, v2, v3, v4;\r\n var s1, s2;\r\n do {\r\n v1 = glMatrix.RANDOM() * 2 - 1;\r\n v2 = glMatrix.RANDOM() * 2 - 1;\r\n s1 = v1 * v1 + v2 * v2;\r\n } while (s1 >= 1);\r\n do {\r\n v3 = glMatrix.RANDOM() * 2 - 1;\r\n v4 = glMatrix.RANDOM() * 2 - 1;\r\n s2 = v3 * v3 + v4 * v4;\r\n } while (s2 >= 1);\r\n\r\n var d = Math.sqrt((1 - s1) / s2);\r\n out[0] = scale * v1;\r\n out[1] = scale * v2;\r\n out[2] = scale * v3 * d;\r\n out[3] = scale * v4 * d;\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Mat4}.\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param m - matrix to transform with\r\n * @returns `out`\r\n */\r\n static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const w = a[3];\r\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec4} with a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to transform\r\n * @param q - quaternion to transform with\r\n * @returns `out`\r\n */\r\n static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like {\r\n const x = a[0];\r\n const y = a[1];\r\n const z = a[2];\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n\r\n // calculate quat * vec\r\n const ix = qw * x + qy * z - qz * y;\r\n const iy = qw * y + qz * x - qx * z;\r\n const iz = qw * z + qx * y - qy * x;\r\n const iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec4} to zero\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec4Like): Vec4Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n out[2] = 0.0;\r\n out[3] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Vec4}\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec4(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3))\r\n );\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec4.prototype.sub = Vec4.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.mul = Vec4.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.div = Vec4.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.dist = Vec4.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec4.sub = Vec4.subtract;\r\nVec4.mul = Vec4.multiply;\r\nVec4.div = Vec4.divide;\r\nVec4.dist = Vec4.distance;\r\nVec4.sqrDist = Vec4.squaredDistance;\r\nVec4.sqrLen = Vec4.squaredLength;\r\nVec4.mag = Vec4.magnitude;\r\nVec4.length = Vec4.magnitude;\r\nVec4.len = Vec4.magnitude;\r\n", "import { Vec3 } from './Vec3.js';\r\nimport { Vec4 } from './Vec4.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat3Like, QuatLike, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Quaternion\r\n */\r\nexport class Quat extends Float64Array {\r\n static #DEFAULT_ANGLE_ORDER = 'zyx';\r\n\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT1 = new Float64Array(4);\r\n static #TMP_QUAT2 = new Float64Array(4);\r\n static #TMP_MAT3 = new Float64Array(9);\r\n\r\n static #TMP_VEC3 = new Float64Array(3);\r\n static #X_UNIT_VEC3 = new Float64Array([1, 0, 0]);\r\n static #Y_UNIT_VEC3 = new Float64Array([0, 1, 0]);\r\n\r\n /**\r\n * Create a {@link Quat}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 4:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 4); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 4);\r\n }\r\n break;\r\n }\r\n default:\r\n super(4);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the quaternion. Equivalent to `this[0];`\r\n * @category Quaternion Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the quaternion. Equivalent to `this[1];`\r\n * @category Quaternion Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The z component of the quaternion. Equivalent to `this[2];`\r\n * @category Quaternion Components\r\n */\r\n get z(): number { return this[2]; }\r\n set z(value: number) { this[2] = value; }\r\n\r\n /**\r\n * The w component of the quaternion. Equivalent to `this[3];`\r\n * @category Quaternion Components\r\n */\r\n get w(): number { return this[3]; }\r\n set w(value: number) { this[3] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Quat.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n const z = this[2];\r\n const w = this[3];\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n /**\r\n * Set `this` to the identity quaternion\r\n * Equivalent to Quat.identity(this)\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n identity(): this {\r\n this[0] = 0;\r\n this[1] = 0;\r\n this[2] = 0;\r\n this[3] = 1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies `this` by a {@link Quat}.\r\n * Equivalent to `Quat.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n return Quat.multiply(this, this, b) as this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Rotates `this` by the given angle about the X axis\r\n * Equivalent to `Quat.rotateX(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateX(rad: number): this {\r\n return Quat.rotateX(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Y axis\r\n * Equivalent to `Quat.rotateY(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateY(rad: number): this {\r\n return Quat.rotateY(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Rotates `this` by the given angle about the Z axis\r\n * Equivalent to `Quat.rotateZ(this, this, rad);`\r\n * @category Methods\r\n *\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `this`\r\n */\r\n rotateZ(rad: number): this {\r\n return Quat.rotateZ(this, this, rad) as this;\r\n }\r\n\r\n /**\r\n * Inverts `this`\r\n * Equivalent to `Quat.invert(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n return Quat.invert(this, this) as this;\r\n }\r\n\r\n /**\r\n * Scales `this` by a scalar number\r\n * Equivalent to `Quat.scale(this, this, scale);`\r\n * @category Methods\r\n *\r\n * @param scale - amount to scale the vector by\r\n * @returns `this`\r\n */\r\n scale(scale: number): QuatLike {\r\n this[0] *= scale;\r\n this[1] *= scale;\r\n this[2] *= scale;\r\n this[3] *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of `this` and another {@link Quat}\r\n * Equivalent to `Quat.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - the second operand\r\n * @returns dot product of `this` and b\r\n */\r\n dot(b: Readonly): number {\r\n return Quat.dot(this, b);\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 4 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity quat\r\n * @category Static\r\n *\r\n * @returns a new quaternion\r\n */\r\n static create(): Quat {\r\n return new Quat();\r\n }\r\n\r\n /**\r\n * Set a quat to the identity quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param axis - the axis around which to rotate\r\n * @param rad - the angle in radians\r\n * @returns `out`\r\n **/\r\n static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n out[0] = s * axis[0];\r\n out[1] = s * axis[1];\r\n out[2] = s * axis[2];\r\n out[3] = Math.cos(rad);\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as provided in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @category Static\r\n *\r\n * @param out_axis - Vector receiving the axis of rotation\r\n * @param q - Quaternion to be decomposed\r\n * @return Angle, in radians, of the rotation\r\n */\r\n static getAxisAngle(out_axis: Vec3Like, q: Readonly): number {\r\n const rad = Math.acos(q[3]) * 2.0;\r\n const s = Math.sin(rad / 2.0);\r\n if (s > GLM_EPSILON) {\r\n out_axis[0] = q[0] / s;\r\n out_axis[1] = q[1] / s;\r\n out_axis[2] = q[2] / s;\r\n } else {\r\n // If s is zero, return any axis (no rotation - axis does not matter)\r\n out_axis[0] = 1;\r\n out_axis[1] = 0;\r\n out_axis[2] = 0;\r\n }\r\n return rad;\r\n }\r\n\r\n /**\r\n * Gets the angular distance between two unit quaternions\r\n * @category Static\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\r\n static getAngle(a: Readonly, b: Readonly): number {\r\n const dotproduct = Quat.dot(a, b);\r\n\r\n return Math.acos(2 * dotproduct * dotproduct - 1);\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = b[0];\r\n const by = b[1];\r\n const bz = b[2];\r\n const bw = b[3];\r\n\r\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the X axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bx = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + aw * bx;\r\n out[1] = ay * bw + az * bx;\r\n out[2] = az * bw - ay * bx;\r\n out[3] = aw * bw - ax * bx;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const by = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw - az * by;\r\n out[1] = ay * bw + aw * by;\r\n out[2] = az * bw + ax * by;\r\n out[3] = aw * bw - ay * by;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n * @category Static\r\n *\r\n * @param out - quat receiving operation result\r\n * @param a - quat to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike {\r\n rad *= 0.5;\r\n\r\n const ax = a[0];\r\n const ay = a[1];\r\n const az = a[2];\r\n const aw = a[3];\r\n const bz = Math.sin(rad);\r\n const bw = Math.cos(rad);\r\n\r\n out[0] = ax * bw + ay * bz;\r\n out[1] = ay * bw - ax * bz;\r\n out[2] = az * bw + aw * bz;\r\n out[3] = aw * bw - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate W component of\r\n * @returns `out`\r\n */\r\n static calculateW(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2];\r\n\r\n out[0] = x;\r\n out[1] = y;\r\n out[2] = z;\r\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the exponential of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static exp(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const et = Math.exp(w);\r\n const s = r > 0 ? (et * Math.sin(r)) / r : 0;\r\n\r\n out[0] = x * s;\r\n out[1] = y * s;\r\n out[2] = z * s;\r\n out[3] = et * Math.cos(r);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @returns `out`\r\n */\r\n static ln(out: QuatLike, a: Readonly): QuatLike {\r\n const x = a[0],\r\n y = a[1],\r\n z = a[2],\r\n w = a[3];\r\n\r\n const r = Math.sqrt(x * x + y * y + z * z);\r\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\r\n\r\n out[0] = x * t;\r\n out[1] = y * t;\r\n out[2] = z * t;\r\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculate the scalar power of a unit quaternion.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate the exponential of\r\n * @param b - amount to scale the quaternion by\r\n * @returns `out`\r\n */\r\n static pow(out: QuatLike, a: Readonly, b: number): QuatLike {\r\n Quat.ln(out, a);\r\n Quat.scale(out, out, b);\r\n Quat.exp(out, out);\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation between two quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike {\r\n // benchmarks:\r\n // http://jsperf.com/quaternion-slerp-implementations\r\n const ax = a[0],\r\n ay = a[1],\r\n az = a[2],\r\n aw = a[3];\r\n let bx = b[0],\r\n by = b[1],\r\n bz = b[2],\r\n bw = b[3];\r\n\r\n let scale0: number;\r\n let scale1: number;\r\n\r\n // calc cosine\r\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n // adjust signs (if necessary)\r\n if (cosom < 0.0) {\r\n cosom = -cosom;\r\n bx = -bx;\r\n by = -by;\r\n bz = -bz;\r\n bw = -bw;\r\n }\r\n // calculate coefficients\r\n if (1.0 - cosom > GLM_EPSILON) {\r\n // standard case (slerp)\r\n const omega = Math.acos(cosom);\r\n const sinom = Math.sin(omega);\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n } else {\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n scale0 = 1.0 - t;\r\n scale1 = t;\r\n }\r\n // calculate final values\r\n out[0] = scale0 * ax + scale1 * bx;\r\n out[1] = scale0 * ay + scale1 * by;\r\n out[2] = scale0 * az + scale1 * bz;\r\n out[3] = scale0 * aw + scale1 * bw;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Generates a random unit quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @returns `out`\r\n */\r\n /* static random(out: QuatLike): QuatLike {\r\n // Implementation of http://planning.cs.uiuc.edu/node198.html\r\n // TODO: Calling random 3 times is probably not the fastest solution\r\n let u1 = glMatrix.RANDOM();\r\n let u2 = glMatrix.RANDOM();\r\n let u3 = glMatrix.RANDOM();\r\n\r\n let sqrt1MinusU1 = Math.sqrt(1 - u1);\r\n let sqrtU1 = Math.sqrt(u1);\r\n\r\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\r\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\r\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\r\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\r\n return out;\r\n }*/\r\n\r\n /**\r\n * Calculates the inverse of a quat\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: QuatLike, a: Readonly): QuatLike {\r\n const a0 = a[0],\r\n a1 = a[1],\r\n a2 = a[2],\r\n a3 = a[3];\r\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n const invDot = dot ? 1.0 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n out[0] = -a0 * invDot;\r\n out[1] = -a1 * invDot;\r\n out[2] = -a2 * invDot;\r\n out[3] = a3 * invDot;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quat to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to re-normalize the quaternion yourself where necessary.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param m - rotation matrix\r\n * @returns `out`\r\n */\r\n static fromMat3(out: QuatLike, m: Readonly): QuatLike {\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n const fTrace = m[0] + m[4] + m[8];\r\n let fRoot: number;\r\n\r\n if (fTrace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n out[3] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n out[0] = (m[5] - m[7]) * fRoot;\r\n out[1] = (m[6] - m[2]) * fRoot;\r\n out[2] = (m[1] - m[3]) * fRoot;\r\n } else {\r\n // |w| <= 1/2\r\n let i = 0;\r\n if (m[4] > m[0]) { i = 1; }\r\n if (m[8] > m[i * 3 + i]) { i = 2; }\r\n const j = (i + 1) % 3;\r\n const k = (i + 2) % 3;\r\n\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\r\n out[i] = 0.5 * fRoot;\r\n fRoot = 0.5 / fRoot;\r\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\r\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - Angle to rotate around X axis in degrees.\r\n * @param y - Angle to rotate around Y axis in degrees.\r\n * @param z - Angle to rotate around Z axis in degrees.\r\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\r\n * @returns `out`\r\n */\r\n static fromEuler(out: QuatLike, x: number, y: number, z: number, order = Quat.#DEFAULT_ANGLE_ORDER): QuatLike {\r\n const halfToRad = (0.5 * Math.PI) / 180.0;\r\n x *= halfToRad;\r\n y *= halfToRad;\r\n z *= halfToRad;\r\n\r\n const sx = Math.sin(x);\r\n const cx = Math.cos(x);\r\n const sy = Math.sin(y);\r\n const cy = Math.cos(y);\r\n const sz = Math.sin(z);\r\n const cz = Math.cos(z);\r\n\r\n switch (order) {\r\n case 'xyz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'xzy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yxz':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz - sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n case 'yzx':\r\n out[0] = sx * cy * cz + cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zxy':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz + sx * sy * cz;\r\n out[3] = cx * cy * cz - sx * sy * sz;\r\n break;\r\n\r\n case 'zyx':\r\n out[0] = sx * cy * cz - cx * sy * sz;\r\n out[1] = cx * sy * cz + sx * cy * sz;\r\n out[2] = cx * cy * sz - sx * sy * cz;\r\n out[3] = cx * cy * cz + sx * sy * sz;\r\n break;\r\n\r\n default:\r\n throw new Error(`Unknown angle order ${order}`);\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a quatenion\r\n * @category Static\r\n *\r\n * @param a - vector to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - quaternion to clone\r\n * @returns a new quaternion\r\n */\r\n static clone(a: Readonly): Quat {\r\n return new Quat(a);\r\n }\r\n\r\n /**\r\n * Creates a new quat initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns a new quaternion\r\n */\r\n static fromValues(x: number, y: number, z: number, w: number): Quat {\r\n return new Quat(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copy the values from one quat to another\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the source quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param x - X component\r\n * @param y - Y component\r\n * @param z - Z component\r\n * @param w - W component\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike { return out; }\r\n\r\n /**\r\n * Adds two {@link Quat}'s\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Alias for {@link Quat.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Scales a quat by a scalar number\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - the vector to scale\r\n * @param b - amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: QuatLike, a: Readonly, scale: number): QuatLike {\r\n out[0] = a[0] * scale;\r\n out[1] = a[1] * scale;\r\n out[2] = a[2] * scale;\r\n out[3] = a[3] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two quat's\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two quat's\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike { return out; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mag(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat}\r\n * @category Static\r\n *\r\n * @param a - quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat}\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - quaternion to normalize\r\n * @returns `out`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static normalize(out: QuatLike, a: Readonly): QuatLike { return out; }\r\n\r\n /**\r\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first quaternion.\r\n * @param b - The second quaternion.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static exactEquals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Returns whether the quaternions have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns True if the vectors are equal, false otherwise.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static equals(a: Readonly, b: Readonly): boolean { return false; }\r\n\r\n /**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion.\r\n * @param a - the initial vector\r\n * @param b - the destination vector\r\n * @returns `out`\r\n */\r\n static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike {\r\n const dot = Vec3.dot(a, b);\r\n\r\n if (dot < -0.999999) {\r\n Vec3.cross(Quat.#TMP_VEC3, Quat.#X_UNIT_VEC3, a);\r\n if (Vec3.mag(Quat.#TMP_VEC3) < 0.000001) { Vec3.cross(Quat.#TMP_VEC3, Quat.#Y_UNIT_VEC3, a); }\r\n Vec3.normalize(Quat.#TMP_VEC3, Quat.#TMP_VEC3);\r\n Quat.setAxisAngle(out, Quat.#TMP_VEC3, Math.PI);\r\n return out;\r\n } else if (dot > 0.999999) {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n return out;\r\n } else {\r\n Vec3.cross(Quat.#TMP_VEC3, a, b);\r\n out[0] = Quat.#TMP_VEC3[0];\r\n out[1] = Quat.#TMP_VEC3[1];\r\n out[2] = Quat.#TMP_VEC3[2];\r\n out[3] = 1 + dot;\r\n return Quat.normalize(out, out);\r\n }\r\n }\r\n\r\n /**\r\n * Performs a spherical linear interpolation with two control points\r\n * @category Static\r\n *\r\n * @param out - the receiving quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param c - the third operand\r\n * @param d - the fourth operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static sqlerp(out: QuatLike, a: Readonly, b: Readonly, c: Readonly,\r\n d: Readonly, t: number): QuatLike {\r\n Quat.slerp(Quat.#TMP_QUAT1, a, d, t);\r\n Quat.slerp(Quat.#TMP_QUAT2, b, c, t);\r\n Quat.slerp(out, Quat.#TMP_QUAT1, Quat.#TMP_QUAT2, 2 * t * (1 - t));\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n * @category Static\r\n *\r\n * @param out - The receiving quaternion\r\n * @param view - the vector representing the viewing direction\r\n * @param right - the vector representing the local `right` direction\r\n * @param up - the vector representing the local `up` direction\r\n * @returns `out`\r\n */\r\n static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike {\r\n Quat.#TMP_MAT3[0] = right[0];\r\n Quat.#TMP_MAT3[3] = right[1];\r\n Quat.#TMP_MAT3[6] = right[2];\r\n\r\n Quat.#TMP_MAT3[1] = up[0];\r\n Quat.#TMP_MAT3[4] = up[1];\r\n Quat.#TMP_MAT3[7] = up[2];\r\n\r\n Quat.#TMP_MAT3[2] = -view[0];\r\n Quat.#TMP_MAT3[5] = -view[1];\r\n Quat.#TMP_MAT3[8] = -view[2];\r\n\r\n return Quat.normalize(out, Quat.fromMat3(out, Quat.#TMP_MAT3));\r\n }\r\n}\r\n\r\n// Methods which re-use the Vec4 implementation\r\nQuat.set = Vec4.set;\r\nQuat.add = Vec4.add;\r\nQuat.lerp = Vec4.lerp;\r\nQuat.normalize = Vec4.normalize;\r\nQuat.squaredLength = Vec4.squaredLength;\r\nQuat.sqrLen = Vec4.squaredLength;\r\nQuat.exactEquals = Vec4.exactEquals;\r\nQuat.equals = Vec4.equals;\r\nQuat.magnitude = Vec4.magnitude;\r\n\r\n// Instance method alias assignments\r\nQuat.prototype.mul = Quat.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nQuat.mul = Quat.multiply;\r\nQuat.mag = Quat.magnitude;\r\nQuat.length = Quat.magnitude;\r\nQuat.len = Quat.magnitude;\r\n", "import { Mat4 } from './Mat4.js';\r\nimport { Quat } from './Quat.js';\r\nimport { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat4Like, QuatLike, Quat2Like, Vec3Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * Dual Quaternion\r\n */\r\nexport class Quat2 extends Float64Array {\r\n // Temporary variables to prevent repeated allocations in the algorithms within Quat2.\r\n // These are declared as TypedArrays to aid in tree-shaking.\r\n\r\n static #TMP_QUAT = new Float64Array(4);\r\n static #TMP_VEC3 = new Float64Array(3);\r\n\r\n /**\r\n * Create a {@link Quat2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 8:\r\n super(values); break;\r\n case 2:\r\n super(values[0] as ArrayBufferLike, values[1], 8); break;\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v, v, v, v, v, v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 8);\r\n }\r\n break;\r\n }\r\n default:\r\n super(8);\r\n this[3] = 1;\r\n break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Quat2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Quat2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Quat2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source dual quaternion\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n super.set(a);\r\n return this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Quat2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 8 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new identity {@link Quat2}\r\n * @category Static\r\n *\r\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\r\n */\r\n static create(): Quat2 {\r\n return new Quat2();\r\n }\r\n\r\n /**\r\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to clone\r\n * @returns a new dual quaternion\r\n */\r\n static clone(a: Quat2Like): Quat2 {\r\n return new Quat2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns a new dual quaternion\r\n */\r\n static fromValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2 {\r\n return new Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Quat2} from the given values (quat and translation)\r\n * @category Static\r\n *\r\n * @param x1 - X component (rotation)\r\n * @param y1 - Y component (rotation)\r\n * @param z1 - Z component (rotation)\r\n * @param w1 - W component (rotation)\r\n * @param x2 - X component (translation)\r\n * @param y2 - Y component (translation)\r\n * @param z2 - Z component (translation)\r\n * @returns a new dual quaternion\r\n */\r\n static fromRotationTranslationValues(x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number): Quat2 {\r\n const ax = x2 * 0.5;\r\n const ay = y2 * 0.5;\r\n const az = z2 * 0.5;\r\n\r\n return new Quat2(x1, y1, z1, w1,\r\n ax * w1 + ay * z1 - az * y1,\r\n ay * w1 + az * x1 - ax * z1,\r\n az * w1 + ax * y1 - ay * x1,\r\n -ax * x1 - ay * y1 - az * z1);\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion and a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like {\r\n const ax = t[0] * 0.5;\r\n const ay = t[1] * 0.5;\r\n const az = t[2] * 0.5;\r\n const bx = q[0];\r\n const by = q[1];\r\n const bz = q[2];\r\n const bw = q[3];\r\n out[0] = bx;\r\n out[1] = by;\r\n out[2] = bz;\r\n out[3] = bw;\r\n out[4] = ax * bw + ay * bz - az * by;\r\n out[5] = ay * bw + az * bx - ax * bz;\r\n out[6] = az * bw + ax * by - ay * bx;\r\n out[7] = -ax * bx - ay * by - az * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a translation\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param t - translation vector\r\n * @returns `out`\r\n */\r\n static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = t[0] * 0.5;\r\n out[5] = t[1] * 0.5;\r\n out[6] = t[2] * 0.5;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param q - a normalized quaternion\r\n * @returns `out`\r\n */\r\n static fromRotation(out: Quat2Like, q: Readonly): Quat2Like {\r\n out[0] = q[0];\r\n out[1] = q[1];\r\n out[2] = q[2];\r\n out[3] = q[3];\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Sets a {@link Quat2} from a quaternion\r\n * @category Static\r\n *\r\n * @param out - dual quaternion receiving operation result\r\n * @param a - the matrix\r\n * @returns `out`\r\n */\r\n static fromMat4(out: Quat2Like, a: Readonly): Quat2Like {\r\n Mat4.getRotation(Quat2.#TMP_QUAT, a);\r\n Mat4.getTranslation(Quat2.#TMP_VEC3, a);\r\n return Quat2.fromRotationTranslation(out, Quat2.#TMP_QUAT, Quat2.#TMP_VEC3);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Quat2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the source dual quaternion\r\n * @returns `out`\r\n */\r\n static copy(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set a {@link Quat2} to the identity dual quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @returns `out`\r\n */\r\n static identity(out: QuatLike): QuatLike {\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 1;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Quat2} to the given values\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param x1 - 1st X component\r\n * @param y1 - 1st Y component\r\n * @param z1 - 1st Z component\r\n * @param w1 - 1st W component\r\n * @param x2 - 2nd X component\r\n * @param y2 - 2nd Y component\r\n * @param z2 - 2nd Z component\r\n * @param w2 - 2nd W component\r\n * @returns `out`\r\n */\r\n static set(out: Quat2Like, x1: number, y1: number, z1: number, w1: number,\r\n x2: number, y2: number, z2: number, w2: number): Quat2Like {\r\n out[0] = x1;\r\n out[1] = y1;\r\n out[2] = z1;\r\n out[3] = w1;\r\n out[4] = x2;\r\n out[5] = y2;\r\n out[6] = z2;\r\n out[7] = w2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the real part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - real part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getReal(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Gets the dual part of a dual quat\r\n * @category Static\r\n *\r\n * @param out - dual part\r\n * @param a - Dual Quaternion\r\n * @return `out`\r\n */\r\n static getDual(out: QuatLike, a: Readonly): QuatLike {\r\n out[0] = a[4];\r\n out[1] = a[5];\r\n out[2] = a[6];\r\n out[3] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the real component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the real part\r\n * @return `out`\r\n */\r\n static setReal(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n return out;\r\n };\r\n\r\n /**\r\n * Set the dual component of a {@link Quat2} to the given quaternion\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - a quaternion representing the dual part\r\n * @return `out`\r\n */\r\n static setDual(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[4] = a[0];\r\n out[5] = a[1];\r\n out[6] = a[2];\r\n out[7] = a[3];\r\n return out;\r\n }\r\n\r\n /**\r\n * Gets the translation of a normalized {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving translation vector\r\n * @param a - Dual Quaternion to be decomposed\r\n * @return `out`\r\n */\r\n static getTranslation(out: Vec3Like, a: Readonly): Vec3Like {\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const bx = -a[0];\r\n const by = -a[1];\r\n const bz = -a[2];\r\n const bw = a[3];\r\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\r\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\r\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Translates a {@link Quat2} by the given vector\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to translate\r\n * @param v - vector to translate by\r\n * @returns `out`\r\n */\r\n static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like {\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n const bx1 = v[0] * 0.5;\r\n const by1 = v[1] * 0.5;\r\n const bz1 = v[2] * 0.5;\r\n const ax2 = a[4];\r\n const ay2 = a[5];\r\n const az2 = a[6];\r\n const aw2 = a[7];\r\n out[0] = ax1;\r\n out[1] = ay1;\r\n out[2] = az1;\r\n out[3] = aw1;\r\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\r\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\r\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\r\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the X axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateX(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Y axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateY(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around the Z axis\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param rad - angle (in radians) to rotate\r\n * @returns `out`\r\n */\r\n static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like {\r\n let bx = -a[0];\r\n let by = -a[1];\r\n let bz = -a[2];\r\n let bw = a[3];\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\r\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\r\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\r\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\r\n Quat.rotateZ(out as QuatLike, a as QuatLike, rad);\r\n bx = out[0];\r\n by = out[1];\r\n bz = out[2];\r\n bw = out[3];\r\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (a * q)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param q - quaternion to rotate by\r\n * @returns `out`\r\n */\r\n static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let ax = a[0];\r\n let ay = a[1];\r\n let az = a[2];\r\n let aw = a[3];\r\n\r\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\r\n ax = a[4];\r\n ay = a[5];\r\n az = a[6];\r\n aw = a[7];\r\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\r\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\r\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\r\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} by a given quaternion (q * a)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param q - quaternion to rotate by\r\n * @param a - the dual quaternion to rotate\r\n * @returns `out`\r\n */\r\n static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like {\r\n const qx = q[0];\r\n const qy = q[1];\r\n const qz = q[2];\r\n const qw = q[3];\r\n let bx = a[0];\r\n let by = a[1];\r\n let bz = a[2];\r\n let bw = a[3];\r\n\r\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\r\n bx = a[4];\r\n by = a[5];\r\n bz = a[6];\r\n bw = a[7];\r\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\r\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\r\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\r\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the dual quaternion to rotate\r\n * @param axis - the axis to rotate around\r\n * @param rad - how far the rotation should be\r\n * @returns `out`\r\n */\r\n static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like {\r\n // Special case for rad = 0\r\n if (Math.abs(rad) < GLM_EPSILON) {\r\n return Quat2.copy(out, a);\r\n }\r\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\r\n\r\n rad *= 0.5;\r\n const s = Math.sin(rad);\r\n const bx = (s * axis[0]) / axisLength;\r\n const by = (s * axis[1]) / axisLength;\r\n const bz = (s * axis[2]) / axisLength;\r\n const bw = Math.cos(rad);\r\n\r\n const ax1 = a[0];\r\n const ay1 = a[1];\r\n const az1 = a[2];\r\n const aw1 = a[3];\r\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\r\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\r\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\r\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\r\n\r\n const ax = a[4];\r\n const ay = a[5];\r\n const az = a[6];\r\n const aw = a[7];\r\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\r\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\r\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\r\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns `out`\r\n */\r\n static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n out[2] = a[2] + b[2];\r\n out[3] = a[3] + b[3];\r\n out[4] = a[4] + b[4];\r\n out[5] = a[5] + b[5];\r\n out[6] = a[6] + b[6];\r\n out[7] = a[7] + b[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Multiplies two {@link Quat2}s\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns {quat2} out\r\n */\r\n static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like {\r\n const ax0 = a[0];\r\n const ay0 = a[1];\r\n const az0 = a[2];\r\n const aw0 = a[3];\r\n const bx1 = b[4];\r\n const by1 = b[5];\r\n const bz1 = b[6];\r\n const bw1 = b[7];\r\n const ax1 = a[4];\r\n const ay1 = a[5];\r\n const az1 = a[6];\r\n const aw1 = a[7];\r\n const bx0 = b[0];\r\n const by0 = b[1];\r\n const bz0 = b[2];\r\n const bw0 = b[3];\r\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\r\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\r\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\r\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\r\n out[4] =\r\n ax0 * bw1 +\r\n aw0 * bx1 +\r\n ay0 * bz1 -\r\n az0 * by1 +\r\n ax1 * bw0 +\r\n aw1 * bx0 +\r\n ay1 * bz0 -\r\n az1 * by0;\r\n out[5] =\r\n ay0 * bw1 +\r\n aw0 * by1 +\r\n az0 * bx1 -\r\n ax0 * bz1 +\r\n ay1 * bw0 +\r\n aw1 * by0 +\r\n az1 * bx0 -\r\n ax1 * bz0;\r\n out[6] =\r\n az0 * bw1 +\r\n aw0 * bz1 +\r\n ax0 * by1 -\r\n ay0 * bx1 +\r\n az1 * bw0 +\r\n aw1 * bz0 +\r\n ax1 * by0 -\r\n ay1 * bx0;\r\n out[7] =\r\n aw0 * bw1 -\r\n ax0 * bx1 -\r\n ay0 * by1 -\r\n az0 * bz1 +\r\n aw1 * bw0 -\r\n ax1 * bx0 -\r\n ay1 * by0 -\r\n az1 * bz0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Quat2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like { return out; }\r\n\r\n /**\r\n * Scales a {@link Quat2} by a scalar value\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaterion\r\n * @param a - the dual quaternion to scale\r\n * @param b - scalar value to scale the dual quaterion by\r\n * @returns `out`\r\n */\r\n static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n out[2] = a[2] * b;\r\n out[3] = a[3] * b;\r\n out[4] = a[4] * b;\r\n out[5] = a[5] * b;\r\n out[6] = a[6] * b;\r\n out[7] = a[7] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\r\n * @category Static\r\n *\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @returns dot product of a and b\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dot(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Quat2}s\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quat\r\n * @param a - the first operand\r\n * @param b - the second operand\r\n * @param t - interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like {\r\n const mt = 1 - t;\r\n if (Quat2.dot(a, b) < 0) { t = -t; }\r\n\r\n out[0] = a[0] * mt + b[0] * t;\r\n out[1] = a[1] * mt + b[1] * t;\r\n out[2] = a[2] * mt + b[2] * t;\r\n out[3] = a[3] * mt + b[3] * t;\r\n out[4] = a[4] * mt + b[4] * t;\r\n out[5] = a[5] * mt + b[5] * t;\r\n out[6] = a[6] * mt + b[6] * t;\r\n out[7] = a[7] * mt + b[7] * t;\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quat to calculate inverse of\r\n * @returns `out`\r\n */\r\n static invert(out: Quat2Like, a: Readonly): Quat2Like {\r\n const sqlen = Quat2.squaredLength(a);\r\n out[0] = -a[0] / sqlen;\r\n out[1] = -a[1] / sqlen;\r\n out[2] = -a[2] / sqlen;\r\n out[3] = a[3] / sqlen;\r\n out[4] = -a[4] / sqlen;\r\n out[5] = -a[5] / sqlen;\r\n out[6] = -a[6] / sqlen;\r\n out[7] = a[7] / sqlen;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\r\n * {@link Quat2.invert} and produces the same result.\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to calculate conjugate of\r\n * @returns `out`\r\n */\r\n static conjugate(out: Quat2Like, a: Readonly): Quat2Like {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n out[2] = -a[2];\r\n out[3] = a[3];\r\n out[4] = -a[4];\r\n out[5] = -a[5];\r\n out[6] = -a[6];\r\n out[7] = a[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate length of\r\n * @returns length of `a`\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static magnitude(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Quat2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Quat2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to calculate squared length of\r\n * @returns squared length of a\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static squaredLength(a: Readonly): number { return 0; }\r\n\r\n /**\r\n * Alias for {@link Quat2.squaredLength}\r\n * @category Static\r\n */\r\n static sqrLen(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Normalize a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param out - the receiving dual quaternion\r\n * @param a - dual quaternion to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Quat2Like, a: Readonly): Quat2Like {\r\n let magnitude = Quat2.squaredLength(a);\r\n if (magnitude > 0) {\r\n magnitude = Math.sqrt(magnitude);\r\n\r\n const a0 = a[0] / magnitude;\r\n const a1 = a[1] / magnitude;\r\n const a2 = a[2] / magnitude;\r\n const a3 = a[3] / magnitude;\r\n\r\n const b0 = a[4];\r\n const b1 = a[5];\r\n const b2 = a[6];\r\n const b3 = a[7];\r\n\r\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\r\n\r\n out[0] = a0;\r\n out[1] = a1;\r\n out[2] = a2;\r\n out[3] = a3;\r\n\r\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\r\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\r\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\r\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns a string representation of a {@link Quat2}\r\n * @category Static\r\n *\r\n * @param a - dual quaternion to represent as a string\r\n * @returns string representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Quat2(${a.join(', ')})`;\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return (\r\n a[0] === b[0] &&\r\n a[1] === b[1] &&\r\n a[2] === b[2] &&\r\n a[3] === b[3] &&\r\n a[4] === b[4] &&\r\n a[5] === b[5] &&\r\n a[6] === b[6] &&\r\n a[7] === b[7]\r\n );\r\n }\r\n\r\n /**\r\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first dual quaternion.\r\n * @param b - The second dual quaternion.\r\n * @returns True if the dual quaternions are equal, false otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const a2 = a[2];\r\n const a3 = a[3];\r\n const a4 = a[4];\r\n const a5 = a[5];\r\n const a6 = a[6];\r\n const a7 = a[7];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n const b2 = b[2];\r\n const b3 = b[3];\r\n const b4 = b[4];\r\n const b5 = b[5];\r\n const b6 = b[6];\r\n const b7 = b[7];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\r\n Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\r\n Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\r\n Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\r\n Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\r\n Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\r\n Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7))\r\n );\r\n }\r\n}\r\n\r\n// Methods which re-use the Quat implementation\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.dot = Quat.dot;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.squaredLength = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.sqrLen = Quat.squaredLength;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.mag = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.length = Quat.magnitude;\r\n// @ts-expect-error: Ignore type error coercion.\r\nQuat2.len = Quat.magnitude;\r\n\r\n// Static method alias assignments\r\nQuat2.mul = Quat2.multiply;\r\n", "import { GLM_EPSILON } from '#gl-matrix/common';\r\n\r\nimport type { Mat2Like, Mat2dLike, Mat3Like, Mat4Like, Vec2Like } from '#gl-matrix/types';\r\n\r\n/**\r\n * 2 Dimensional Vector\r\n */\r\nexport class Vec2 extends Float64Array {\r\n /**\r\n * Create a {@link Vec2}.\r\n *\r\n * @category Constructor\r\n */\r\n constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]) {\r\n switch (values.length) {\r\n case 2:{\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, values[1]!]);\r\n } else {\r\n super(v as ArrayBufferLike, values[1], 2);\r\n }\r\n break;\r\n }\r\n case 1: {\r\n const v = values[0];\r\n if (typeof v === 'number') {\r\n super([v, v]);\r\n } else {\r\n super(v as ArrayBufferLike, 0, 2);\r\n }\r\n break;\r\n }\r\n default:\r\n super(2); break;\r\n }\r\n }\r\n\r\n // ============\r\n // Accessors\r\n // ============\r\n\r\n // Getters and setters to make component access read better.\r\n // These are likely to be a little bit slower than direct array access.\r\n\r\n /**\r\n * The x component of the vector. Equivalent to `this[0];`\r\n * @category Vector Components\r\n */\r\n get x(): number { return this[0]; }\r\n set x(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The y component of the vector. Equivalent to `this[1];`\r\n * @category Vector Components\r\n */\r\n get y(): number { return this[1]; }\r\n set y(value: number) { this[1] = value; }\r\n\r\n // Alternate set of getters and setters in case this is being used to define\r\n // a color.\r\n\r\n /**\r\n * The r component of the vector. Equivalent to `this[0];`\r\n * @category Color Components\r\n */\r\n get r(): number { return this[0]; }\r\n set r(value: number) { this[0] = value; }\r\n\r\n /**\r\n * The g component of the vector. Equivalent to `this[1];`\r\n * @category Color Components\r\n */\r\n get g(): number { return this[1]; }\r\n set g(value: number) { this[1] = value; }\r\n\r\n /**\r\n * The magnitude (length) of this.\r\n * Equivalent to `Vec2.magnitude(this);`\r\n *\r\n * Magnitude is used because the `length` attribute is already defined by\r\n * TypedArrays to mean the number of elements in the array.\r\n *\r\n * @category Accessors\r\n */\r\n get magnitude(): number {\r\n return Math.hypot(this[0], this[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get mag(): number { return this.magnitude; }\r\n\r\n /**\r\n * The squared magnitude (length) of `this`.\r\n * Equivalent to `Vec2.squaredMagnitude(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get squaredMagnitude(): number {\r\n const x = this[0];\r\n const y = this[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredMagnitude}\r\n *\r\n * @category Accessors\r\n */\r\n get sqrMag(): number { return this.squaredMagnitude; }\r\n\r\n /**\r\n * A string representation of `this`\r\n * Equivalent to `Vec2.str(this);`\r\n *\r\n * @category Accessors\r\n */\r\n get str(): string {\r\n return Vec2.str(this);\r\n }\r\n\r\n // ===================\r\n // Instances methods\r\n // ===================\r\n\r\n /**\r\n * Copy the values from another {@link Vec2} into `this`.\r\n * @category Methods\r\n *\r\n * @param a the source vector\r\n * @returns `this`\r\n */\r\n copy(a: Readonly): this {\r\n this.set(a);\r\n return this;\r\n }\r\n\r\n // Instead of zero(), use a.fill(0) for instances;\r\n\r\n /**\r\n * Adds a {@link Vec2} to `this`.\r\n * Equivalent to `Vec2.add(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @returns `this`\r\n */\r\n add(b: Readonly): this {\r\n this[0] += b[0];\r\n this[1] += b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Subtracts a {@link Vec2} from `this`.\r\n * Equivalent to `Vec2.subtract(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to subtract from `this`\r\n * @returns `this`\r\n */\r\n subtract(b: Readonly): this {\r\n this[0] -= b[0];\r\n this[1] -= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Methods\r\n */\r\n sub(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Multiplies `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.multiply(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to multiply `this` by\r\n * @returns `this`\r\n */\r\n multiply(b: Readonly): this {\r\n this[0] *= b[0];\r\n this[1] *= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Methods\r\n */\r\n mul(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Divides `this` by a {@link Vec2}.\r\n * Equivalent to `Vec2.divide(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to divide `this` by\r\n * @returns `this`\r\n */\r\n divide(b: Readonly): this {\r\n this[0] /= b[0];\r\n this[1] /= b[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Methods\r\n */\r\n div(b: Readonly): this { return this; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Scales `this` by a scalar number.\r\n * Equivalent to `Vec2.scale(this, this, b);`\r\n * @category Methods\r\n *\r\n * @param b - Amount to scale `this` by\r\n * @returns `this`\r\n */\r\n scale(b: number): this {\r\n this[0] *= b;\r\n this[1] *= b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\r\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to add to `this`\r\n * @param scale - The amount to scale `b` by before adding\r\n * @returns `this`\r\n */\r\n scaleAndAdd(b: Readonly, scale: number): this {\r\n this[0] += b[0] * scale;\r\n this[1] += b[1] * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.distance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The vector to calculate the distance to\r\n * @returns Distance between `this` and `b`\r\n */\r\n distance(b: Readonly): number {\r\n return Vec2.distance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Methods\r\n */\r\n dist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\r\n * Equivalent to `Vec2.squaredDistance(this, b);`\r\n * @category Methods\r\n *\r\n * @param b The vector to calculate the squared distance to\r\n * @returns Squared distance between `this` and `b`\r\n */\r\n squaredDistance(b: Readonly): number {\r\n return Vec2.squaredDistance(this, b);\r\n }\r\n /**\r\n * Alias for {@link Vec2.squaredDistance}\r\n * @category Methods\r\n */\r\n sqrDist(b: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Negates the components of `this`.\r\n * Equivalent to `Vec2.negate(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n negate(): this {\r\n this[0] *= -1;\r\n this[1] *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the components of `this`.\r\n * Equivalent to `Vec2.inverse(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n invert(): this {\r\n this[0] = 1.0 / this[0];\r\n this[1] = 1.0 / this[1];\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets each component of `this` to it's absolute value.\r\n * Equivalent to `Vec2.abs(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n abs(): this {\r\n this[0] = Math.abs(this[0]);\r\n this[1] = Math.abs(this[1]);\r\n return this;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of this and another {@link Vec2}.\r\n * Equivalent to `Vec2.dot(this, b);`\r\n * @category Methods\r\n *\r\n * @param b - The second operand\r\n * @returns Dot product of `this` and `b`\r\n */\r\n dot(b: Readonly): number {\r\n return this[0] * b[0] + this[1] * b[1];\r\n }\r\n\r\n /**\r\n * Normalize `this`.\r\n * Equivalent to `Vec2.normalize(this, this);`\r\n * @category Methods\r\n *\r\n * @returns `this`\r\n */\r\n normalize(): this {\r\n return Vec2.normalize(this, this) as this;\r\n }\r\n\r\n // ===================\r\n // Static accessors\r\n // ===================\r\n\r\n /**\r\n * @category Static\r\n *\r\n * @returns The number of bytes in a {@link Vec2}.\r\n */\r\n static get BYTE_LENGTH(): number {\r\n return 2 * Float64Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n // ===================\r\n // Static methods\r\n // ===================\r\n\r\n /**\r\n * Creates a new, empty {@link Vec2}\r\n * @category Static\r\n *\r\n * @returns A new 2D vector\r\n */\r\n static create(): Vec2 {\r\n return new Vec2();\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with values from an existing vector\r\n * @category Static\r\n *\r\n * @param a - Vector to clone\r\n * @returns A new 2D vector\r\n */\r\n static clone(a: Readonly): Vec2 {\r\n return new Vec2(a);\r\n }\r\n\r\n /**\r\n * Creates a new {@link Vec2} initialized with the given values\r\n * @category Static\r\n *\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns A new 2D vector\r\n */\r\n static fromValues(x: number, y: number): Vec2 {\r\n return new Vec2(x, y);\r\n }\r\n\r\n /**\r\n * Copy the values from one {@link Vec2} to another\r\n * @category Static\r\n *\r\n * @param out - the receiving vector\r\n * @param a - The source vector\r\n * @returns `out`\r\n */\r\n static copy(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to the given values\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param x - X component\r\n * @param y - Y component\r\n * @returns `out`\r\n */\r\n static set(out: Vec2Like, x: number, y: number): Vec2Like {\r\n out[0] = x;\r\n out[1] = y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] + b[0];\r\n out[1] = a[1] + b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Subtracts vector b from vector a\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] - b[0];\r\n out[1] = a[1] - b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.subtract}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Multiplies two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] * b[0];\r\n out[1] = a[1] * b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.multiply}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Divides two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = a[0] / b[0];\r\n out[1] = a[1] / b[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.divide}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like { return [0, 0]; }\r\n\r\n /**\r\n * Math.ceil the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to ceil\r\n * @returns `out`\r\n */\r\n static ceil(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.ceil(a[0]);\r\n out[1] = Math.ceil(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.floor the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to floor\r\n * @returns `out`\r\n */\r\n static floor(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.floor(a[0]);\r\n out[1] = Math.floor(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the minimum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.min(a[0], b[0]);\r\n out[1] = Math.min(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the maximum of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n out[0] = Math.max(a[0], b[0]);\r\n out[1] = Math.max(a[1], b[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Math.round the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to round\r\n * @returns `out`\r\n */\r\n static round(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.round(a[0]);\r\n out[1] = Math.round(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Scales a {@link Vec2} by a scalar number\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to scale\r\n * @param b - Amount to scale the vector by\r\n * @returns `out`\r\n */\r\n static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like {\r\n out[0] = a[0] * b;\r\n out[1] = a[1] * b;\r\n return out;\r\n }\r\n\r\n /**\r\n * Adds two Vec2's after scaling the second operand by a scalar value\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param scale - The amount to scale b by before adding\r\n * @returns `out`\r\n */\r\n static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like {\r\n out[0] = a[0] + b[0] * scale;\r\n out[1] = a[1] + b[1] * scale;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns distance between `a` and `b`\r\n */\r\n static distance(a: Readonly, b: Readonly): number {\r\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static dist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the squared Euclidean distance between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Squared distance between `a` and `b`\r\n */\r\n static squaredDistance(a: Readonly, b: Readonly): number {\r\n const x = b[0] - a[0];\r\n const y = b[1] - a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.distance}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrDist(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Calculates the magnitude (length) of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate magnitude of\r\n * @returns Magnitude of a\r\n */\r\n static magnitude(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n */\r\n static mag(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\r\n *\r\n * @param a - vector to calculate length of\r\n * @returns length of a\r\n */\r\n // Length conflicts with Function.length\r\n static length(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Alias for {@link Vec2.magnitude}\r\n * @category Static\r\n * @deprecated Use {@link Vec2.mag}\r\n */\r\n static len(a: Readonly): number { return 0; } // eslint-disable-line @typescript-eslint/no-unused-vars\r\n\r\n /**\r\n * Calculates the squared length of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param a - Vector to calculate squared length of\r\n * @returns Squared length of a\r\n */\r\n static squaredLength(a: Readonly): number {\r\n const x = a[0];\r\n const y = a[1];\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Alias for {@link Vec2.squaredLength}\r\n * @category Static\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static sqrLen(a: Readonly, b: Readonly): number { return 0; }\r\n\r\n /**\r\n * Negates the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to negate\r\n * @returns `out`\r\n */\r\n static negate(out: Vec2Like, a: Readonly) {\r\n out[0] = -a[0];\r\n out[1] = -a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the inverse of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to invert\r\n * @returns `out`\r\n */\r\n static inverse(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = 1.0 / a[0];\r\n out[1] = 1.0 / a[1];\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns the absolute value of the components of a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to compute the absolute values of\r\n * @returns `out`\r\n */\r\n static abs(out: Vec2Like, a: Readonly): Vec2Like {\r\n out[0] = Math.abs(a[0]);\r\n out[1] = Math.abs(a[1]);\r\n return out;\r\n }\r\n\r\n /**\r\n * Normalize a {@link Vec2}\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - Vector to normalize\r\n * @returns `out`\r\n */\r\n static normalize(out: Vec2Like, a: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n let len = x * x + y * y;\r\n if (len > 0) {\r\n // TODO: evaluate use of glm_invsqrt here?\r\n len = 1 / Math.sqrt(len);\r\n }\r\n out[0] = a[0] * len;\r\n out[1] = a[1] * len;\r\n return out;\r\n }\r\n\r\n /**\r\n * Calculates the dot product of two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns Dot product of `a` and `b`\r\n */\r\n static dot(a: Readonly, b: Readonly): number {\r\n return a[0] * b[0] + a[1] * b[1];\r\n }\r\n\r\n /**\r\n * Computes the cross product of two {@link Vec2}s\r\n * Note that the cross product must by definition produce a 3D vector.\r\n * For this reason there is also not instance equivalent for this function.\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns `out`\r\n */\r\n static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like {\r\n const z = a[0] * b[1] - a[1] * b[0];\r\n out[0] = out[1] = 0;\r\n out[2] = z;\r\n return out;\r\n }\r\n\r\n /**\r\n * Performs a linear interpolation between two {@link Vec2}s\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\r\n * @returns `out`\r\n */\r\n static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like {\r\n const ax = a[0];\r\n const ay = a[1];\r\n out[0] = ax + t * (b[0] - ax);\r\n out[1] = ay + t * (b[1] - ay);\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y;\r\n out[1] = m[1] * x + m[3] * y;\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat2d}\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[2] * y + m[4];\r\n out[1] = m[1] * x + m[3] * y + m[5];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat3}\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[3] * y + m[6];\r\n out[1] = m[1] * x + m[4] * y + m[7];\r\n return out;\r\n }\r\n\r\n /**\r\n * Transforms the {@link Vec2} with a {@link Mat4}\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param out - The receiving vector\r\n * @param a - The vector to transform\r\n * @param m - Matrix to transform with\r\n * @returns `out`\r\n * @category Static\r\n */\r\n static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like {\r\n const x = a[0];\r\n const y = a[1];\r\n out[0] = m[0] * x + m[4] * y + m[12];\r\n out[1] = m[1] * x + m[5] * y + m[13];\r\n return out;\r\n }\r\n\r\n /**\r\n * Rotate a 2D vector\r\n * @category Static\r\n *\r\n * @param out - The receiving {@link Vec2}\r\n * @param a - The {@link Vec2} point to rotate\r\n * @param b - The origin of the rotation\r\n * @param rad - The angle of rotation in radians\r\n * @returns `out`\r\n */\r\n static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like {\r\n // Translate point to the origin\r\n const p0 = a[0] - b[0];\r\n const p1 = a[1] - b[1];\r\n const sinC = Math.sin(rad);\r\n const cosC = Math.cos(rad);\r\n\r\n // perform rotation and translate to correct position\r\n out[0] = p0 * cosC - p1 * sinC + b[0];\r\n out[1] = p0 * sinC + p1 * cosC + b[1];\r\n\r\n return out;\r\n }\r\n\r\n /**\r\n * Get the angle between two 2D vectors\r\n * @category Static\r\n *\r\n * @param a - The first operand\r\n * @param b - The second operand\r\n * @returns The angle in radians\r\n */\r\n static angle(a: Readonly, b: Readonly): number {\r\n const x1 = a[0];\r\n const y1 = a[1];\r\n const x2 = b[0];\r\n const y2 = b[1];\r\n // mag is the product of the magnitudes of a and b\r\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\r\n // mag &&.. short circuits if mag == 0\r\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\r\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\r\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\r\n }\r\n\r\n /**\r\n * Set the components of a {@link Vec2} to zero\r\n * @category Static\r\n *\r\n * @param out - The receiving vector\r\n * @returns `out`\r\n */\r\n static zero(out: Vec2Like): Vec2Like {\r\n out[0] = 0.0;\r\n out[1] = 0.0;\r\n return out;\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors components are ===, `false` otherwise.\r\n */\r\n static exactEquals(a: Readonly, b: Readonly): boolean {\r\n return a[0] === b[0] && a[1] === b[1];\r\n }\r\n\r\n /**\r\n * Returns whether the vectors have approximately the same elements in the same position.\r\n * @category Static\r\n *\r\n * @param a - The first vector.\r\n * @param b - The second vector.\r\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\r\n */\r\n static equals(a: Readonly, b: Readonly): boolean {\r\n const a0 = a[0];\r\n const a1 = a[1];\r\n const b0 = b[0];\r\n const b1 = b[1];\r\n return (\r\n Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\r\n Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1))\r\n );\r\n }\r\n\r\n /**\r\n * Returns a string representation of a vector\r\n * @category Static\r\n *\r\n * @param a - Vector to represent as a string\r\n * @returns String representation of the vector\r\n */\r\n static str(a: Readonly): string {\r\n return `Vec2(${a.join(', ')})`;\r\n }\r\n}\r\n\r\n// Instance method alias assignments\r\nVec2.prototype.sub = Vec2.prototype.subtract; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.mul = Vec2.prototype.multiply; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.div = Vec2.prototype.divide; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.dist = Vec2.prototype.distance; // eslint-disable-line @typescript-eslint/unbound-method\r\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance; // eslint-disable-line @typescript-eslint/unbound-method\r\n\r\n// Static method alias assignments\r\nVec2.sub = Vec2.subtract;\r\nVec2.mul = Vec2.multiply;\r\nVec2.div = Vec2.divide;\r\nVec2.dist = Vec2.distance;\r\nVec2.sqrDist = Vec2.squaredDistance;\r\nVec2.sqrLen = Vec2.squaredLength;\r\nVec2.mag = Vec2.magnitude;\r\nVec2.length = Vec2.magnitude;\r\nVec2.len = Vec2.magnitude;\r\n", "/**\r\n * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from\r\n * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support\r\n * please see {@link gl-matrix/types/swizzle/f64}.\r\n *\r\n * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * const vec = new Vec3(0, 1, 2);\r\n * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0).\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Vec2, Vec3, Vec4 } from '#gl-matrix/f64';\r\n\r\n/**\r\n * Internal `gl-matrix` variable tracking if swizzling is enabled (64-bit).\r\n */\r\nlet GLM_SWIZZLES_ENABLED_F64 = false;\r\n\r\n/**\r\n * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} /\r\n * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit).\r\n *\r\n * Swizzle operations are performed by using the `.` operator in conjunction with any combination\r\n * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed).\r\n * They return a new vector with the same number of components as specified in the swizzle attribute.\r\n *\r\n * @example\r\n * ```js\r\n * import { Vec3 } from 'gl-matrix/f64';\r\n * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';\r\n *\r\n * EnableSwizzlesF64();\r\n *\r\n * let v = new Vec3(0, 1, 2);\r\n *\r\n * v.yx; // returns new Vec2(1, 0)\r\n * v.xzy; // returns new Vec3(0, 2, 1)\r\n * v.zyxz; // returns new Vec4(2, 1, 0, 2)\r\n *\r\n * v.rgb; // returns new Vec3(0, 1, 2)\r\n * v.rbg; // returns new Vec3(0, 2, 1)\r\n * v.gg; // returns new Vec2(1, 1)\r\n * ```\r\n */\r\nexport function EnableSwizzlesF64(): void {\r\n /* v8 ignore next 1 */\r\n if (GLM_SWIZZLES_ENABLED_F64) { return; }\r\n\r\n /* eslint-disable comma-spacing, max-len */\r\n\r\n // The contents of the following section are autogenerated by scripts/gen-swizzle.js and should\r\n // not be modified by hand.\r\n // [Swizzle Autogen]\r\n\r\n const VEC2_SWIZZLES = ['xx','xy','yx','yy','xxx','xxy','xyx','xyy','yxx','yxy','yyx','yyy','xxxx','xxxy','xxyx','xxyy','xyxx','xyxy','xyyx','xyyy','yxxx','yxxy','yxyx','yxyy','yyxx','yyxy','yyyx','yyyy','rr','rg','gr','gg','rrr','rrg','rgr','rgg','grr','grg','ggr','ggg','rrrr','rrrg','rrgr','rrgg','rgrr','rgrg','rggr','rggg','grrr','grrg','grgr','grgg','ggrr','ggrg','gggr','gggg'];\r\n const VEC3_SWIZZLES = ['xz','yz','zx','zy','zz','xxz','xyz','xzx','xzy','xzz','yxz','yyz','yzx','yzy','yzz','zxx','zxy','zxz','zyx','zyy','zyz','zzx','zzy','zzz','xxxz','xxyz','xxzx','xxzy','xxzz','xyxz','xyyz','xyzx','xyzy','xyzz','xzxx','xzxy','xzxz','xzyx','xzyy','xzyz','xzzx','xzzy','xzzz','yxxz','yxyz','yxzx','yxzy','yxzz','yyxz','yyyz','yyzx','yyzy','yyzz','yzxx','yzxy','yzxz','yzyx','yzyy','yzyz','yzzx','yzzy','yzzz','zxxx','zxxy','zxxz','zxyx','zxyy','zxyz','zxzx','zxzy','zxzz','zyxx','zyxy','zyxz','zyyx','zyyy','zyyz','zyzx','zyzy','zyzz','zzxx','zzxy','zzxz','zzyx','zzyy','zzyz','zzzx','zzzy','zzzz','rb','gb','br','bg','bb','rrb','rgb','rbr','rbg','rbb','grb','ggb','gbr','gbg','gbb','brr','brg','brb','bgr','bgg','bgb','bbr','bbg','bbb','rrrb','rrgb','rrbr','rrbg','rrbb','rgrb','rggb','rgbr','rgbg','rgbb','rbrr','rbrg','rbrb','rbgr','rbgg','rbgb','rbbr','rbbg','rbbb','grrb','grgb','grbr','grbg','grbb','ggrb','gggb','ggbr','ggbg','ggbb','gbrr','gbrg','gbrb','gbgr','gbgg','gbgb','gbbr','gbbg','gbbb','brrr','brrg','brrb','brgr','brgg','brgb','brbr','brbg','brbb','bgrr','bgrg','bgrb','bggr','bggg','bggb','bgbr','bgbg','bgbb','bbrr','bbrg','bbrb','bbgr','bbgg','bbgb','bbbr','bbbg','bbbb'];\r\n const VEC4_SWIZZLES = ['xw','yw','zw','wx','wy','wz','ww','xxw','xyw','xzw','xwx','xwy','xwz','xww','yxw','yyw','yzw','ywx','ywy','ywz','yww','zxw','zyw','zzw','zwx','zwy','zwz','zww','wxx','wxy','wxz','wxw','wyx','wyy','wyz','wyw','wzx','wzy','wzz','wzw','wwx','wwy','wwz','www','xxxw','xxyw','xxzw','xxwx','xxwy','xxwz','xxww','xyxw','xyyw','xyzw','xywx','xywy','xywz','xyww','xzxw','xzyw','xzzw','xzwx','xzwy','xzwz','xzww','xwxx','xwxy','xwxz','xwxw','xwyx','xwyy','xwyz','xwyw','xwzx','xwzy','xwzz','xwzw','xwwx','xwwy','xwwz','xwww','yxxw','yxyw','yxzw','yxwx','yxwy','yxwz','yxww','yyxw','yyyw','yyzw','yywx','yywy','yywz','yyww','yzxw','yzyw','yzzw','yzwx','yzwy','yzwz','yzww','ywxx','ywxy','ywxz','ywxw','ywyx','ywyy','ywyz','ywyw','ywzx','ywzy','ywzz','ywzw','ywwx','ywwy','ywwz','ywww','zxxw','zxyw','zxzw','zxwx','zxwy','zxwz','zxww','zyxw','zyyw','zyzw','zywx','zywy','zywz','zyww','zzxw','zzyw','zzzw','zzwx','zzwy','zzwz','zzww','zwxx','zwxy','zwxz','zwxw','zwyx','zwyy','zwyz','zwyw','zwzx','zwzy','zwzz','zwzw','zwwx','zwwy','zwwz','zwww','wxxx','wxxy','wxxz','wxxw','wxyx','wxyy','wxyz','wxyw','wxzx','wxzy','wxzz','wxzw','wxwx','wxwy','wxwz','wxww','wyxx','wyxy','wyxz','wyxw','wyyx','wyyy','wyyz','wyyw','wyzx','wyzy','wyzz','wyzw','wywx','wywy','wywz','wyww','wzxx','wzxy','wzxz','wzxw','wzyx','wzyy','wzyz','wzyw','wzzx','wzzy','wzzz','wzzw','wzwx','wzwy','wzwz','wzww','wwxx','wwxy','wwxz','wwxw','wwyx','wwyy','wwyz','wwyw','wwzx','wwzy','wwzz','wwzw','wwwx','wwwy','wwwz','wwww','ra','ga','ba','ar','ag','ab','aa','rra','rga','rba','rar','rag','rab','raa','gra','gga','gba','gar','gag','gab','gaa','bra','bga','bba','bar','bag','bab','baa','arr','arg','arb','ara','agr','agg','agb','aga','abr','abg','abb','aba','aar','aag','aab','aaa','rrra','rrga','rrba','rrar','rrag','rrab','rraa','rgra','rgga','rgba','rgar','rgag','rgab','rgaa','rbra','rbga','rbba','rbar','rbag','rbab','rbaa','rarr','rarg','rarb','rara','ragr','ragg','ragb','raga','rabr','rabg','rabb','raba','raar','raag','raab','raaa','grra','grga','grba','grar','grag','grab','graa','ggra','ggga','ggba','ggar','ggag','ggab','ggaa','gbra','gbga','gbba','gbar','gbag','gbab','gbaa','garr','garg','garb','gara','gagr','gagg','gagb','gaga','gabr','gabg','gabb','gaba','gaar','gaag','gaab','gaaa','brra','brga','brba','brar','brag','brab','braa','bgra','bgga','bgba','bgar','bgag','bgab','bgaa','bbra','bbga','bbba','bbar','bbag','bbab','bbaa','barr','barg','barb','bara','bagr','bagg','bagb','baga','babr','babg','babb','baba','baar','baag','baab','baaa','arrr','arrg','arrb','arra','argr','argg','argb','arga','arbr','arbg','arbb','arba','arar','arag','arab','araa','agrr','agrg','agrb','agra','aggr','aggg','aggb','agga','agbr','agbg','agbb','agba','agar','agag','agab','agaa','abrr','abrg','abrb','abra','abgr','abgg','abgb','abga','abbr','abbg','abbb','abba','abar','abag','abab','abaa','aarr','aarg','aarb','aara','aagr','aagg','aagb','aaga','aabr','aabg','aabb','aaba','aaar','aaag','aaab','aaaa'];\r\n\r\n // [/Swizzle Autogen]\r\n\r\n /* eslint-enable comma-spacing, max-len */\r\n\r\n /**\r\n * Internal swizzle index table for `gl-matrix`.\r\n */\r\n const SWIZZLE_INDEX: Record = {\r\n x: 0, r: 0,\r\n y: 1, g: 1,\r\n z: 2, b: 2,\r\n w: 3, a: 3,\r\n };\r\n\r\n /**\r\n * Internal helper function to convert and return a `gl-matrix` vector by swizzle format.\r\n *\r\n * @param swizzle - Swizzle format to apply.\r\n * @returns {Vec2 | Vec3 | Vec4} New swizzled vector instance.\r\n */\r\n function getSwizzleImpl(swizzle: string): () => Vec2 | Vec3 | Vec4 {\r\n switch (swizzle.length) {\r\n case 2:\r\n return function(this: Float64Array) {\r\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\r\n };\r\n case 3:\r\n return function(this: Float64Array) {\r\n return new Vec3(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]]);\r\n };\r\n case 4:\r\n return function(this: Float64Array) {\r\n return new Vec4(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]],\r\n this[SWIZZLE_INDEX[swizzle[2]]], this[SWIZZLE_INDEX[swizzle[3]]]);\r\n };\r\n }\r\n\r\n throw new Error('Illegal swizzle length');\r\n }\r\n\r\n for (const swizzle of VEC2_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec2.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC3_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec3.prototype, swizzle, {\r\n get: impl\r\n });\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n for (const swizzle of VEC4_SWIZZLES) {\r\n const impl = getSwizzleImpl(swizzle);\r\n Object.defineProperty(Vec4.prototype, swizzle, {\r\n get: impl\r\n });\r\n }\r\n\r\n GLM_SWIZZLES_ENABLED_F64 = true;\r\n}\r\n", "/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_DEG_TO_RAD: number = Math.PI / 180;\r\n\r\n/**\r\n * Constant used in `gl-matrix` angle conversions.\r\n */\r\nconst GLM_RAD_TO_DEG: number = 180 / Math.PI;\r\n\r\n/**\r\n * Convert `radians` to `degrees`.\r\n *\r\n * @param value - Angle in `radians`.\r\n * @returns Angle in `degrees`.\r\n */\r\nexport function toDegree(value: number): number {\r\n return value * GLM_RAD_TO_DEG;\r\n}\r\n\r\n/**\r\n * Convert `degrees` to `radians`.\r\n *\r\n * @param value - Angle in `degrees`.\r\n * @returns Angle in `radians`.\r\n */\r\nexport function toRadian(value: number): number {\r\n return value * GLM_DEG_TO_RAD;\r\n}\r\n"], + "mappings": ";;;;6ZAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,GAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,aAAAC,GAAA,aAAAC,KAAA,eAAAC,GAAAd,ICOO,IAAMe,EAAN,MAAMC,UAAa,YAAa,CACrC,MAAOC,GAAgB,IAAI,aAAa,CACtC,EAAG,EACH,EAAG,CACL,CAAC,EAOD,eAAeC,EAAoE,CACjF,OAAQA,EAAO,OAAQ,CACrB,IAAK,GACH,MAAMA,CAAM,EAAG,MACjB,IAAK,GACH,MAAMA,EAAO,CAAC,EAAsBA,EAAO,CAAC,EAAG,CAAC,EAAG,MACrD,IAAK,GACH,IAAMC,EAAID,EAAO,CAAC,EACd,OAAOC,GAAM,SACf,MAAM,CACJA,EAAGA,EACHA,EAAGA,CAAC,CAAC,EAEP,MAAMA,EAAsB,EAAG,CAAC,EAElC,MACF,QACE,MAAMH,EAAKC,EAAa,EAAG,KAC/B,CACF,CAYA,IAAI,KAAc,CAChB,OAAOD,EAAK,IAAI,IAAI,CACtB,CAaA,KAAKI,EAA6B,CAChC,YAAK,IAAIA,CAAC,EACH,IACT,CASA,UAAiB,CACf,YAAK,IAAIJ,EAAKC,EAAa,EACpB,IACT,CAUA,SAASI,EAA6B,CACpC,OAAOL,EAAK,SAAS,KAAM,KAAMK,CAAC,CACpC,CAMA,IAAIA,EAA6B,CAAE,OAAO,IAAM,CAShD,WAAkB,CAChB,OAAOL,EAAK,UAAU,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AAC,CAAC,CAAC,CAAC,CACpE,CACJ,CAEA,MAAM,IAAI,MAAM,wBAAwB,CAC1C,CAEA,QAAWA,KAAWL,EAAe,CACnC,IAAMS,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeC,EAAK,UAAWD,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeF,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWJ,EAAe,CACnC,IAAMQ,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeE,EAAK,UAAWF,EAAS,CAC7C,IAAKI,CACP,CAAC,EACD,OAAO,eAAeD,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEA,QAAWJ,KAAWH,EAAe,CACnC,IAAMO,EAAOL,EAAeC,CAAO,EACnC,OAAO,eAAeG,EAAK,UAAWH,EAAS,CAC7C,IAAKI,CACP,CAAC,CACH,CAEAX,EAA2B,EAC7B,CCzIA,IAAMY,GAAyB,KAAK,GAAK,IAKnCC,GAAyB,IAAM,KAAK,GAQnC,SAASC,GAASC,EAAuB,CAC9C,OAAOA,EAAQF,EACjB,CAQO,SAASG,GAASD,EAAuB,CAC9C,OAAOA,EAAQH,EACjB", + "names": ["f64_exports", "__export", "EnableSwizzlesF64", "Mat2", "Mat2d", "Mat3", "Mat4", "Quat", "Quat2", "Vec2", "Vec3", "Vec4", "toDegree", "toRadian", "__toCommonJS", "Mat2", "_Mat2", "#IDENTITY_2X2", "values", "v", "a", "b", "rad", "out", "a1", "a0", "a2", "a3", "det", "b0", "b1", "b2", "b3", "s", "c", "v0", "v1", "scale", "L", "D", "U", "Mat2d", "_Mat2d", "#IDENTITY_2X3", "values", "v", "a", "b", "rad", "out", "aa", "ab", "ac", "ad", "atx", "aty", "det", "a0", "a1", "a2", "a3", "a4", "a5", "b0", "b1", "b2", "b3", "b4", "b5", "v0", "v1", "s", "c", "scale", "Mat3", "_Mat3", "#IDENTITY_3X3", "values", "v", "a", "b", "rad", "out", "a01", "a02", "a12", "a00", "a10", "a11", "a20", "a21", "a22", "b01", "b11", "b21", "det", "b0", "b1", "b2", "x", "y", "s", "c", "q", "z", "w", "x2", "y2", "z2", "xx", "yx", "yy", "zx", "zy", "zz", "wx", "wy", "wz", "a03", "a13", "a23", "a30", "a31", "a32", "a33", "b00", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "ax", "ay", "az", "bx", "by", "bz", "cx", "cy", "cz", "width", "height", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b3", "b4", "b5", "b6", "b7", "b8", "Mat4", "_Mat4", "#IDENTITY_4X4", "#TMP_VEC3", "values", "v", "a", "b", "rad", "axis", "fovy", "aspect", "near", "far", "left", "right", "bottom", "top", "out", "a01", "a02", "a03", "a12", "a13", "a23", "a00", "a10", "a11", "a20", "a21", "a22", "a30", "a31", "a32", "a33", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "b10", "b11", "det", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "x", "y", "z", "len", "s", "c", "t", "b12", "b20", "b21", "b22", "q", "w", "x2", "y2", "z2", "xx", "xy", "xz", "yy", "yz", "zz", "wx", "wy", "wz", "bx", "by", "bz", "bw", "ax", "ay", "az", "aw", "magnitude", "cx", "cy", "cz", "mat", "m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33", "is1", "is2", "is3", "sm11", "sm12", "sm13", "sm21", "sm22", "sm23", "sm31", "sm32", "sm33", "trace", "S", "out_r", "out_t", "out_s", "sx", "sy", "sz", "o", "ox", "oy", "oz", "out0", "out1", "out2", "out4", "out5", "out6", "out8", "out9", "out10", "yx", "zx", "zy", "rl", "tb", "nf", "f", "fov", "upTan", "downTan", "leftTan", "rightTan", "xScale", "yScale", "lr", "bt", "eye", "center", "up", "eyex", "eyey", "eyez", "upx", "upy", "upz", "centerx", "centery", "centerz", "z0", "z1", "x0", "x1", "y0", "y1", "target", "scale", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b13", "b14", "b15", "Vec3", "_Vec3", "values", "v", "value", "x", "y", "z", "a", "b", "scale", "out", "len", "ax", "ay", "az", "bx", "by", "bz", "t", "angle", "sinTotal", "ratioA", "ratioB", "c", "d", "factorTimes2", "factor1", "factor2", "factor3", "factor4", "inverseFactor", "inverseFactorTimesTwo", "m", "w", "q", "qx", "qy", "qz", "w2", "uvx", "uvy", "uvz", "uuvx", "uuvy", "uuvz", "rad", "py", "pz", "px", "mag", "cosine", "a0", "a1", "a2", "b0", "b1", "b2", "Vec4", "_Vec4", "values", "v", "value", "x", "y", "z", "w", "a", "b", "scale", "out", "len", "u", "c", "d", "e", "f", "g", "h", "i", "j", "t", "ax", "ay", "az", "aw", "m", "q", "qx", "qy", "qz", "qw", "ix", "iy", "iz", "iw", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "Quat", "_Quat", "#DEFAULT_ANGLE_ORDER", "#TMP_QUAT1", "#TMP_QUAT2", "#TMP_MAT3", "#TMP_VEC3", "#X_UNIT_VEC3", "#Y_UNIT_VEC3", "values", "v", "value", "x", "y", "z", "w", "a", "b", "rad", "scale", "out", "axis", "out_axis", "q", "dotproduct", "ax", "ay", "az", "aw", "bx", "by", "bz", "bw", "r", "et", "s", "t", "scale0", "scale1", "cosom", "omega", "sinom", "a0", "a1", "a2", "a3", "dot", "invDot", "m", "fTrace", "fRoot", "i", "j", "k", "order", "halfToRad", "sx", "cx", "sy", "cy", "sz", "cz", "Vec3", "c", "d", "view", "right", "up", "Vec4", "Quat2", "_Quat2", "#TMP_QUAT", "#TMP_VEC3", "values", "v", "a", "x1", "y1", "z1", "w1", "x2", "y2", "z2", "w2", "ax", "ay", "az", "out", "q", "t", "bx", "by", "bz", "bw", "Mat4", "aw", "ax1", "ay1", "az1", "aw1", "bx1", "by1", "bz1", "ax2", "ay2", "az2", "aw2", "rad", "Quat", "qx", "qy", "qz", "qw", "axis", "axisLength", "s", "b", "ax0", "ay0", "az0", "aw0", "bw1", "bx0", "by0", "bz0", "bw0", "mt", "sqlen", "magnitude", "a0", "a1", "a2", "a3", "b0", "b1", "b2", "b3", "a_dot_b", "a4", "a5", "a6", "a7", "b4", "b5", "b6", "b7", "Vec2", "_Vec2", "values", "v", "value", "x", "y", "a", "b", "scale", "out", "len", "z", "t", "ax", "ay", "m", "rad", "p0", "p1", "sinC", "cosC", "x1", "y1", "x2", "y2", "mag", "cosine", "a0", "a1", "b0", "b1", "GLM_SWIZZLES_ENABLED_F64", "EnableSwizzlesF64", "VEC2_SWIZZLES", "VEC3_SWIZZLES", "VEC4_SWIZZLES", "SWIZZLE_INDEX", "getSwizzleImpl", "swizzle", "Vec2", "Vec3", "Vec4", "impl", "GLM_DEG_TO_RAD", "GLM_RAD_TO_DEG", "toDegree", "value", "toRadian"] +} diff --git a/dist-cdn/types/gl-matrix-f32.d.cts b/dist-cdn/types/gl-matrix-f32.d.cts new file mode 100644 index 00000000..0e3da008 --- /dev/null +++ b/dist-cdn/types/gl-matrix-f32.d.cts @@ -0,0 +1,9911 @@ +/** + * Provides an all-inclusive ESM distribution of `gl-matrix` (32-bit). All library classes extends `Float32Array`. + * + * @packageDocumentation + */ + +/** + * Provides all common type declarations shared across `gl-matrix`. + * + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import type { Vec3Like } from 'gl-matrix/types'; + * + * const vec: Vec3Like = new Vec3(0, 1, 2); + * ``` + * + * For JSDoc using the new Typescript 5.5 `@import` tag: + * ```js + * /** + * * @import { Vec3Like } from 'gl-matrix/types' + * *\/ + * ``` + * + * For JSDoc using the older `import types` Typescript mechanism: + * ```js + * /** + * * @type {import('gl-matrix/types').Vec3Like} + * *\/ + * ``` + * + * @packageDocumentation + */ +/** + * The floating-point typed arrays that can be used in place of a vector, matrix, or quaternion. + */ +type FloatArray = Float32Array | Float64Array; +/** + * A 2x2 Matrix given as a {@link Mat2}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Mat2Like = [number, number, number, number] | FloatArray; +/** + * A 2x3 Matrix given as a {@link Mat2d}, a 6-element floating-point TypedArray, or an array of 6 numbers. + */ +type Mat2dLike = [number, number, number, number, number, number] | FloatArray; +/** + * A 3x3 Matrix given as a {@link Mat3}, a 9-element floating-point TypedArray, or an array of 9 numbers. + */ +type Mat3Like = [number, number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 4x4 Matrix given as a {@link Mat4}, a 16-element floating-point TypedArray, or an array of 16 numbers. + */ +type Mat4Like = + | [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + ] + | FloatArray; +/** + * A Quaternion given as a {@link Quat}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type QuatLike = Vec4Like; +/** + * A Dual Quaternion given as a {@link Quat2}, an 8-element floating-point TypedArray, or an array of 8 numbers. + */ +type Quat2Like = [number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 2-dimensional vector given as a {@link Vec2}, a 2-element floating-point TypedArray, or an array of 2 numbers. + */ +type Vec2Like = [number, number] | FloatArray; +/** + * A 3-dimensional vector given as a {@link Vec3}, a 3-element floating-point TypedArray, or an array of 3 numbers. + */ +type Vec3Like = [number, number, number] | FloatArray; +/** + * A 4-dimensional vector given as a {@link Vec4}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Vec4Like = [number, number, number, number] | FloatArray; + +/** + * A 2x2 Matrix + */ +declare class Mat2 extends Float32Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity(): this; + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose(): this; + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert(): this; + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create(): Mat2; + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a: Readonly): Mat2; + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values: number[]): Mat2; + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2Like, ...values: number[]): Mat2Like; + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2Like): Mat2Like; + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null; + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like; + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like; + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like; + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2Like, rad: number): Mat2Like; + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2Like, v: Readonly): Mat2Like; + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like; + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like; + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU( + L: Mat2Like, + D: Readonly, + U: Mat2Like, + a: Readonly, + ): [Mat2Like, Readonly, Mat2Like]; + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 2x3 Matrix + */ +declare class Mat2d extends Float32Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create(): Mat2d; + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a: Readonly): Mat2d; + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2dLike, a: Readonly): Mat2dLike; + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values: number[]): Mat2d; + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2dLike, ...values: number[]): Mat2dLike; + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2dLike): Mat2dLike; + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null; + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike; + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2dLike, rad: number): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike; + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike; + /** + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 3x3 Matrix + */ +declare class Mat3 extends Float32Array { + #private; + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create(): Mat3; + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a: Readonly): Mat3; + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values: number[]): Mat3; + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat3Like, ...values: number[]): Mat3Like; + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat3Like): Mat3Like; + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null; + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like; + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like; + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat3Like, rad: number): Mat3Like; + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat3Like, q: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null; + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out: Mat3Like, width: number, height: number): Mat3Like; + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like; + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like; + /** + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 4x4 Matrix + */ +declare class Mat4 extends Float32Array { + #private; + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad: number, axis: Readonly): this; + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create(): Mat4; + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a: Readonly): Mat4; + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values: number[]): Mat4; + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat4Like, ...values: number[]): Mat4Like; + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out: Mat4Like): Mat4Like; + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null; + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like; + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null; + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null; + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like; + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out: QuatLike, mat: Readonly): QuatLike; + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + ): Mat4Like; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + o: Readonly, + ): Mat4Like; + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat4Like, q: Readonly): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView( + out: Mat4Like, + fov: { + upDegrees: number; + downDegrees: number; + leftDegrees: number; + rightDegrees: number; + }, + near: number, + far: number, + ): Mat4Like; + /** + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like; + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like; + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like; + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like; + /** + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * Quaternion + */ +declare class Quat extends Float32Array { + #private; + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w(): number; + set w(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale: number): QuatLike; + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b: Readonly): number; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create(): Quat; + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike; + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as provided in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis: Vec3Like, q: Readonly): number; + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a: Readonly, b: Readonly): number; + /** + * Multiplies two quaternions. + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out: QuatLike, a: Readonly, b: number): QuatLike; + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out: QuatLike, a: Readonly): QuatLike; + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to re-normalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out: QuatLike, m: Readonly): QuatLike; + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out: QuatLike, x: number, y: number, z: number, order?: string): QuatLike; + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a: Readonly): Quat; + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x: number, y: number, z: number, w: number): Quat; + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike; + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out: QuatLike, a: Readonly, scale: number): QuatLike; + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out: QuatLike, a: Readonly): QuatLike; + /** + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp( + out: QuatLike, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): QuatLike; + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike; +} + +/** + * Dual Quaternion + */ +declare class Quat2 extends Float32Array { + #private; + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create(): Quat2; + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a: Quat2Like): Quat2; + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2; + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + ): Quat2; + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out: Quat2Like, q: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set( + out: Quat2Like, + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2Like; + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out: QuatLike, a: Readonly): QuatLike; + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like; + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like; + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like; + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 2 Dimensional Vector + */ +declare class Vec2 extends Float32Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create(): Vec2; + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a: Readonly): Vec2; + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x: number, y: number): Vec2; + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out: Vec2Like, x: number, y: number): Vec2Like; + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like; + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like; + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like; + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out: Vec2Like): Vec2Like; + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a: Readonly): string; +} + +/** + * 3 Dimensional Vector + */ +declare class Vec3 extends Float32Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create(): Vec3; + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a: Readonly): Vec3; + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a: Readonly): number; + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x: number, y: number, z: number): Vec3; + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like; + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like; + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number): Vec3Like; + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like; + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like; + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like; + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec3Like): Vec3Like; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 4 Dimensional Vector + */ +declare class Vec4 extends Float32Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w(): number; + set w(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a(): number; + set a(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create(): Vec4; + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a: Vec4Like): Vec4; + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x: number, y: number, z: number, w: number): Vec4; + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like; + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like; + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like; + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like; + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like; + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec4Like): Vec4Like; + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * To enable additional swizzle accessors for vector classes (32-bit) invoke the {@link EnableSwizzles} function from + * the `gl-matrix/swizzle` sub-path export. To enable ambient module declarations for IDE / Typescript support please + * see {@link gl-matrix/types/swizzle}. + * + * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}. + * + * @example + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import { EnableSwizzles } from 'gl-matrix/swizzle'; + * + * EnableSwizzles(); + * + * const vec = new Vec3(0, 1, 2); + * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). + * ``` + * + * @packageDocumentation + */ +/** + * Enables Swizzle operations on {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / + * {@link gl-matrix.Vec4 | Vec4} types from {@link gl-matrix | gl-matrix} (32-bit). + * + * Swizzle operations are performed by using the `.` operator in conjunction with any combination + * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed). + * They return a new vector with the same number of components as specified in the swizzle attribute. + * + * @example + * ```js + * import { Vec3, EnableSwizzles } from 'gl-matrix'; + * + * EnableSwizzles(); + * + * let v = new Vec3(0, 1, 2); + * + * v.yx; // returns new Vec2(1, 0) + * v.xzy; // returns new Vec3(0, 2, 1) + * v.zyxz; // returns new Vec4(2, 1, 0, 2) + * + * v.rgb; // returns new Vec3(0, 1, 2) + * v.rbg; // returns new Vec3(0, 2, 1) + * v.gg; // returns new Vec2(1, 1) + * ``` + */ +declare function EnableSwizzles(): void; + +/** + * Ambient module declarations for `gl-matrix` (32-bit) swizzle extensions for vector classes. + * + * When swizzle accessors via {@link gl-matrix/swizzle.EnableSwizzles | EnableSwizzles} are enabled include this + * sub-path export as a `side effect` import to add ambient module declarations for the additional accessors to + * {@link gl-matrix.Vec2 | Vec2} / {@link gl-matrix.Vec3 | Vec3} / {@link gl-matrix.Vec4 | Vec4} + * + * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}. + * + * ```js + * import { Vec2 } from 'gl-matrix'; + * import { EnableSwizzles } from 'gl-matrix/swizzle'; + * + * import 'gl-matrix/types/swizzle'; + * + * EnableSwizzles(); + * + * const vec = new Vec2(0, 1); + * + * // Swizzled instance - returns new Vec2(1, 0). + * const vecSwizzled = vec.yx; + * ``` + * + * @packageDocumentation + */ + +/** + * A type alias for Vec2 (32-bit). + * @hidden + */ +type Vec2Alias = Vec2; +/** + * A type alias for Vec3 (32-bit). + * @hidden + */ +type Vec3Alias = Vec3; +/** + * A type alias for Vec4 (32-bit). + * @hidden + */ +type Vec4Alias = Vec4; + +/** + * Vec2 swizzle extension accessors. + */ +interface Vec2 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; +} +/** + * Vec3 swizzle extension accessors. + */ +interface Vec3 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; +} +/** + * Vec4 swizzle extension accessors. + */ +interface Vec4 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ww(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get www(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ra(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ga(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ba(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ar(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ag(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ab(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get aa(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get raa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get baa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ara(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rraa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get graa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get braa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get araa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaaa(): Vec4Alias; +} + +/** + * Convert `radians` to `degrees`. + * + * @param value - Angle in `radians`. + * @returns Angle in `degrees`. + */ +declare function toDegree(value: number): number; +/** + * Convert `degrees` to `radians`. + * + * @param value - Angle in `degrees`. + * @returns Angle in `radians`. + */ +declare function toRadian(value: number): number; + +export { + EnableSwizzles, + type FloatArray, + Mat2, + type Mat2Like, + Mat2d, + type Mat2dLike, + Mat3, + type Mat3Like, + Mat4, + type Mat4Like, + Quat, + Quat2, + type Quat2Like, + type QuatLike, + Vec2, + type Vec2Like, + Vec3, + type Vec3Like, + Vec4, + type Vec4Like, + Mat2 as mat2, + Mat2d as mat2d, + Mat3 as mat3, + Mat4 as mat4, + Quat as quat, + Quat2 as quat2, + toDegree, + toRadian, + Vec2 as vec2, + Vec3 as vec3, + Vec4 as vec4, +}; diff --git a/dist-cdn/types/gl-matrix-f64.d.cts b/dist-cdn/types/gl-matrix-f64.d.cts new file mode 100644 index 00000000..e1de483f --- /dev/null +++ b/dist-cdn/types/gl-matrix-f64.d.cts @@ -0,0 +1,9903 @@ +/** + * Provides an all-inclusive ESM distribution of `gl-matrix` (64-bit). All library classes extends `Float64Array`. + * + * @packageDocumentation + */ + +/** + * Provides all common type declarations shared across `gl-matrix`. + * + * ```ts + * import { Vec3 } from 'gl-matrix'; + * import type { Vec3Like } from 'gl-matrix/types'; + * + * const vec: Vec3Like = new Vec3(0, 1, 2); + * ``` + * + * For JSDoc using the new Typescript 5.5 `@import` tag: + * ```js + * /** + * * @import { Vec3Like } from 'gl-matrix/types' + * *\/ + * ``` + * + * For JSDoc using the older `import types` Typescript mechanism: + * ```js + * /** + * * @type {import('gl-matrix/types').Vec3Like} + * *\/ + * ``` + * + * @packageDocumentation + */ +/** + * The floating-point typed arrays that can be used in place of a vector, matrix, or quaternion. + */ +type FloatArray = Float32Array | Float64Array; +/** + * A 2x2 Matrix given as a {@link Mat2}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Mat2Like = [number, number, number, number] | FloatArray; +/** + * A 2x3 Matrix given as a {@link Mat2d}, a 6-element floating-point TypedArray, or an array of 6 numbers. + */ +type Mat2dLike = [number, number, number, number, number, number] | FloatArray; +/** + * A 3x3 Matrix given as a {@link Mat3}, a 9-element floating-point TypedArray, or an array of 9 numbers. + */ +type Mat3Like = [number, number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 4x4 Matrix given as a {@link Mat4}, a 16-element floating-point TypedArray, or an array of 16 numbers. + */ +type Mat4Like = + | [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + ] + | FloatArray; +/** + * A Quaternion given as a {@link Quat}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type QuatLike = Vec4Like; +/** + * A Dual Quaternion given as a {@link Quat2}, an 8-element floating-point TypedArray, or an array of 8 numbers. + */ +type Quat2Like = [number, number, number, number, number, number, number, number] | FloatArray; +/** + * A 2-dimensional vector given as a {@link Vec2}, a 2-element floating-point TypedArray, or an array of 2 numbers. + */ +type Vec2Like = [number, number] | FloatArray; +/** + * A 3-dimensional vector given as a {@link Vec3}, a 3-element floating-point TypedArray, or an array of 3 numbers. + */ +type Vec3Like = [number, number, number] | FloatArray; +/** + * A 4-dimensional vector given as a {@link Vec4}, a 4-element floating-point TypedArray, or an array of 4 numbers. + */ +type Vec4Like = [number, number, number, number] | FloatArray; + +/** + * A 2x2 Matrix + */ +declare class Mat2 extends Float64Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2} into `this`. + * + * @param a the source vector + * @returns `this` + * @category Methods + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2.identity(this) + * + * @returns `this` + * @category Methods + */ + identity(): this; + /** + * Multiplies this {@link Mat2} against another one + * Equivalent to `Mat2.multiply(this, this, b);` + * + * @param b - The second operand + * @returns `this` + * @category Methods + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat2} + * Equivalent to `Mat2.transpose(this, this);` + * + * @returns `this` + * @category Methods + */ + transpose(): this; + /** + * Inverts this {@link Mat2} + * Equivalent to `Mat4.invert(this, this);` + * + * @returns `this` + * @category Methods + */ + invert(): this; + /** + * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2.scale(this, this, v);` + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + * @category Methods + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat2} by the given angle around the given axis + * Equivalent to `Mat2.rotate(this, this, rad);` + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + * @category Methods + */ + rotate(rad: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2} + * @category Static + * + * @returns A new {@link Mat2} + */ + static create(): Mat2; + /** + * Creates a new {@link Mat2} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2} + */ + static clone(a: Readonly): Mat2; + /** + * Copy the values from one {@link Mat2} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Create a new {@link Mat2} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2} + */ + static fromValues(...values: number[]): Mat2; + /** + * Set the components of a {@link Mat2} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2Like, ...values: number[]): Mat2Like; + /** + * Set a {@link Mat2} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2Like): Mat2Like; + /** + * Transpose the values of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat2Like, a: Readonly): Mat2Like; + /** + * Inverts a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat2Like, a: Mat2Like): Mat2Like | null; + /** + * Calculates the adjugate of a {@link Mat2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat2Like, a: Mat2Like): Mat2Like; + /** + * Calculates the determinant of a {@link Mat2} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.subtract} + * @category Static + */ + static sub(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Multiplies two {@link Mat2}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Alias for {@link Mat2.multiply} + * @category Static + */ + static mul(out: Mat2Like, a: Readonly, b: Readonly): Mat2Like; + /** + * Rotates a {@link Mat2} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2Like, a: Readonly, rad: number): Mat2Like; + /** + * Scales the {@link Mat2} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2Like, a: Readonly, v: Readonly): Mat2Like; + /** + * Creates a {@link Mat2} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2Like, rad: number): Mat2Like; + /** + * Creates a {@link Mat2} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2Like, v: Readonly): Mat2Like; + /** + * Returns Frobenius norm of a {@link Mat2} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2Like, a: Readonly, b: number): Mat2Like; + /** + * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2Like, a: Readonly, b: Readonly, scale: number): Mat2Like; + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @category Static + * + * @param L - the lower triangular matrix + * @param D - the diagonal matrix + * @param U - the upper triangular matrix + * @param a - the input matrix to factorize + */ + static LDU( + L: Mat2Like, + D: Readonly, + U: Mat2Like, + a: Readonly, + ): [Mat2Like, Readonly, Mat2Like]; + /** + * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 2x3 Matrix + */ +declare class Mat2d extends Float64Array { + #private; + /** + * Create a {@link Mat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat2d.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat2d} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat2d.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat2d} against another one + * Equivalent to `Mat2d.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat2d.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Translate this {@link Mat2d} by the given vector + * Equivalent to `Mat2d.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat2d} by the given angle around the given axis + * Equivalent to `Mat2d.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat2d.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat2d}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat2d} + * @category Static + * + * @returns A new {@link Mat2d} + */ + static create(): Mat2d; + /** + * Creates a new {@link Mat2d} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat2d} + */ + static clone(a: Readonly): Mat2d; + /** + * Copy the values from one {@link Mat2d} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat2dLike, a: Readonly): Mat2dLike; + /** + * Create a new {@link Mat2d} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat2d} + */ + static fromValues(...values: number[]): Mat2d; + /** + * Set the components of a {@link Mat2d} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat2dLike, ...values: number[]): Mat2dLike; + /** + * Set a {@link Mat2d} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat2dLike): Mat2dLike; + /** + * Inverts a {@link Mat2d} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat2dLike, a: Mat2dLike): Mat2dLike | null; + /** + * Calculates the determinant of a {@link Mat2d} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat2d}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.subtract} + * @category Static + */ + static sub(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Multiplies two {@link Mat2d}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Alias for {@link Mat2d.multiply} + * @category Static + */ + static mul(out: Mat2dLike, a: Readonly, b: Readonly): Mat2dLike; + /** + * Translate a {@link Mat2d} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Rotates a {@link Mat2d} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat2dLike, a: Readonly, rad: number): Mat2dLike; + /** + * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat2dLike, a: Readonly, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Creates a {@link Mat2d} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat2dLike, rad: number): Mat2dLike; + /** + * Creates a {@link Mat2d} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat2d} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat2dLike, v: Readonly): Mat2dLike; + /** + * Returns Frobenius norm of a {@link Mat2d} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat2d} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat2dLike, a: Readonly, b: number): Mat2dLike; + /** + * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat2dLike, a: Readonly, b: Readonly, scale: number): Mat2dLike; + /** + * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat2d}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat2d} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 3x3 Matrix + */ +declare class Mat3 extends Float64Array { + #private; + /** + * Create a {@link Mat3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat3.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat3} against another one + * Equivalent to `Mat3.multiply(this, this, b);` + * @category Methods + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat3} + * Equivalent to `Mat3.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat3} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat3} by the given vector + * Equivalent to `Mat3.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat3} by the given angle around the given axis + * Equivalent to `Mat3.rotate(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotate(rad: number): this; + /** + * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat3.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec2} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat3} + * @category Static + * + * @returns A new {@link Mat3} + */ + static create(): Mat3; + /** + * Creates a new {@link Mat3} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat3} + */ + static clone(a: Readonly): Mat3; + /** + * Copy the values from one {@link Mat3} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Create a new {@link Mat3} with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat3} + */ + static fromValues(...values: number[]): Mat3; + /** + * Set the components of a {@link Mat3} to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat3Like, ...values: number[]): Mat3Like; + /** + * Set a {@link Mat3} to the identity matrix + * @category Static + * + * @param out - The receiving matrix + * @returns `out` + */ + static identity(out: Mat3Like): Mat3Like; + /** + * Transpose the values of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Inverts a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat3Like, a: Mat3Like): Mat3Like | null; + /** + * Calculates the adjugate of a {@link Mat3} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat3Like, a: Mat3Like): Mat3Like; + /** + * Calculates the determinant of a {@link Mat3} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Adds two {@link Mat3}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.subtract} + * @category Static + */ + static sub(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Multiplies two {@link Mat3}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Alias for {@link Mat3.multiply} + * @category Static + */ + static mul(out: Mat3Like, a: Readonly, b: Readonly): Mat3Like; + /** + * Translate a {@link Mat3} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Rotates a {@link Mat3} by the given angle + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotate(out: Mat3Like, a: Readonly, rad: number): Mat3Like; + /** + * Scales the {@link Mat3} by the dimensions in the given {@link Vec2} + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec2} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat3Like, a: Readonly, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Creates a {@link Mat3} from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromRotation(out: Mat3Like, rad: number): Mat3Like; + /** + * Creates a {@link Mat3} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat3Like, v: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat2d} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 2x3 matrix + * @returns `out` + */ + static fromMat2d(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a {@link Mat3} from the given quaternion + * @category Static + * + * @param out - {@link Mat3} receiving operation result + * @param q - {@link Quat} to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat3Like, q: Readonly): Mat3Like; + /** + * Copies the upper-left 3x3 values of a {@link Mat4} into the given + * {@link Mat3}. + * @category Static + * + * @param out - the receiving 3x3 matrix + * @param a - the source 4x4 matrix + * @returns `out` + */ + static fromMat4(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * @category Static + * + * @param {mat3} out mat3 receiving operation result + * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out: Mat3Like, a: Readonly): Mat3Like | null; + /** + * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat3Like, a: Readonly): Mat3Like; + /** + * Generates a 2D projection matrix with the given bounds + * @category Static + * + * @param out mat3 frustum matrix will be written into + * @param width Width of your gl context + * @param height Height of gl context + * @returns `out` + */ + static projection(out: Mat3Like, width: number, height: number): Mat3Like; + /** + * Returns Frobenius norm of a {@link Mat3} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Multiply each element of a {@link Mat3} by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat3Like, a: Readonly, b: number): Mat3Like; + /** + * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat3Like, a: Readonly, b: Readonly, scale: number): Mat3Like; + /** + * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat3}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat3} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * A 4x4 Matrix + */ +declare class Mat4 extends Float64Array { + #private; + /** + * Create a {@link Mat4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Mat4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Mat4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity matrix + * Equivalent to Mat4.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies this {@link Mat4} against another one + * Equivalent to `Mat4.multiply(this, this, b);` + * @category Methods + * + * @param b - The second operand + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Mat4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Transpose this {@link Mat4} + * Equivalent to `Mat4.transpose(this, this);` + * @category Methods + * + * @returns `this` + */ + transpose(): this; + /** + * Inverts this {@link Mat4} + * Equivalent to `Mat4.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Translate this {@link Mat4} by the given vector + * Equivalent to `Mat4.translate(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to translate by + * @returns `this` + */ + translate(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the given axis + * Equivalent to `Mat4.rotate(this, this, rad, axis);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `this` + */ + rotate(rad: number, axis: Readonly): this; + /** + * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization + * Equivalent to `Mat4.scale(this, this, v);` + * @category Methods + * + * @param v - The {@link Vec3} to scale the matrix by + * @returns `this` + */ + scale(v: Readonly): this; + /** + * Rotates this {@link Mat4} by the given angle around the X axis + * Equivalent to `Mat4.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Y axis + * Equivalent to `Mat4.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates this {@link Mat4} by the given angle around the Z axis + * Equivalent to `Mat4.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - the angle to rotate the matrix by + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveNO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);` + * @category Methods + * + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `this` + */ + perspectiveZO(fovy: number, aspect: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoNO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * Generates a orthogonal projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);` + * @category Methods + * + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `this` + */ + orthoZO(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Mat4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, identity {@link Mat4} + * @category Static + * + * @returns A new {@link Mat4} + */ + static create(): Mat4; + /** + * Creates a new {@link Mat4} initialized with values from an existing matrix + * @category Static + * + * @param a - Matrix to clone + * @returns A new {@link Mat4} + */ + static clone(a: Readonly): Mat4; + /** + * Copy the values from one {@link Mat4} to another + * @category Static + * + * @param out - The receiving Matrix + * @param a - Matrix to copy + * @returns `out` + */ + static copy(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Create a new mat4 with the given values + * @category Static + * + * @param values - Matrix components + * @returns A new {@link Mat4} + */ + static fromValues(...values: number[]): Mat4; + /** + * Set the components of a mat4 to the given values + * @category Static + * + * @param out - The receiving matrix + * @param values - Matrix components + * @returns `out` + */ + static set(out: Mat4Like, ...values: number[]): Mat4Like; + /** + * Set a {@link Mat4} to the identity matrix + * @category Static + * + * @param out - The receiving Matrix + * @returns `out` + */ + static identity(out: Mat4Like): Mat4Like; + /** + * Transpose the values of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static transpose(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Inverts a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` or `null` if the matrix is not invertible + */ + static invert(out: Mat4Like, a: Mat4Like): Mat4Like | null; + /** + * Calculates the adjugate of a {@link Mat4} + * @category Static + * + * @param out - the receiving matrix + * @param a - the source matrix + * @returns `out` + */ + static adjoint(out: Mat4Like, a: Mat4Like): Mat4Like; + /** + * Calculates the determinant of a {@link Mat4} + * @category Static + * + * @param a - the source matrix + * @returns determinant of a + */ + static determinant(a: Readonly): number; + /** + * Multiplies two {@link Mat4}s + * @category Static + * + * @param out - The receiving Matrix + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.multiply} + * @category Static + */ + static mul(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Translate a {@link Mat4} by the given vector + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param v - the {@link Vec3} to scale the matrix by + * @returns `out` + **/ + static scale(out: Mat4Like, a: Readonly, v: Readonly): Mat4Like; + /** + * Rotates a {@link Mat4} by the given angle around the given axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if axis has a length of 0 + */ + static rotate(out: Mat4Like, a: Readonly, rad: number, axis: Readonly): Mat4Like | null; + /** + * Rotates a matrix by the given angle around the X axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateX(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Y axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateY(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Rotates a matrix by the given angle around the Z axis + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to rotate + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static rotateZ(out: Mat4Like, a: Readonly, rad: number): Mat4Like; + /** + * Creates a {@link Mat4} from a vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Translation vector + * @returns `out` + */ + static fromTranslation(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a vector scaling + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param v - Scaling vector + * @returns `out` + */ + static fromScaling(out: Mat4Like, v: Readonly): Mat4Like; + /** + * Creates a {@link Mat4} from a given angle around a given axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * ``` + * @category Static + * + * @param out - {@link Mat4} receiving operation result + * @param rad - the angle to rotate the matrix by + * @param axis - the axis to rotate around + * @returns `out` or `null` if `axis` has a length of 0 + */ + static fromRotation(out: Mat4Like, rad: number, axis: Readonly): Mat4Like | null; + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromXRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromYRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param rad - the angle to rotate the matrix by + * @returns `out` + */ + static fromZRotation(out: Mat4Like, rad: number): Mat4Like; + /** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Mat4Like, q: Readonly, v: Readonly): Mat4Like; + /** + * Sets a {@link Mat4} from a {@link Quat2}. + * @category Static + * + * @param out - Matrix + * @param a - Dual Quaternion + * @returns `out` + */ + static fromQuat2(out: Mat4Like, a: Quat2Like): Mat4Like; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` or `null` if the matrix is not invertible + */ + static normalFromMat4(out: Mat4Like, a: Readonly): Mat4Like | null; + /** + * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4} + * This version omits the calculation of the constant factor (1/determinant), so + * any normals transformed with it will need to be renormalized. + * From https://stackoverflow.com/a/27616419/25968 + * @category Static + * + * @param out - Matrix receiving operation result + * @param a - Mat4 to derive the normal matrix from + * @returns `out` + */ + static normalFromMat4Fast(out: Mat4Like, a: Readonly): Mat4Like; + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive translation component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getTranslation(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns the scaling factor component of a transformation + * matrix. If a matrix is built with fromRotationTranslationScale + * with a normalized Quaternion parameter, the returned vector will be + * the same as the scaling vector + * originally supplied. + * @category Static + * + * @param {vec3} out Vector to receive scaling factor component + * @param {ReadonlyMat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ + static getScaling(out: Vec3Like, mat: Readonly): Vec3Like; + /** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @category Static + * + * @param out - Quaternion to receive the rotation component + * @param mat - Matrix to be decomposed (input) + * @return `out` + */ + static getRotation(out: QuatLike, mat: Readonly): QuatLike; + /** + * Decomposes a transformation matrix into its rotation, translation + * and scale components. Returns only the rotation component + * @category Static + * + * @param out_r - Quaternion to receive the rotation component + * @param out_t - Vector to receive the translation vector + * @param out_s - Vector to receive the scaling factor + * @param mat - Matrix to be decomposed (input) + * @returns `out_r` + */ + static decompose(out_r: QuatLike, out_t: Vec3Like, out_s: Vec3Like, mat: Readonly): QuatLike; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @returns `out` + */ + static fromRotationTranslationScale( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + ): Mat4Like; + /** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the + * given origin. This is equivalent to (but much faster than): + * ```js + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * let quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * ``` + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Rotation quaternion + * @param v - Translation vector + * @param s - Scaling vector + * @param o - The origin vector around which to scale and rotate + * @returns `out` + */ + static fromRotationTranslationScaleOrigin( + out: Mat4Like, + q: Readonly, + v: Readonly, + s: Readonly, + o: Readonly, + ): Mat4Like; + /** + * Calculates a 4x4 matrix from the given quaternion + * @category Static + * + * @param out - mat4 receiving operation result + * @param q - Quaternion to create matrix from + * @returns `out` + */ + static fromQuat(out: Mat4Like, q: Readonly): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.frustumNO} + * @category Static + * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly + */ + static frustum( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a frustum matrix with the given bounds + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static frustumZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far?: number, + ): Mat4Like; + /** + * Generates a perspective projection matrix with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], + * which matches WebGL/OpenGL's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveNO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Alias for {@link Mat4.perspectiveNO} + * @category Static + * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly + */ + static perspective(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix suitable for WebGPU with the given bounds. + * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], + * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. + * Passing null/undefined/no value for far will generate infinite projection matrix. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fovy - Vertical field of view in radians + * @param aspect - Aspect ratio. typically viewport width/height + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum, can be null or Infinity + * @returns `out` + */ + static perspectiveZO(out: Mat4Like, fovy: number, aspect: number, near: number, far?: number): Mat4Like; + /** + * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating + * projection matrices to be used with the still experimental WebVR API. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + * @deprecated + */ + static perspectiveFromFieldOfView( + out: Mat4Like, + fov: { + upDegrees: number; + downDegrees: number; + leftDegrees: number; + rightDegrees: number; + }, + near: number, + far: number, + ): Mat4Like; + /** + * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoNO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Alias for {@link Mat4.orthoNO} + * @category Static + * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly + */ + static ortho( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a + * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param left - Left bound of the frustum + * @param right - Right bound of the frustum + * @param bottom - Bottom bound of the frustum + * @param top - Top bound of the frustum + * @param near - Near bound of the frustum + * @param far - Far bound of the frustum + * @returns `out` + */ + static orthoZO( + out: Mat4Like, + left: number, + right: number, + bottom: number, + top: number, + near: number, + far: number, + ): Mat4Like; + /** + * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that + * actually makes an object look at another object, you should use targetTo instead. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param center - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static lookAt(out: Mat4Like, eye: Readonly, center: Readonly, up: Readonly): Mat4Like; + /** + * Generates a matrix that makes something look at something else. + * @category Static + * + * @param out - mat4 frustum matrix will be written into + * @param eye - Position of the viewer + * @param target - Point the viewer is looking at + * @param up - vec3 pointing up + * @returns `out` + */ + static targetTo(out: Mat4Like, eye: Readonly, target: Readonly, up: Readonly): Mat4Like; + /** + * Returns Frobenius norm of a {@link Mat4} + * @category Static + * + * @param a - the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + static frob(a: Readonly): number; + /** + * Adds two {@link Mat4}'s + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Subtracts matrix b from matrix a + * @category Static + * + * @param out - the receiving matrix + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Alias for {@link Mat4.subtract} + * @category Static + */ + static sub(out: Mat4Like, a: Readonly, b: Readonly): Mat4Like; + /** + * Multiply each element of the matrix by a scalar. + * @category Static + * + * @param out - the receiving matrix + * @param a - the matrix to scale + * @param b - amount to scale the matrix's elements by + * @returns `out` + */ + static multiplyScalar(out: Mat4Like, a: Readonly, b: number): Mat4Like; + /** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b's elements by before adding + * @returns `out` + */ + static multiplyScalarAndAdd(out: Mat4Like, a: Readonly, b: Readonly, scale: number): Mat4Like; + /** + * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===). + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether two {@link Mat4}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first matrix. + * @param b - The second matrix. + * @returns True if the matrices are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a {@link Mat4} + * @category Static + * + * @param a - matrix to represent as a string + * @returns string representation of the matrix + */ + static str(a: Readonly): string; +} + +/** + * Quaternion + */ +declare class Quat extends Float64Array { + #private; + /** + * Create a {@link Quat}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the quaternion. Equivalent to `this[0];` + * @category Quaternion Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the quaternion. Equivalent to `this[1];` + * @category Quaternion Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the quaternion. Equivalent to `this[2];` + * @category Quaternion Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the quaternion. Equivalent to `this[3];` + * @category Quaternion Components + */ + get w(): number; + set w(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Quat.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Quat.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Quat.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat} into `this`. + * @category Methods + * + * @param a the source quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Set `this` to the identity quaternion + * Equivalent to Quat.identity(this) + * @category Methods + * + * @returns `this` + */ + identity(): this; + /** + * Multiplies `this` by a {@link Quat}. + * Equivalent to `Quat.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Quat.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Rotates `this` by the given angle about the X axis + * Equivalent to `Quat.rotateX(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateX(rad: number): this; + /** + * Rotates `this` by the given angle about the Y axis + * Equivalent to `Quat.rotateY(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateY(rad: number): this; + /** + * Rotates `this` by the given angle about the Z axis + * Equivalent to `Quat.rotateZ(this, this, rad);` + * @category Methods + * + * @param rad - angle (in radians) to rotate + * @returns `this` + */ + rotateZ(rad: number): this; + /** + * Inverts `this` + * Equivalent to `Quat.invert(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Scales `this` by a scalar number + * Equivalent to `Quat.scale(this, this, scale);` + * @category Methods + * + * @param scale - amount to scale the vector by + * @returns `this` + */ + scale(scale: number): QuatLike; + /** + * Calculates the dot product of `this` and another {@link Quat} + * Equivalent to `Quat.dot(this, b);` + * @category Methods + * + * @param b - the second operand + * @returns dot product of `this` and b + */ + dot(b: Readonly): number; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity quat + * @category Static + * + * @returns a new quaternion + */ + static create(): Quat; + /** + * Set a quat to the identity quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * @category Static + * + * @param out - the receiving quaternion + * @param axis - the axis around which to rotate + * @param rad - the angle in radians + * @returns `out` + **/ + static setAxisAngle(out: QuatLike, axis: Readonly, rad: number): QuatLike; + /** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as provided in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @category Static + * + * @param out_axis - Vector receiving the axis of rotation + * @param q - Quaternion to be decomposed + * @return Angle, in radians, of the rotation + */ + static getAxisAngle(out_axis: Vec3Like, q: Readonly): number; + /** + * Gets the angular distance between two unit quaternions + * @category Static + * + * @param {ReadonlyQuat} a Origin unit quaternion + * @param {ReadonlyQuat} b Destination unit quaternion + * @return {Number} Angle, in radians, between the two quaternions + */ + static getAngle(a: Readonly, b: Readonly): number; + /** + * Multiplies two quaternions. + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Rotates a quaternion by the given angle about the X axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Y axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Rotates a quaternion by the given angle about the Z axis + * @category Static + * + * @param out - quat receiving operation result + * @param a - quat to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: QuatLike, a: Readonly, rad: number): QuatLike; + /** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate W component of + * @returns `out` + */ + static calculateW(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the exponential of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static exp(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the natural logarithm of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @returns `out` + */ + static ln(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculate the scalar power of a unit quaternion. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate the exponential of + * @param b - amount to scale the quaternion by + * @returns `out` + */ + static pow(out: QuatLike, a: Readonly, b: number): QuatLike; + /** + * Performs a spherical linear interpolation between two quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Generates a random unit quaternion + * @category Static + * + * @param out - the receiving quaternion + * @returns `out` + */ + /** + * Calculates the inverse of a quat + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate inverse of + * @returns `out` + */ + static invert(out: QuatLike, a: Readonly): QuatLike; + /** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result. + * @category Static + * + * @param out - the receiving quaternion + * @param a - quat to calculate conjugate of + * @returns `out` + */ + static conjugate(out: QuatLike, a: Readonly): QuatLike; + /** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to re-normalize the quaternion yourself where necessary. + * @category Static + * + * @param out - the receiving quaternion + * @param m - rotation matrix + * @returns `out` + */ + static fromMat3(out: QuatLike, m: Readonly): QuatLike; + /** + * Creates a quaternion from the given euler angle x, y, z. + * @category Static + * + * @param out - the receiving quaternion + * @param x - Angle to rotate around X axis in degrees. + * @param y - Angle to rotate around Y axis in degrees. + * @param z - Angle to rotate around Z axis in degrees. + * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx. + * @returns `out` + */ + static fromEuler(out: QuatLike, x: number, y: number, z: number, order?: string): QuatLike; + /** + * Returns a string representation of a quatenion + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Creates a new quat initialized with values from an existing quaternion + * @category Static + * + * @param a - quaternion to clone + * @returns a new quaternion + */ + static clone(a: Readonly): Quat; + /** + * Creates a new quat initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new quaternion + */ + static fromValues(x: number, y: number, z: number, w: number): Quat; + /** + * Copy the values from one quat to another + * @category Static + * + * @param out - the receiving quaternion + * @param a - the source quaternion + * @returns `out` + */ + static copy(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the components of a {@link Quat} to the given values + * @category Static + * + * @param out - the receiving quaternion + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: QuatLike, x: number, y: number, z: number, w: number): QuatLike; + /** + * Adds two {@link Quat}'s + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Alias for {@link Quat.multiply} + * @category Static + */ + static mul(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Scales a quat by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param b - amount to scale the vector by + * @returns `out` + */ + static scale(out: QuatLike, a: Readonly, scale: number): QuatLike; + /** + * Calculates the dot product of two quat's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two quat's + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: QuatLike, a: Readonly, b: Readonly, t: number): QuatLike; + /** + * Calculates the magnitude (length) of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat.magnitude} + * @category Static + * @deprecated Use {@link Quat.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat} + * @category Static + * + * @param a - quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat} + * @category Static + * + * @param out - the receiving quaternion + * @param a - quaternion to normalize + * @returns `out` + */ + static normalize(out: QuatLike, a: Readonly): QuatLike; + /** + * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first quaternion. + * @param b - The second quaternion. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the quaternions have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * @category Static + * + * @param out - the receiving quaternion. + * @param a - the initial vector + * @param b - the destination vector + * @returns `out` + */ + static rotationTo(out: QuatLike, a: Readonly, b: Readonly): QuatLike; + /** + * Performs a spherical linear interpolation with two control points + * @category Static + * + * @param out - the receiving quaternion + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static sqlerp( + out: QuatLike, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): QuatLike; + /** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * @category Static + * + * @param out - The receiving quaternion + * @param view - the vector representing the viewing direction + * @param right - the vector representing the local `right` direction + * @param up - the vector representing the local `up` direction + * @returns `out` + */ + static setAxes(out: QuatLike, view: Readonly, right: Readonly, up: Readonly): QuatLike; +} + +/** + * Dual Quaternion + */ +declare class Quat2 extends Float64Array { + #private; + /** + * Create a {@link Quat2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * A string representation of `this` + * Equivalent to `Quat2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Quat2} into `this`. + * @category Methods + * + * @param a the source dual quaternion + * @returns `this` + */ + copy(a: Readonly): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Quat2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new identity {@link Quat2} + * @category Static + * + * @returns a new dual quaternion [real -> rotation, dual -> translation] + */ + static create(): Quat2; + /** + * Creates a {@link Quat2} quat initialized with values from an existing quaternion + * @category Static + * + * @param a - dual quaternion to clone + * @returns a new dual quaternion + */ + static clone(a: Quat2Like): Quat2; + /** + * Creates a new {@link Quat2} initialized with the given values + * @category Static + * + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns a new dual quaternion + */ + static fromValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2; + /** + * Creates a new {@link Quat2} from the given values (quat and translation) + * @category Static + * + * @param x1 - X component (rotation) + * @param y1 - Y component (rotation) + * @param z1 - Z component (rotation) + * @param w1 - W component (rotation) + * @param x2 - X component (translation) + * @param y2 - Y component (translation) + * @param z2 - Z component (translation) + * @returns a new dual quaternion + */ + static fromRotationTranslationValues( + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + ): Quat2; + /** + * Sets a {@link Quat2} from a quaternion and a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @param t - translation vector + * @returns `out` + */ + static fromRotationTranslation(out: Quat2Like, q: Readonly, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a translation + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param t - translation vector + * @returns `out` + */ + static fromTranslation(out: Quat2Like, t: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param q - a normalized quaternion + * @returns `out` + */ + static fromRotation(out: Quat2Like, q: Readonly): Quat2Like; + /** + * Sets a {@link Quat2} from a quaternion + * @category Static + * + * @param out - dual quaternion receiving operation result + * @param a - the matrix + * @returns `out` + */ + static fromMat4(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Copy the values from one {@link Quat2} to another + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the source dual quaternion + * @returns `out` + */ + static copy(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set a {@link Quat2} to the identity dual quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @returns `out` + */ + static identity(out: QuatLike): QuatLike; + /** + * Set the components of a {@link Quat2} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x1 - 1st X component + * @param y1 - 1st Y component + * @param z1 - 1st Z component + * @param w1 - 1st W component + * @param x2 - 2nd X component + * @param y2 - 2nd Y component + * @param z2 - 2nd Z component + * @param w2 - 2nd W component + * @returns `out` + */ + static set( + out: Quat2Like, + x1: number, + y1: number, + z1: number, + w1: number, + x2: number, + y2: number, + z2: number, + w2: number, + ): Quat2Like; + /** + * Gets the real part of a dual quat + * @category Static + * + * @param out - real part + * @param a - Dual Quaternion + * @return `out` + */ + static getReal(out: QuatLike, a: Readonly): QuatLike; + /** + * Gets the dual part of a dual quat + * @category Static + * + * @param out - dual part + * @param a - Dual Quaternion + * @return `out` + */ + static getDual(out: QuatLike, a: Readonly): QuatLike; + /** + * Set the real component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the real part + * @return `out` + */ + static setReal(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Set the dual component of a {@link Quat2} to the given quaternion + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - a quaternion representing the dual part + * @return `out` + */ + static setDual(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Gets the translation of a normalized {@link Quat2} + * @category Static + * + * @param out - the receiving translation vector + * @param a - Dual Quaternion to be decomposed + * @return `out` + */ + static getTranslation(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Translates a {@link Quat2} by the given vector + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to translate + * @param v - vector to translate by + * @returns `out` + */ + static translate(out: Quat2Like, a: Readonly, v: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around the X axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateX(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Y axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateY(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} around the Z axis + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param rad - angle (in radians) to rotate + * @returns `out` + */ + static rotateZ(out: Quat2Like, a: Readonly, rad: number): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (a * q) + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param q - quaternion to rotate by + * @returns `out` + */ + static rotateByQuatAppend(out: Quat2Like, a: Readonly, q: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} by a given quaternion (q * a) + * @category Static + * + * @param out - the receiving dual quaternion + * @param q - quaternion to rotate by + * @param a - the dual quaternion to rotate + * @returns `out` + */ + static rotateByQuatPrepend(out: Quat2Like, q: Readonly, a: Readonly): Quat2Like; + /** + * Rotates a {@link Quat2} around a given axis. Does the normalization automatically + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the dual quaternion to rotate + * @param axis - the axis to rotate around + * @param rad - how far the rotation should be + * @returns `out` + */ + static rotateAroundAxis(out: Quat2Like, a: Readonly, axis: Readonly, rad: number): Quat2Like; + /** + * Adds two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static add(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Multiplies two {@link Quat2}s + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - the first operand + * @param b - the second operand + * @returns {quat2} out + */ + static multiply(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Alias for {@link Quat2.multiply} + * @category Static + */ + static mul(out: Quat2Like, a: Readonly, b: Readonly): Quat2Like; + /** + * Scales a {@link Quat2} by a scalar value + * @category Static + * + * @param out - the receiving dual quaterion + * @param a - the dual quaternion to scale + * @param b - scalar value to scale the dual quaterion by + * @returns `out` + */ + static scale(out: Quat2Like, a: Readonly, b: number): Quat2Like; + /** + * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts) + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Performs a linear interpolation between two {@link Quat2}s + * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`) + * @category Static + * + * @param out - the receiving dual quat + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Quat2Like, a: Readonly, b: Readonly, t: number): Quat2Like; + /** + * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quat to calculate inverse of + * @returns `out` + */ + static invert(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than + * {@link Quat2.invert} and produces the same result. + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to calculate conjugate of + * @returns `out` + */ + static conjugate(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Calculates the magnitude (length) of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Quat2.magnitude} + * @category Static + * @deprecated Use {@link Quat2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Quat2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Normalize a {@link Quat2} + * @category Static + * + * @param out - the receiving dual quaternion + * @param a - dual quaternion to normalize + * @returns `out` + */ + static normalize(out: Quat2Like, a: Readonly): Quat2Like; + /** + * Returns a string representation of a {@link Quat2} + * @category Static + * + * @param a - dual quaternion to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the {@link Quat2}s have approximately the same elements in the same position. + * @category Static + * + * @param a - The first dual quaternion. + * @param b - The second dual quaternion. + * @returns True if the dual quaternions are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 2 Dimensional Vector + */ +declare class Vec2 extends Float64Array { + /** + * Create a {@link Vec2}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec2.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec2.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec2.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec2.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec2.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec2} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec2} to `this`. + * Equivalent to `Vec2.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec2} from `this`. + * Equivalent to `Vec2.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec2.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec2}. + * Equivalent to `Vec2.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec2.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec2}. + * Equivalent to `Vec2.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec2.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec2.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec2} and `this`. + * Equivalent to `Vec2.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec2.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec2.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec2.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec2.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec2}. + * Equivalent to `Vec2.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec2.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec2}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec2} + * @category Static + * + * @returns A new 2D vector + */ + static create(): Vec2; + /** + * Creates a new {@link Vec2} initialized with values from an existing vector + * @category Static + * + * @param a - Vector to clone + * @returns A new 2D vector + */ + static clone(a: Readonly): Vec2; + /** + * Creates a new {@link Vec2} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @returns A new 2D vector + */ + static fromValues(x: number, y: number): Vec2; + /** + * Copy the values from one {@link Vec2} to another + * @category Static + * + * @param out - the receiving vector + * @param a - The source vector + * @returns `out` + */ + static copy(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Set the components of a {@link Vec2} to the given values + * @category Static + * + * @param out - The receiving vector + * @param x - X component + * @param y - Y component + * @returns `out` + */ + static set(out: Vec2Like, x: number, y: number): Vec2Like; + /** + * Adds two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static subtract(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.subtract} + * @category Static + */ + static sub(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Multiplies two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static multiply(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.multiply} + * @category Static + */ + static mul(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Divides two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static divide(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Alias for {@link Vec2.divide} + * @category Static + */ + static div(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.ceil the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to ceil + * @returns `out` + */ + static ceil(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Math.floor the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to floor + * @returns `out` + */ + static floor(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the minimum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static min(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Returns the maximum of two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static max(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Math.round the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to round + * @returns `out` + */ + static round(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Scales a {@link Vec2} by a scalar number + * @category Static + * + * @param out - The receiving vector + * @param a - The vector to scale + * @param b - Amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec2Like, a: Readonly, b: number): Vec2Like; + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param scale - The amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec2Like, a: Readonly, b: Readonly, scale: number): Vec2Like; + /** + * Calculates the Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns distance between `a` and `b` + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Squared distance between `a` and `b` + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec2.distance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec2.magnitude} + * @category Static + * @deprecated Use {@link Vec2.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec2} + * @category Static + * + * @param a - Vector to calculate squared length of + * @returns Squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec2.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to negate + * @returns `out` + */ + static negate(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the inverse of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to invert + * @returns `out` + */ + static inverse(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Returns the absolute value of the components of a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Normalize a {@link Vec2} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to normalize + * @returns `out` + */ + static normalize(out: Vec2Like, a: Readonly): Vec2Like; + /** + * Calculates the dot product of two {@link Vec2}s + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns Dot product of `a` and `b` + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two {@link Vec2}s + * Note that the cross product must by definition produce a 3D vector. + * For this reason there is also not instance equivalent for this function. + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static cross(out: Vec2Like, a: Readonly, b: Readonly): Vec2Like; + /** + * Performs a linear interpolation between two {@link Vec2}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @param t - Interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec2Like, a: Readonly, b: Readonly, t: number): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat2d} + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat2d(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat3} + * 3rd vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat3(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Transforms the {@link Vec2} with a {@link Mat4} + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out - The receiving vector + * @param a - The vector to transform + * @param m - Matrix to transform with + * @returns `out` + * @category Static + */ + static transformMat4(out: Vec2Like, a: Readonly, m: Readonly): Vec2Like; + /** + * Rotate a 2D vector + * @category Static + * + * @param out - The receiving {@link Vec2} + * @param a - The {@link Vec2} point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotate(out: Vec2Like, a: Readonly, b: Readonly, rad: number): Vec2Like; + /** + * Get the angle between two 2D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a {@link Vec2} to zero + * @category Static + * + * @param out - The receiving vector + * @returns `out` + */ + static zero(out: Vec2Like): Vec2Like; + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors components are ===, `false` otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns `true` if the vectors are approximately equal, `false` otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - Vector to represent as a string + * @returns String representation of the vector + */ + static str(a: Readonly): string; +} + +/** + * 3 Dimensional Vector + */ +declare class Vec3 extends Float64Array { + /** + * Create a {@link Vec3}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec3.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec3.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * The squared magnitude (length) of `this`. + * Equivalent to `Vec3.squaredMagnitude(this);` + * + * @category Accessors + */ + get squaredMagnitude(): number; + /** + * Alias for {@link Vec3.squaredMagnitude} + * + * @category Accessors + */ + get sqrMag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec3.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec3} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec3} to `this`. + * Equivalent to `Vec3.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec3} from `this`. + * Equivalent to `Vec3.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec3.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec3}. + * Equivalent to `Vec3.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec3.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec3}. + * Equivalent to `Vec3.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec3.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec3.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec3} and `this`. + * Equivalent to `Vec3.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec3.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec3.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to its absolute value. + * Equivalent to `Vec3.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec3}. + * Equivalent to `Vec3.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec3.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec3}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty vec3 + * @category Static + * + * @returns a new 3D vector + */ + static create(): Vec3; + /** + * Creates a new vec3 initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 3D vector + */ + static clone(a: Readonly): Vec3; + /** + * Calculates the magnitude (length) of a {@link Vec3} + * @category Static + * + * @param a - Vector to calculate magnitude of + * @returns Magnitude of a + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs + * + * @param a - vector to calculate length of + * @returns length of a + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec3.magnitude} + * @category Static + * @deprecated Use {@link Vec3.mag} + */ + static len(a: Readonly): number; + /** + * Creates a new vec3 initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns a new 3D vector + */ + static fromValues(x: number, y: number, z: number): Vec3; + /** + * Copy the values from one vec3 to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Set the components of a vec3 to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @returns `out` + */ + static set(out: Vec3Like, x: number, y: number, z: number): Vec3Like; + /** + * Adds two {@link Vec3}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.subtract} + * @category Static + */ + static sub(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Multiplies two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.multiply} + * @category Static + */ + static mul(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Divides two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Alias for {@link Vec3.divide} + * @category Static + */ + static div(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Math.ceil the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Math.floor the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the minimum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Returns the maximum of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * symmetric round the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + /** + * Scales a vec3 by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec3Like, a: Readonly, scale: number): Vec3Like; + /** + * Adds two vec3's after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec3Like, a: Readonly, b: Readonly, scale: number): Vec3Like; + /** + * Calculates the Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec3.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared length of a vec3 + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec3.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly, b: Readonly): number; + /** + * Negates the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the inverse of the components of a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Returns the absolute value of the components of a {@link Vec3} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Normalize a vec3 + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec3Like, a: Readonly): Vec3Like; + /** + * Calculates the dot product of two vec3's + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Computes the cross product of two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static cross(out: Vec3Like, a: Readonly, b: Readonly): Vec3Like; + /** + * Performs a linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a spherical linear interpolation between two vec3's + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static slerp(out: Vec3Like, a: Readonly, b: Readonly, t: number): Vec3Like; + /** + * Performs a hermite interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static hermite( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Performs a bezier interpolation with two control points + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param c - the third operand + * @param d - the fourth operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static bezier( + out: Vec3Like, + a: Readonly, + b: Readonly, + c: Readonly, + d: Readonly, + t: number, + ): Vec3Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec3Like, a: Readonly, m: Readonly): Vec3Like; + /** + * Transforms the vec3 with a mat3. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - the 3x3 matrix to transform with + * @returns `out` + */ + static transformMat3(out: Vec3Like, a: Vec3Like, m: Mat3Like): Vec3Like; + /** + * Transforms the vec3 with a quat + * Can also be used for dual quaternions. (Multiply it with the real part) + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec3Like, a: Readonly, q: Readonly): Vec3Like; + /** + * Rotate a 3D vector around the x-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateX(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the y-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateY(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Rotate a 3D vector around the z-axis + * @category Static + * + * @param out - The receiving vec3 + * @param a - The vec3 point to rotate + * @param b - The origin of the rotation + * @param rad - The angle of rotation in radians + * @returns `out` + */ + static rotateZ(out: Vec3Like, a: Readonly, b: Readonly, rad: number): Vec3Like; + /** + * Get the angle between two 3D vectors + * @category Static + * + * @param a - The first operand + * @param b - The second operand + * @returns The angle in radians + */ + static angle(a: Readonly, b: Readonly): number; + /** + * Set the components of a vec3 to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec3Like): Vec3Like; + /** + * Returns a string representation of a vector + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * 4 Dimensional Vector + */ +declare class Vec4 extends Float64Array { + /** + * Create a {@link Vec4}. + * + * @category Constructor + */ + constructor(...values: [Readonly | ArrayBufferLike, number?] | number[]); + /** + * The x component of the vector. Equivalent to `this[0];` + * @category Vector Components + */ + get x(): number; + set x(value: number); + /** + * The y component of the vector. Equivalent to `this[1];` + * @category Vector Components + */ + get y(): number; + set y(value: number); + /** + * The z component of the vector. Equivalent to `this[2];` + * @category Vector Components + */ + get z(): number; + set z(value: number); + /** + * The w component of the vector. Equivalent to `this[3];` + * @category Vector Components + */ + get w(): number; + set w(value: number); + /** + * The r component of the vector. Equivalent to `this[0];` + * @category Color Components + */ + get r(): number; + set r(value: number); + /** + * The g component of the vector. Equivalent to `this[1];` + * @category Color Components + */ + get g(): number; + set g(value: number); + /** + * The b component of the vector. Equivalent to `this[2];` + * @category Color Components + */ + get b(): number; + set b(value: number); + /** + * The a component of the vector. Equivalent to `this[3];` + * @category Color Components + */ + get a(): number; + set a(value: number); + /** + * The magnitude (length) of this. + * Equivalent to `Vec4.magnitude(this);` + * + * Magnitude is used because the `length` attribute is already defined by + * TypedArrays to mean the number of elements in the array. + * + * @category Accessors + */ + get magnitude(): number; + /** + * Alias for {@link Vec4.magnitude} + * + * @category Accessors + */ + get mag(): number; + /** + * A string representation of `this` + * Equivalent to `Vec4.str(this);` + * + * @category Accessors + */ + get str(): string; + /** + * Copy the values from another {@link Vec4} into `this`. + * @category Methods + * + * @param a the source vector + * @returns `this` + */ + copy(a: Readonly): this; + /** + * Adds a {@link Vec4} to `this`. + * Equivalent to `Vec4.add(this, this, b);` + * @category Methods + * + * @param b - The vector to add to `this` + * @returns `this` + */ + add(b: Readonly): this; + /** + * Subtracts a {@link Vec4} from `this`. + * Equivalent to `Vec4.subtract(this, this, b);` + * @category Methods + * + * @param b - The vector to subtract from `this` + * @returns `this` + */ + subtract(b: Readonly): this; + /** + * Alias for {@link Vec4.subtract} + * @category Methods + */ + sub(b: Readonly): this; + /** + * Multiplies `this` by a {@link Vec4}. + * Equivalent to `Vec4.multiply(this, this, b);` + * @category Methods + * + * @param b - The vector to multiply `this` by + * @returns `this` + */ + multiply(b: Readonly): this; + /** + * Alias for {@link Vec4.multiply} + * @category Methods + */ + mul(b: Readonly): this; + /** + * Divides `this` by a {@link Vec4}. + * Equivalent to `Vec4.divide(this, this, b);` + * @category Methods + * + * @param b - The vector to divide `this` by + * @returns `this` + */ + divide(b: Readonly): this; + /** + * Alias for {@link Vec4.divide} + * @category Methods + */ + div(b: Readonly): this; + /** + * Scales `this` by a scalar number. + * Equivalent to `Vec4.scale(this, this, b);` + * @category Methods + * + * @param b - Amount to scale `this` by + * @returns `this` + */ + scale(b: number): this; + /** + * Calculates `this` scaled by a scalar value then adds the result to `this`. + * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);` + * @category Methods + * + * @param b - The vector to add to `this` + * @param scale - The amount to scale `b` by before adding + * @returns `this` + */ + scaleAndAdd(b: Readonly, scale: number): this; + /** + * Calculates the Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.distance(this, b);` + * @category Methods + * + * @param b - The vector to calculate the distance to + * @returns Distance between `this` and `b` + */ + distance(b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Methods + */ + dist(b: Readonly): number; + /** + * Calculates the squared Euclidean distance between another {@link Vec4} and `this`. + * Equivalent to `Vec4.squaredDistance(this, b);` + * @category Methods + * + * @param b The vector to calculate the squared distance to + * @returns Squared distance between `this` and `b` + */ + squaredDistance(b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Methods + */ + sqrDist(b: Readonly): number; + /** + * Negates the components of `this`. + * Equivalent to `Vec4.negate(this, this);` + * @category Methods + * + * @returns `this` + */ + negate(): this; + /** + * Inverts the components of `this`. + * Equivalent to `Vec4.inverse(this, this);` + * @category Methods + * + * @returns `this` + */ + invert(): this; + /** + * Sets each component of `this` to it's absolute value. + * Equivalent to `Vec4.abs(this, this);` + * @category Methods + * + * @returns `this` + */ + abs(): this; + /** + * Calculates the dot product of this and another {@link Vec4}. + * Equivalent to `Vec4.dot(this, b);` + * @category Methods + * + * @param b - The second operand + * @returns Dot product of `this` and `b` + */ + dot(b: Readonly): number; + /** + * Normalize `this`. + * Equivalent to `Vec4.normalize(this, this);` + * @category Methods + * + * @returns `this` + */ + normalize(): this; + /** + * @category Static + * + * @returns The number of bytes in a {@link Vec4}. + */ + static get BYTE_LENGTH(): number; + /** + * Creates a new, empty {@link Vec4} + * @category Static + * + * @returns a new 4D vector + */ + static create(): Vec4; + /** + * Creates a new {@link Vec4} initialized with values from an existing vector + * @category Static + * + * @param a - vector to clone + * @returns a new 4D vector + */ + static clone(a: Vec4Like): Vec4; + /** + * Creates a new {@link Vec4} initialized with the given values + * @category Static + * + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns a new 4D vector + */ + static fromValues(x: number, y: number, z: number, w: number): Vec4; + /** + * Copy the values from one {@link Vec4} to another + * @category Static + * + * @param out - the receiving vector + * @param a - the source vector + * @returns `out` + */ + static copy(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to the given values + * @category Static + * + * @param out - the receiving vector + * @param x - X component + * @param y - Y component + * @param z - Z component + * @param w - W component + * @returns `out` + */ + static set(out: Vec4Like, x: number, y: number, z: number, w: number): Vec4Like; + /** + * Adds two {@link Vec4}s + * @category Static + * + * @param out - The receiving vector + * @param a - The first operand + * @param b - The second operand + * @returns `out` + */ + static add(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Subtracts vector b from vector a + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static subtract(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.subtract} + * @category Static + */ + static sub(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Multiplies two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static multiply(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.multiply} + * @category Static + */ + static mul(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Divides two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static divide(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Alias for {@link Vec4.divide} + * @category Static + */ + static div(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.ceil the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to ceil + * @returns `out` + */ + static ceil(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Math.floor the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to floor + * @returns `out` + */ + static floor(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the minimum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static min(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Returns the maximum of two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @returns `out` + */ + static max(out: Vec4Like, a: Readonly, b: Readonly): Vec4Like; + /** + * Math.round the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to round + * @returns `out` + */ + static round(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Scales a {@link Vec4} by a scalar number + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to scale + * @param scale - amount to scale the vector by + * @returns `out` + */ + static scale(out: Vec4Like, a: Readonly, scale: number): Vec4Like; + /** + * Adds two {@link Vec4}'s after scaling the second operand by a scalar value + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param scale - the amount to scale b by before adding + * @returns `out` + */ + static scaleAndAdd(out: Vec4Like, a: Readonly, b: Readonly, scale: number): Vec4Like; + /** + * Calculates the Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns distance between a and b + */ + static distance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.distance} + * @category Static + */ + static dist(a: Readonly, b: Readonly): number; + /** + * Calculates the squared Euclidean distance between two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns squared distance between a and b + */ + static squaredDistance(a: Readonly, b: Readonly): number; + /** + * Alias for {@link Vec4.squaredDistance} + * @category Static + */ + static sqrDist(a: Readonly, b: Readonly): number; + /** + * Calculates the magnitude (length) of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate length of + * @returns length of `a` + */ + static magnitude(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + */ + static mag(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs + */ + static length(a: Readonly): number; + /** + * Alias for {@link Vec4.magnitude} + * @category Static + * @deprecated Use {@link Vec4.mag} + */ + static len(a: Readonly): number; + /** + * Calculates the squared length of a {@link Vec4} + * @category Static + * + * @param a - vector to calculate squared length of + * @returns squared length of a + */ + static squaredLength(a: Readonly): number; + /** + * Alias for {@link Vec4.squaredLength} + * @category Static + */ + static sqrLen(a: Readonly): number; + /** + * Negates the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to negate + * @returns `out` + */ + static negate(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the inverse of the components of a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to invert + * @returns `out` + */ + static inverse(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Returns the absolute value of the components of a {@link Vec4} + * @category Static + * + * @param out - The receiving vector + * @param a - Vector to compute the absolute values of + * @returns `out` + */ + static abs(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Normalize a {@link Vec4} + * @category Static + * + * @param out - the receiving vector + * @param a - vector to normalize + * @returns `out` + */ + static normalize(out: Vec4Like, a: Readonly): Vec4Like; + /** + * Calculates the dot product of two {@link Vec4}'s + * @category Static + * + * @param a - the first operand + * @param b - the second operand + * @returns dot product of a and b + */ + static dot(a: Readonly, b: Readonly): number; + /** + * Returns the cross-product of three vectors in a 4-dimensional space + * @category Static + * + * @param out the receiving vector + * @param u - the first vector + * @param v - the second vector + * @param w - the third vector + * @returns result + */ + static cross(out: Vec4Like, u: Readonly, v: Readonly, w: Readonly): Vec4Like; + /** + * Performs a linear interpolation between two {@link Vec4}'s + * @category Static + * + * @param out - the receiving vector + * @param a - the first operand + * @param b - the second operand + * @param t - interpolation amount, in the range [0-1], between the two inputs + * @returns `out` + */ + static lerp(out: Vec4Like, a: Readonly, b: Readonly, t: number): Vec4Like; + /** + * Generates a random vector with the given scale + * @category Static + * + * @param out - the receiving vector + * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns `out` + */ + /** + * Transforms the {@link Vec4} with a {@link Mat4}. + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param m - matrix to transform with + * @returns `out` + */ + static transformMat4(out: Vec4Like, a: Readonly, m: Readonly): Vec4Like; + /** + * Transforms the {@link Vec4} with a {@link Quat} + * @category Static + * + * @param out - the receiving vector + * @param a - the vector to transform + * @param q - quaternion to transform with + * @returns `out` + */ + static transformQuat(out: Vec4Like, a: Readonly, q: Readonly): Vec4Like; + /** + * Set the components of a {@link Vec4} to zero + * @category Static + * + * @param out - the receiving vector + * @returns `out` + */ + static zero(out: Vec4Like): Vec4Like; + /** + * Returns a string representation of a {@link Vec4} + * @category Static + * + * @param a - vector to represent as a string + * @returns string representation of the vector + */ + static str(a: Readonly): string; + /** + * Returns whether the vectors have exactly the same elements in the same position (when compared with ===) + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static exactEquals(a: Readonly, b: Readonly): boolean; + /** + * Returns whether the vectors have approximately the same elements in the same position. + * @category Static + * + * @param a - The first vector. + * @param b - The second vector. + * @returns True if the vectors are equal, false otherwise. + */ + static equals(a: Readonly, b: Readonly): boolean; +} + +/** + * To enable additional swizzle accessors for vector classes (64-bit) invoke the {@link EnableSwizzlesF64} function from + * the `gl-matrix/swizzle/f64` sub-path export. To enable ambient module declarations for IDE / Typescript support + * please see {@link gl-matrix/types/swizzle/f64}. + * + * To enable swizzling for the 32-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle}. + * + * @example + * ```ts + * import { Vec3 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * const vec = new Vec3(0, 1, 2); + * const vecSwizzled = vec.zyx; // Returns a new Vec3(2, 1, 0). + * ``` + * + * @packageDocumentation + */ +/** + * Enables Swizzle operations on {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / + * {@link gl-matrix/f64.Vec4 | Vec4} types from {@link gl-matrix/f64} (64-bit). + * + * Swizzle operations are performed by using the `.` operator in conjunction with any combination + * of between two and four component names, either from the set `xyzw` or `rgbw` (though not intermixed). + * They return a new vector with the same number of components as specified in the swizzle attribute. + * + * @example + * ```js + * import { Vec3 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * let v = new Vec3(0, 1, 2); + * + * v.yx; // returns new Vec2(1, 0) + * v.xzy; // returns new Vec3(0, 2, 1) + * v.zyxz; // returns new Vec4(2, 1, 0, 2) + * + * v.rgb; // returns new Vec3(0, 1, 2) + * v.rbg; // returns new Vec3(0, 2, 1) + * v.gg; // returns new Vec2(1, 1) + * ``` + */ +declare function EnableSwizzlesF64(): void; + +/** + * Ambient module declarations for `gl-matrix/f64` (64-bit) swizzle extensions for vector classes. + * + * When swizzle accessors via {@link gl-matrix/swizzle/f64.EnableSwizzlesF64 | EnableSwizzlesF64} are enabled include + * this sub-path export as a `side effect` import to add ambient module declarations for the additional accessors to + * {@link gl-matrix/f64.Vec2 | Vec2} / {@link gl-matrix/f64.Vec3 | Vec3} / {@link gl-matrix/f64.Vec4 | Vec4}. + * + * To enable swizzling for the 64-bit variation of `gl-matrix` please see {@link gl-matrix/swizzle/f64}. + * + * ```js + * import { Vec2 } from 'gl-matrix/f64'; + * import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64'; + * + * import 'gl-matrix/types/swizzle/f64'; + * + * EnableSwizzlesF64(); + * + * const vec = new Vec2(0, 1); + * + * // Swizzled instance - returns new Vec2(1, 0). + * const vecSwizzled = vec.yx; + * ``` + * + * @packageDocumentation + */ + +/** + * A type alias for Vec2 (64-bit). + * @hidden + */ +type Vec2Alias = Vec2; +/** + * A type alias for Vec3 (64-bit). + * @hidden + */ +type Vec3Alias = Vec3; +/** + * A type alias for Vec4 (64-bit). + * @hidden + */ +type Vec4Alias = Vec4; + +/** + * Vec2 swizzle extension accessors. + */ +interface Vec2 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; +} +/** + * Vec3 swizzle extension accessors. + */ +interface Vec3 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; +} +/** + * Vec4 swizzle extension accessors. + */ +interface Vec4 { + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gr(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get rb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get gb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get br(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bg(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get bb(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rrb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get grb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ggb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get brb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bgb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bbb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get xw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get yw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get zw(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wx(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wy(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get wz(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ww(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get xww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ywz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get yww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get zww(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wxw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wyw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wzw(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwx(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwy(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get wwz(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get www(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get xwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get yzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ywww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get zwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wxww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wywz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wyww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wzww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwxw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwyw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwzw(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwx(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwy(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwwz(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get wwww(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ra(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ga(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ba(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ar(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ag(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get ab(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec2 + */ + get aa(): Vec2Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get rab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get raa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get gaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bra(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get bab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get baa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get arb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get ara(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get agb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aga(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abr(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abg(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get abb(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aba(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aar(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aag(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aab(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec3 + */ + get aaa(): Vec3Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rrab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rraa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ragb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get rabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get raaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get grab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get graa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get ggaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get garb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get gaaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get brab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get braa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bgaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bbaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get barb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get bagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get babb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get baaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get argb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get arab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get araa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aggb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get agaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abrb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abra(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abgb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abbb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get abaa(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aarb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aara(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aagb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaga(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabr(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabg(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aabb(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaba(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaar(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaag(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaab(): Vec4Alias; + /** + * @category Swizzle Accessors (Optional) + * @returns New instance of swizzled Vec4 + */ + get aaaa(): Vec4Alias; +} + +/** + * Convert `radians` to `degrees`. + * + * @param value - Angle in `radians`. + * @returns Angle in `degrees`. + */ +declare function toDegree(value: number): number; +/** + * Convert `degrees` to `radians`. + * + * @param value - Angle in `degrees`. + * @returns Angle in `radians`. + */ +declare function toRadian(value: number): number; + +export { + EnableSwizzlesF64, + type FloatArray, + Mat2, + type Mat2Like, + Mat2d, + type Mat2dLike, + Mat3, + type Mat3Like, + Mat4, + type Mat4Like, + Quat, + Quat2, + type Quat2Like, + type QuatLike, + Vec2, + type Vec2Like, + Vec3, + type Vec3Like, + Vec4, + type Vec4Like, + toDegree, + toRadian, +}; diff --git a/dist-cdn/types/globals-f32.d.cts b/dist-cdn/types/globals-f32.d.cts new file mode 100644 index 00000000..adc8b408 --- /dev/null +++ b/dist-cdn/types/globals-f32.d.cts @@ -0,0 +1,7 @@ +import type * as libF32 from './gl-matrix-f32.d.cts'; + +declare global { + const glMatrix: typeof libF32; +} + +export {}; diff --git a/dist-cdn/types/globals-f64.d.cts b/dist-cdn/types/globals-f64.d.cts new file mode 100644 index 00000000..62ee1f7d --- /dev/null +++ b/dist-cdn/types/globals-f64.d.cts @@ -0,0 +1,7 @@ +import type * as libF64 from './gl-matrix-f64.d.cts'; + +declare global { + const glMatrixF64: typeof libF64; +} + +export {}; diff --git a/dist-cdn/umd/gl-matrix-f32.js b/dist-cdn/umd/gl-matrix-f32.js index 99160597..227cd9e9 100644 --- a/dist-cdn/umd/gl-matrix-f32.js +++ b/dist-cdn/umd/gl-matrix-f32.js @@ -91,10 +91,10 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } - function _superPropGet(t, e, o, r) { - var p = _get(_getPrototypeOf(t.prototype ), e, o); + function _superPropGet(t, o, e, r) { + var p = _get(_getPrototypeOf(t.prototype ), o, e); return "function" == typeof p ? function (t) { - return p.apply(o, t); + return p.apply(e, t); } : p; } function _toPrimitive(t, r) { diff --git a/dist-cdn/umd/gl-matrix-f32.js.map b/dist-cdn/umd/gl-matrix-f32.js.map index 83060cac..aec686f4 100644 --- a/dist-cdn/umd/gl-matrix-f32.js.map +++ b/dist-cdn/umd/gl-matrix-f32.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n V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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f32.js","sources":["../esm/2016/gl-matrix-f32.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f32/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float32Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f32/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float32Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float32Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f32/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float32Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f32/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float32Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float32Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f32/Vec3.ts\nvar Vec3 = class _Vec3 extends Float32Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f32/Vec4.ts\nvar Vec4 = class _Vec4 extends Float32Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f32/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float32Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float32Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float32Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float32Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float32Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float32Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float32Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f32/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float32Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float32Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float32Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f32/Vec2.ts\nvar Vec2 = class _Vec2 extends Float32Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float32Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/index.ts\nvar GLM_SWIZZLES_ENABLED_F32 = false;\nfunction EnableSwizzles() {\n if (GLM_SWIZZLES_ENABLED_F32) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F32 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzles,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n Mat2 as mat2,\n Mat2d as mat2d,\n Mat3 as mat3,\n Mat4 as mat4,\n Quat as quat,\n Quat2 as quat2,\n toDegree,\n toRadian,\n Vec2 as vec2,\n Vec3 as vec3,\n Vec4 as vec4\n};\n//# sourceMappingURL=gl-matrix-f32.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f32.min.js b/dist-cdn/umd/gl-matrix-f32.min.js index fef36b6a..2bcb18df 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.js +++ b/dist-cdn/umd/gl-matrix-f32.min.js @@ -91,10 +91,10 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } - function _superPropGet(t, e, o, r) { - var p = _get(_getPrototypeOf(t.prototype ), e, o); + function _superPropGet(t, o, e, r) { + var p = _get(_getPrototypeOf(t.prototype ), o, e); return "function" == typeof p ? function (t) { - return p.apply(o, t); + return p.apply(e, t); } : p; } function _toPrimitive(t, r) { diff --git a/dist-cdn/umd/gl-matrix-f32.min.js.map b/dist-cdn/umd/gl-matrix-f32.min.js.map index af91accf..53c26865 100644 --- a/dist-cdn/umd/gl-matrix-f32.min.js.map +++ b/dist-cdn/umd/gl-matrix-f32.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float32Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(r*I-s*P-a*Y)*Q,e[2]=(d*B-m*g+o*z)*Q,e[3]=(M*g-l*B-h*z)*Q,e[4]=(y*p-i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[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float32Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*xe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,N as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAmF;EAAA,MAAA,IAAAE,KAAA,CAAA;EAAAC,MAAAA,eAAA,OAAAH,CAAA,CAAA,CAAA;EAAA,MAAA,KAAA,IAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAApEC,CAAA,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;EAAAF,QAAAA,CAAA,CAAAE,IAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f32.min.js","sources":["../esm/2016/gl-matrix-f32.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float32Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float32Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float32Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float32Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float32Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float32Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float32Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float32Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float32Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c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e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float32Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float32Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float32Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float32Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float32Array(4)),Z(f,ce,new Float32Array(4)),Z(f,W,new Float32Array(9)),Z(f,U,new Float32Array(3)),Z(f,le,new Float32Array([1,0,0])),Z(f,he,new Float32Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float32Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float32Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float32Array(4)),Z(j,Le,new Float32Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float32Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float32Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function _e(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function tt(A){return A*Re}function nt(A){return A*xe}export{_e as EnableSwizzles,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,v as mat2,_ as mat2d,u as mat3,G as mat4,O as quat,J as quat2,tt as toDegree,nt as toRadian,N as vec2,T as vec3,q as vec4};\n//# sourceMappingURL=gl-matrix-f32.min.js.map\n"],"names":["ne","C","_Float32Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float32Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IAAmF;EAAA,MAAA,IAAAE,KAAA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) && null !== (t = _getPrototypeOf(t));); return t; } - function _superPropGet(t, e, o, r) { - var p = _get(_getPrototypeOf(t.prototype ), e, o); + function _superPropGet(t, o, e, r) { + var p = _get(_getPrototypeOf(t.prototype ), o, e); return "function" == typeof p ? function (t) { - return p.apply(o, t); + return p.apply(e, t); } : p; } function _toPrimitive(t, r) { diff --git a/dist-cdn/umd/gl-matrix-f64.js.map b/dist-cdn/umd/gl-matrix-f64.js.map index 77031bca..3ca88ac3 100644 --- a/dist-cdn/umd/gl-matrix-f64.js.map +++ b/dist-cdn/umd/gl-matrix-f64.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_TO_DEG;\n}\nfunction toRadian(value) {\n return value * GLM_DEG_TO_RAD;\n}\nexport {\n EnableSwizzlesF64,\n Mat2,\n Mat2d,\n Mat3,\n Mat4,\n Quat,\n Quat2,\n Vec2,\n Vec3,\n Vec4,\n toDegree,\n toRadian\n};\n//# sourceMappingURL=gl-matrix-f64.js.map\n"],"names":["GLM_EPSILON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,IAAMA,WAAA,GAAc,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f64.js","sources":["../esm/2016/gl-matrix-f64.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// src/common/index.ts\nvar GLM_EPSILON = 1e-6;\n\n// src/_lib/f64/Mat2.ts\nvar _IDENTITY_2X2;\nvar _Mat2 = class _Mat2 extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 4);\n }\n break;\n default:\n super(__privateGet(_Mat2, _IDENTITY_2X2));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat2} into `this`.\n *\n * @param a the source vector\n * @returns `this`\n * @category Methods\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2.identity(this)\n *\n * @returns `this`\n * @category Methods\n */\n identity() {\n this.set(__privateGet(_Mat2, _IDENTITY_2X2));\n return this;\n }\n /**\n * Multiplies this {@link Mat2} against another one\n * Equivalent to `Mat2.multiply(this, this, b);`\n *\n * @param b - The second operand\n * @returns `this`\n * @category Methods\n */\n multiply(b) {\n return _Mat2.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat2}\n * Equivalent to `Mat2.transpose(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n transpose() {\n return _Mat2.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat2}\n * Equivalent to `Mat4.invert(this, this);`\n *\n * @returns `this`\n * @category Methods\n */\n invert() {\n return _Mat2.invert(this, this);\n }\n /**\n * Scales this {@link Mat2} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2.scale(this, this, v);`\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n * @category Methods\n */\n scale(v) {\n return _Mat2.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat2} by the given angle around the given axis\n * Equivalent to `Mat2.rotate(this, this, rad);`\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n * @category Methods\n */\n rotate(rad) {\n return _Mat2.rotate(this, this, rad);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2}\n * @category Static\n *\n * @returns A new {@link Mat2}\n */\n static create() {\n return new _Mat2();\n }\n /**\n * Creates a new {@link Mat2} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2}\n */\n static clone(a) {\n return new _Mat2(a);\n }\n /**\n * Copy the values from one {@link Mat2} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Create a new {@link Mat2} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2}\n */\n static fromValues(...values) {\n return new _Mat2(...values);\n }\n /**\n * Set the components of a {@link Mat2} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n return out;\n }\n /**\n * Set a {@link Mat2} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n let det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n }\n /**\n * Adds two {@link Mat2}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Mat2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n }\n /**\n * Alias for {@link Mat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Rotates a {@link Mat2} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n }\n /**\n * Scales the {@link Mat2} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n }\n /**\n * Creates a {@link Mat2} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n }\n /**\n * Multiply each element of a {@link Mat2} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @category Static\n *\n * @param L - the lower triangular matrix\n * @param D - the diagonal matrix\n * @param U - the upper triangular matrix\n * @param a - the input matrix to factorize\n */\n static LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n }\n /**\n * Returns whether two {@link Mat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether two {@link Mat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n /**\n * Returns a string representation of a {@link Mat2}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X2 = new WeakMap();\n__privateAdd(_Mat2, _IDENTITY_2X2, new Float64Array([\n 1,\n 0,\n 0,\n 1\n]));\nvar Mat2 = _Mat2;\nMat2.prototype.mul = Mat2.prototype.multiply;\nMat2.mul = Mat2.multiply;\nMat2.sub = Mat2.subtract;\n\n// src/_lib/f64/Mat2d.ts\nvar _IDENTITY_2X3;\nvar _Mat2d = class _Mat2d extends Float64Array {\n /**\n * Create a {@link Mat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 6:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 6);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 6);\n }\n break;\n default:\n super(__privateGet(_Mat2d, _IDENTITY_2X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat2d.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat2d.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Mat2d} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat2d.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat2d, _IDENTITY_2X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat2d} against another one\n * Equivalent to `Mat2d.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat2d.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Translate this {@link Mat2d} by the given vector\n * Equivalent to `Mat2d.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat2d.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat2d} by the given angle around the given axis\n * Equivalent to `Mat2d.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat2d.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat2d} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat2d.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat2d.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat2d}.\n */\n static get BYTE_LENGTH() {\n return 6 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat2d}\n * @category Static\n *\n * @returns A new {@link Mat2d}\n */\n static create() {\n return new _Mat2d();\n }\n /**\n * Creates a new {@link Mat2d} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat2d}\n */\n static clone(a) {\n return new _Mat2d(a);\n }\n /**\n * Copy the values from one {@link Mat2d} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n }\n /**\n * Create a new {@link Mat2d} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat2d}\n */\n static fromValues(...values) {\n return new _Mat2d(...values);\n }\n /**\n * Set the components of a {@link Mat2d} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n return out;\n }\n /**\n * Set a {@link Mat2d} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Inverts a {@link Mat2d}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const aa = a[0];\n const ab = a[1];\n const ac = a[2];\n const ad = a[3];\n const atx = a[4];\n const aty = a[5];\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat2d}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n }\n /**\n * Adds two {@link Mat2d}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n }\n /**\n * Alias for {@link Mat2d.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat2d}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n }\n /**\n * Alias for {@link Mat2d.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat2d} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n }\n /**\n * Rotates a {@link Mat2d} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n /**\n * Scales the {@link Mat2d} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const v0 = v[0];\n const v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n }\n // TODO: Got to fromRotation\n /**\n * Creates a {@link Mat2d} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.rotate(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Creates a {@link Mat2d} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * Mat2d.identity(dest);\n * Mat2d.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat2d} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat2d}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + 1);\n }\n /**\n * Multiply each element of a {@link Mat2d} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n }\n /**\n * Adds two {@link Mat2d}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat2d}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat2d}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5));\n }\n /**\n * Returns a string representation of a {@link Mat2d}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat2d(${a.join(\", \")})`;\n }\n};\n_IDENTITY_2X3 = new WeakMap();\n__privateAdd(_Mat2d, _IDENTITY_2X3, new Float64Array([\n 1,\n 0,\n 0,\n 1,\n 0,\n 0\n]));\nvar Mat2d = _Mat2d;\nMat2d.mul = Mat2d.multiply;\nMat2d.sub = Mat2d.subtract;\n\n// src/_lib/f64/Mat3.ts\nvar _IDENTITY_3X3;\nvar _Mat3 = class _Mat3 extends Float64Array {\n /**\n * Create a {@link Mat3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 9:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 9);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 9);\n }\n break;\n default:\n super(__privateGet(_Mat3, _IDENTITY_3X3));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat3.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat3.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat3, _IDENTITY_3X3));\n return this;\n }\n /**\n * Multiplies this {@link Mat3} against another one\n * Equivalent to `Mat3.multiply(this, this, b);`\n * @category Methods\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat3.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat3}\n * Equivalent to `Mat3.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat3.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat3}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat3.invert(this, this);\n }\n /**\n * Translate this {@link Mat3} by the given vector\n * Equivalent to `Mat3.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat3.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat3} by the given angle around the given axis\n * Equivalent to `Mat3.rotate(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotate(rad) {\n return _Mat3.rotate(this, this, rad);\n }\n /**\n * Scales this {@link Mat3} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat3.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec2} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat3.scale(this, this, v);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat3}.\n */\n static get BYTE_LENGTH() {\n return 9 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat3}\n * @category Static\n *\n * @returns A new {@link Mat3}\n */\n static create() {\n return new _Mat3();\n }\n /**\n * Creates a new {@link Mat3} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat3}\n */\n static clone(a) {\n return new _Mat3(a);\n }\n /**\n * Copy the values from one {@link Mat3} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Create a new {@link Mat3} with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat3}\n */\n static fromValues(...values) {\n return new _Mat3(...values);\n }\n /**\n * Set the components of a {@link Mat3} to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n return out;\n }\n /**\n * Set a {@link Mat3} to the identity matrix\n * @category Static\n *\n * @param out - The receiving matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2];\n const a10 = a[3], a11 = a[4], a12 = a[5];\n const a20 = a[6], a21 = a[7], a22 = a[8];\n const b01 = a22 * a11 - a12 * a21;\n const b11 = -a22 * a10 + a12 * a20;\n const b21 = a21 * a10 - a11 * a20;\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat3}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat3}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n }\n /**\n * Adds two {@link Mat3}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n }\n /**\n * Alias for {@link Mat3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Mat3}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[3];\n b1 = b[4];\n b2 = b[5];\n out[3] = b0 * a00 + b1 * a10 + b2 * a20;\n out[4] = b0 * a01 + b1 * a11 + b2 * a21;\n out[5] = b0 * a02 + b1 * a12 + b2 * a22;\n b0 = b[6];\n b1 = b[7];\n b2 = b[8];\n out[6] = b0 * a00 + b1 * a10 + b2 * a20;\n out[7] = b0 * a01 + b1 * a11 + b2 * a21;\n out[8] = b0 * a02 + b1 * a12 + b2 * a22;\n return out;\n }\n /**\n * Alias for {@link Mat3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat3} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const x = v[0];\n const y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n }\n /**\n * Rotates a {@link Mat3} by the given angle\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotate(out, a, rad) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[3];\n const a11 = a[4];\n const a12 = a[5];\n const a20 = a[6];\n const a21 = a[7];\n const a22 = a[8];\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n }\n /**\n * Scales the {@link Mat3} by the dimensions in the given {@link Vec2}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec2} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat3} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat2d} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 2x3 matrix\n * @returns `out`\n */\n static fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat3} from the given quaternion\n * @category Static\n *\n * @param out - {@link Mat3} receiving operation result\n * @param q - {@link Quat} to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n }\n /**\n * Copies the upper-left 3x3 values of a {@link Mat4} into the given\n * {@link Mat3}.\n * @category Static\n *\n * @param out - the receiving 3x3 matrix\n * @param a - the source 4x4 matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n }\n /**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n * @category Static\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n }\n /**\n * Calculates a {@link Mat3} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = cy * az - cz * ay;\n out[4] = cz * ax - cx * az;\n out[5] = cx * ay - cy * ax;\n out[6] = ay * bz - az * by;\n out[7] = az * bx - ax * bz;\n out[8] = ax * by - ay * bx;\n return out;\n }\n /**\n * Generates a 2D projection matrix with the given bounds\n * @category Static\n *\n * @param out mat3 frustum matrix will be written into\n * @param width Width of your gl context\n * @param height Height of gl context\n * @returns `out`\n */\n static projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat3}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]\n );\n }\n /**\n * Multiply each element of a {@link Mat3} by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n }\n /**\n * Adds two {@link Mat3}'s after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat3}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat3}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8));\n }\n /**\n * Returns a string representation of a {@link Mat3}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat3(${a.join(\", \")})`;\n }\n};\n_IDENTITY_3X3 = new WeakMap();\n__privateAdd(_Mat3, _IDENTITY_3X3, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n]));\nvar Mat3 = _Mat3;\nMat3.prototype.mul = Mat3.prototype.multiply;\nMat3.mul = Mat3.multiply;\nMat3.sub = Mat3.subtract;\n\n// src/_lib/f64/Mat4.ts\nvar _IDENTITY_4X4, _TMP_VEC3;\nvar _Mat4 = class _Mat4 extends Float64Array {\n /**\n * Create a {@link Mat4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 16:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 16);\n break;\n case 1:\n const v = values[0];\n if (typeof v === \"number\") {\n super([\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v,\n v\n ]);\n } else {\n super(v, 0, 16);\n }\n break;\n default:\n super(__privateGet(_Mat4, _IDENTITY_4X4));\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Mat4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Mat4.str(this);\n }\n // ===================\n // Instance methods\n // ===================\n /**\n * Copy the values from another {@link Mat4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Set `this` to the identity matrix\n * Equivalent to Mat4.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this.set(__privateGet(_Mat4, _IDENTITY_4X4));\n return this;\n }\n /**\n * Multiplies this {@link Mat4} against another one\n * Equivalent to `Mat4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns `this`\n */\n multiply(b) {\n return _Mat4.multiply(this, this, b);\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Transpose this {@link Mat4}\n * Equivalent to `Mat4.transpose(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n transpose() {\n return _Mat4.transpose(this, this);\n }\n /**\n * Inverts this {@link Mat4}\n * Equivalent to `Mat4.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Mat4.invert(this, this);\n }\n /**\n * Translate this {@link Mat4} by the given vector\n * Equivalent to `Mat4.translate(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to translate by\n * @returns `this`\n */\n translate(v) {\n return _Mat4.translate(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the given axis\n * Equivalent to `Mat4.rotate(this, this, rad, axis);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `this`\n */\n rotate(rad, axis) {\n return _Mat4.rotate(this, this, rad, axis);\n }\n /**\n * Scales this {@link Mat4} by the dimensions in the given vec3 not using vectorization\n * Equivalent to `Mat4.scale(this, this, v);`\n * @category Methods\n *\n * @param v - The {@link Vec3} to scale the matrix by\n * @returns `this`\n */\n scale(v) {\n return _Mat4.scale(this, this, v);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the X axis\n * Equivalent to `Mat4.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateX(rad) {\n return _Mat4.rotateX(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Y axis\n * Equivalent to `Mat4.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateY(rad) {\n return _Mat4.rotateY(this, this, rad);\n }\n /**\n * Rotates this {@link Mat4} by the given angle around the Z axis\n * Equivalent to `Mat4.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - the angle to rotate the matrix by\n * @returns `this`\n */\n rotateZ(rad) {\n return _Mat4.rotateZ(this, this, rad);\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveNO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveNO(fovy, aspect, near, far) {\n return _Mat4.perspectiveNO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * Equivalent to `Mat4.perspectiveZO(this, fovy, aspect, near, far);`\n * @category Methods\n *\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `this`\n */\n perspectiveZO(fovy, aspect, near, far) {\n return _Mat4.perspectiveZO(this, fovy, aspect, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Equivalent to `Mat4.orthoNO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoNO(left, right, bottom, top, near, far) {\n return _Mat4.orthoNO(this, left, right, bottom, top, near, far);\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Equivalent to `Mat4.orthoZO(this, left, right, bottom, top, near, far);`\n * @category Methods\n *\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `this`\n */\n orthoZO(left, right, bottom, top, near, far) {\n return _Mat4.orthoZO(this, left, right, bottom, top, near, far);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Mat4}.\n */\n static get BYTE_LENGTH() {\n return 16 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, identity {@link Mat4}\n * @category Static\n *\n * @returns A new {@link Mat4}\n */\n static create() {\n return new _Mat4();\n }\n /**\n * Creates a new {@link Mat4} initialized with values from an existing matrix\n * @category Static\n *\n * @param a - Matrix to clone\n * @returns A new {@link Mat4}\n */\n static clone(a) {\n return new _Mat4(a);\n }\n /**\n * Copy the values from one {@link Mat4} to another\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - Matrix to copy\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Create a new mat4 with the given values\n * @category Static\n *\n * @param values - Matrix components\n * @returns A new {@link Mat4}\n */\n static fromValues(...values) {\n return new _Mat4(...values);\n }\n /**\n * Set the components of a mat4 to the given values\n * @category Static\n *\n * @param out - The receiving matrix\n * @param values - Matrix components\n * @returns `out`\n */\n static set(out, ...values) {\n out[0] = values[0];\n out[1] = values[1];\n out[2] = values[2];\n out[3] = values[3];\n out[4] = values[4];\n out[5] = values[5];\n out[6] = values[6];\n out[7] = values[7];\n out[8] = values[8];\n out[9] = values[9];\n out[10] = values[10];\n out[11] = values[11];\n out[12] = values[12];\n out[13] = values[13];\n out[14] = values[14];\n out[15] = values[15];\n return out;\n }\n /**\n * Set a {@link Mat4} to the identity matrix\n * @category Static\n *\n * @param out - The receiving Matrix\n * @returns `out`\n */\n static identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Transpose the values of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static transpose(out, a) {\n if (out === a) {\n const a01 = a[1], a02 = a[2], a03 = a[3];\n const a12 = a[6], a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Inverts a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out` or `null` if the matrix is not invertible\n */\n static invert(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n /**\n * Calculates the adjugate of a {@link Mat4}\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the source matrix\n * @returns `out`\n */\n static adjoint(out, a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n }\n /**\n * Calculates the determinant of a {@link Mat4}\n * @category Static\n *\n * @param a - the source matrix\n * @returns determinant of a\n */\n static determinant(a) {\n const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n }\n /**\n * Multiplies two {@link Mat4}s\n * @category Static\n *\n * @param out - The receiving Matrix\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n }\n /**\n * Alias for {@link Mat4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Translate a {@link Mat4} by the given vector\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n /**\n * Scales the {@link Mat4} by the dimensions in the given {@link Vec3} not using vectorization\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param v - the {@link Vec3} to scale the matrix by\n * @returns `out`\n **/\n static scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n }\n /**\n * Rotates a {@link Mat4} by the given angle around the given axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if axis has a length of 0\n */\n static rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const b00 = x * x * t + c;\n const b01 = y * x * t + z * s;\n const b02 = z * x * t - y * s;\n const b10 = x * y * t - z * s;\n const b11 = y * y * t + c;\n const b12 = z * y * t + x * s;\n const b20 = x * z * t + y * s;\n const b21 = y * z * t - x * s;\n const b22 = z * z * t + c;\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the X axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Y axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n }\n /**\n * Rotates a matrix by the given angle around the Z axis\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to rotate\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Translation vector\n * @returns `out`\n */\n static fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a vector scaling\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param v - Scaling vector\n * @returns `out`\n */\n static fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a {@link Mat4} from a given angle around a given axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n * ```\n * @category Static\n *\n * @param out - {@link Mat4} receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @param axis - the axis to rotate around\n * @returns `out` or `null` if `axis` has a length of 0\n */\n static fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n if (len < GLM_EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const t = 1 - c;\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param rad - the angle to rotate the matrix by\n * @returns `out`\n */\n static fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, v) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Sets a {@link Mat4} from a {@link Quat2}.\n * @category Static\n *\n * @param out - Matrix\n * @param a - Dual Quaternion\n * @returns `out`\n */\n static fromQuat2(out, a) {\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n if (magnitude > 0) {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n __privateGet(_Mat4, _TMP_VEC3)[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n __privateGet(_Mat4, _TMP_VEC3)[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n _Mat4.fromRotationTranslation(out, a, __privateGet(_Mat4, _TMP_VEC3));\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out` or `null` if the matrix is not invertible\n */\n static normalFromMat4(out, a) {\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];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = 0;\n out[4] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[7] = 0;\n out[8] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[9] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a {@link Mat4} normal matrix (transpose inverse) from a {@link Mat4}\n * This version omits the calculation of the constant factor (1/determinant), so\n * any normals transformed with it will need to be renormalized.\n * From https://stackoverflow.com/a/27616419/25968\n * @category Static\n *\n * @param out - Matrix receiving operation result\n * @param a - Mat4 to derive the normal matrix from\n * @returns `out`\n */\n static normalFromMat4Fast(out, a) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = a[4];\n const by = a[5];\n const bz = a[6];\n const cx = a[8];\n const cy = a[9];\n const cz = a[10];\n out[0] = by * cz - cz * cy;\n out[1] = bz * cx - cx * cz;\n out[2] = bx * cy - cy * cx;\n out[3] = 0;\n out[4] = cy * az - cz * ay;\n out[5] = cz * ax - cx * az;\n out[6] = cx * ay - cy * ax;\n out[7] = 0;\n out[8] = ay * bz - az * by;\n out[9] = az * bx - ax * bz;\n out[10] = ax * by - ay * bx;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n }\n /**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion parameter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @category Static\n *\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n static getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n }\n /**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @category Static\n *\n * @param out - Quaternion to receive the rotation component\n * @param mat - Matrix to be decomposed (input)\n * @return `out`\n */\n static getRotation(out, mat) {\n _Mat4.getScaling(__privateGet(_Mat4, _TMP_VEC3), mat);\n const is1 = 1 / __privateGet(_Mat4, _TMP_VEC3)[0];\n const is2 = 1 / __privateGet(_Mat4, _TMP_VEC3)[1];\n const is3 = 1 / __privateGet(_Mat4, _TMP_VEC3)[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n }\n /**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @category Static\n *\n * @param out_r - Quaternion to receive the rotation component\n * @param out_t - Vector to receive the translation vector\n * @param out_s - Vector to receive the scaling factor\n * @param mat - Matrix to be decomposed (input)\n * @returns `out_r`\n */\n static decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @returns `out`\n */\n static fromRotationTranslationScale(out, q, v, s) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n /**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the\n * given origin. This is equivalent to (but much faster than):\n * ```js\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n * ```\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Rotation quaternion\n * @param v - Translation vector\n * @param s - Scaling vector\n * @param o - The origin vector around which to scale and rotate\n * @returns `out`\n */\n static fromRotationTranslationScaleOrigin(out, q, v, s, o) {\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 xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @category Static\n *\n * @param out - mat4 receiving operation result\n * @param q - Quaternion to create matrix from\n * @returns `out`\n */\n static fromQuat(out, q) {\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 out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumNO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.frustumNO}\n * @category Static\n * @deprecated Use {@link Mat4.frustumNO} or {@link Mat4.frustumZO} explicitly\n */\n static frustum(out, left, right, bottom, top, near, far = Infinity) {\n return out;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Generates a frustum matrix with the given bounds\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static frustumZO(out, left, right, bottom, top, near, far = Infinity) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveNO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n }\n /**\n * Alias for {@link Mat4.perspectiveNO}\n * @category Static\n * @deprecated Use {@link Mat4.perspectiveNO} or {@link Mat4.perspectiveZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static perspective(out, fovy, aspect, near, far = Infinity) {\n return out;\n }\n /**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fovy - Vertical field of view in radians\n * @param aspect - Aspect ratio. typically viewport width/height\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum, can be null or Infinity\n * @returns `out`\n */\n static perspectiveZO(out, fovy, aspect, near, far = Infinity) {\n const f = 1 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n }\n /**\n * Generates a perspective projection matrix with the given field of view. This is primarily useful for generating\n * projection matrices to be used with the still experimental WebVR API.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param fov - Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n * @deprecated\n */\n static perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan(fov.upDegrees * Math.PI / 180);\n const downTan = Math.tan(fov.downDegrees * Math.PI / 180);\n const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);\n const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);\n const xScale = 2 / (leftTan + rightTan);\n const yScale = 2 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = yScale;\n out[6] = 0;\n out[7] = 0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near / (near - far);\n out[15] = 0;\n return out;\n }\n /**\n * Generates an orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [-1, 1], which matches WebGL / OpenGLs clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Alias for {@link Mat4.orthoNO}\n * @category Static\n * @deprecated Use {@link Mat4.orthoNO} or {@link Mat4.orthoZO} explicitly\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static ortho(out, left, right, bottom, top, near, far) {\n return out;\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds. The near / far clip planes correspond to a\n * normalized device coordinate Z range of [0, 1], which matches WebGPU / Vulkan / DirectX / Metal's clip volume.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param left - Left bound of the frustum\n * @param right - Right bound of the frustum\n * @param bottom - Bottom bound of the frustum\n * @param top - Top bound of the frustum\n * @param near - Near bound of the frustum\n * @param far - Far bound of the frustum\n * @returns `out`\n */\n static orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that\n * actually makes an object look at another object, you should use targetTo instead.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param center - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static lookAt(out, eye, center, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < GLM_EPSILON && Math.abs(eyey - centery) < GLM_EPSILON && Math.abs(eyez - centerz) < GLM_EPSILON) {\n return _Mat4.identity(out);\n }\n let z0 = eyex - centerx;\n let z1 = eyey - centery;\n let z2 = eyez - centerz;\n let len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n let y0 = z1 * x2 - z2 * x1;\n let y1 = z2 * x0 - z0 * x2;\n let y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n }\n /**\n * Generates a matrix that makes something look at something else.\n * @category Static\n *\n * @param out - mat4 frustum matrix will be written into\n * @param eye - Position of the viewer\n * @param target - Point the viewer is looking at\n * @param up - vec3 pointing up\n * @returns `out`\n */\n static targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n }\n /**\n * Returns Frobenius norm of a {@link Mat4}\n * @category Static\n *\n * @param a - the matrix to calculate Frobenius norm of\n * @returns Frobenius norm\n */\n static frob(a) {\n return Math.sqrt(\n a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]\n );\n }\n /**\n * Adds two {@link Mat4}'s\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n }\n /**\n * Subtracts matrix b from matrix a\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n }\n /**\n * Alias for {@link Mat4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiply each element of the matrix by a scalar.\n * @category Static\n *\n * @param out - the receiving matrix\n * @param a - the matrix to scale\n * @param b - amount to scale the matrix's elements by\n * @returns `out`\n */\n static multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n }\n /**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b's elements by before adding\n * @returns `out`\n */\n static multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n }\n /**\n * Returns whether two {@link Mat4}s have exactly the same elements in the same position (when compared with ===).\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether two {@link Mat4}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @returns True if the matrices are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= GLM_EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= GLM_EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= GLM_EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= GLM_EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= GLM_EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= GLM_EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= GLM_EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= GLM_EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));\n }\n /**\n * Returns a string representation of a {@link Mat4}\n * @category Static\n *\n * @param a - matrix to represent as a string\n * @returns string representation of the matrix\n */\n static str(a) {\n return `Mat4(${a.join(\", \")})`;\n }\n};\n_IDENTITY_4X4 = new WeakMap();\n_TMP_VEC3 = new WeakMap();\n__privateAdd(_Mat4, _IDENTITY_4X4, new Float64Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n]));\n/**\n * Temporary variable to prevent repeated allocations in the algorithms within Mat4.\n * These are declared as TypedArrays to aid in tree-shaking.\n */\n__privateAdd(_Mat4, _TMP_VEC3, new Float64Array(3));\nvar Mat4 = _Mat4;\nMat4.prototype.mul = Mat4.prototype.multiply;\nMat4.sub = Mat4.subtract;\nMat4.mul = Mat4.multiply;\nMat4.frustum = Mat4.frustumNO;\nMat4.perspective = Mat4.perspectiveNO;\nMat4.ortho = Mat4.orthoNO;\n\n// src/_lib/f64/Vec3.ts\nvar Vec3 = class _Vec3 extends Float64Array {\n /**\n * Create a {@link Vec3}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 3:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 3);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v]);\n } else {\n super(v, 0, 3);\n }\n break;\n }\n default:\n super(3);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec3.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec3.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec3.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec3.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec3} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec3} to `this`.\n * Equivalent to `Vec3.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n return this;\n }\n /**\n * Subtracts a {@link Vec3} from `this`.\n * Equivalent to `Vec3.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec3}.\n * Equivalent to `Vec3.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec3}.\n * Equivalent to `Vec3.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n return this;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec3.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec3.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec3.distance(this, b);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec3} and `this`.\n * Equivalent to `Vec3.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec3.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec3.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec3.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n return this;\n }\n /**\n * Sets each component of `this` to its absolute value.\n * Equivalent to `Vec3.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec3}.\n * Equivalent to `Vec3.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec3.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec3.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec3}.\n */\n static get BYTE_LENGTH() {\n return 3 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty vec3\n * @category Static\n *\n * @returns a new 3D vector\n */\n static create() {\n return new _Vec3();\n }\n /**\n * Creates a new vec3 initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 3D vector\n */\n static clone(a) {\n return new _Vec3(a);\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec3}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec3.magnitude}\n * @category Static\n * @deprecated Use {@link Vec3.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Creates a new vec3 initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns a new 3D vector\n */\n static fromValues(x, y, z) {\n return new _Vec3(x, y, z);\n }\n /**\n * Copy the values from one vec3 to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n }\n /**\n * Set the components of a vec3 to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @returns `out`\n */\n static set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n }\n /**\n * Adds two {@link Vec3}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Multiplies two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Divides two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n }\n /**\n * Alias for {@link Vec3.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0, 0];\n }\n /**\n * Math.ceil the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n }\n /**\n * Math.floor the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n }\n /**\n * Returns the minimum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }\n /**\n * Returns the maximum of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n }\n /**\n * symmetric round the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n /*\n static round(out: Vec3Like, a: Readonly): Vec3Like {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n }*/\n /**\n * Scales a vec3 by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n return out;\n }\n /**\n * Adds two vec3's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n }\n /**\n * Alias for {@link Vec3.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared length of a vec3\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n }\n /**\n * Alias for {@link Vec3.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n }\n /**\n * Returns the inverse of the components of a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec3}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n return out;\n }\n /**\n * Normalize a vec3\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n }\n /**\n * Calculates the dot product of two vec3's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n }\n /**\n * Computes the cross product of two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const ax = a[0], ay = a[1], az = a[2];\n const bx = b[0], by = b[1], bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n }\n /**\n * Performs a linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two vec3's\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(_Vec3.dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n }\n /**\n * Performs a hermite interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Performs a bezier interpolation with two control points\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec3Like, scale) {\n scale = scale === undefined ? 1.0 : scale;\n \n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = glMatrix.RANDOM() * 2.0 - 1.0;\n let zScale = Math.sqrt(1.0 - z * z) * scale;\n \n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n }*/\n /**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z + m[15] || 1;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n }\n /**\n * Transforms the vec3 with a mat3.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - the 3x3 matrix to transform with\n * @returns `out`\n */\n static transformMat3(out, a, m) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n }\n /**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const uvx = qy * z - qz * y;\n const uvy = qz * x - qx * z;\n const uvz = qx * y - qy * x;\n const uuvx = (qy * uvz - qz * uvy) * 2;\n const uuvy = (qz * uvx - qx * uvz) * 2;\n const uuvz = (qx * uvy - qy * uvx) * 2;\n out[0] = x + uvx * w2 + uuvx;\n out[1] = y + uvy * w2 + uuvy;\n out[2] = z + uvz * w2 + uuvz;\n return out;\n }\n /**\n * Rotate a 3D vector around the x-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateX(out, a, b, rad) {\n const by = b[1];\n const bz = b[2];\n const py = a[1] - by;\n const pz = a[2] - bz;\n out[0] = a[0];\n out[1] = py * Math.cos(rad) - pz * Math.sin(rad) + by;\n out[2] = py * Math.sin(rad) + pz * Math.cos(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the y-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateY(out, a, b, rad) {\n const bx = b[0];\n const bz = b[2];\n const px = a[0] - bx;\n const pz = a[2] - bz;\n out[0] = pz * Math.sin(rad) + px * Math.cos(rad) + bx;\n out[1] = a[1];\n out[2] = pz * Math.cos(rad) - px * Math.sin(rad) + bz;\n return out;\n }\n /**\n * Rotate a 3D vector around the z-axis\n * @category Static\n *\n * @param out - The receiving vec3\n * @param a - The vec3 point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotateZ(out, a, b, rad) {\n const bx = b[0];\n const by = b[1];\n const px = a[0] - bx;\n const py = a[1] - by;\n out[0] = px * Math.cos(rad) - py * Math.sin(rad) + bx;\n out[1] = px * Math.sin(rad) + py * Math.cos(rad) + by;\n out[2] = b[2];\n return out;\n }\n /**\n * Get the angle between two 3D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static 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 mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && _Vec3.dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a vec3 to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec3(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));\n }\n};\nVec3.prototype.sub = Vec3.prototype.subtract;\nVec3.prototype.mul = Vec3.prototype.multiply;\nVec3.prototype.div = Vec3.prototype.divide;\nVec3.prototype.dist = Vec3.prototype.distance;\nVec3.prototype.sqrDist = Vec3.prototype.squaredDistance;\nVec3.sub = Vec3.subtract;\nVec3.mul = Vec3.multiply;\nVec3.div = Vec3.divide;\nVec3.dist = Vec3.distance;\nVec3.sqrDist = Vec3.squaredDistance;\nVec3.sqrLen = Vec3.squaredLength;\nVec3.mag = Vec3.magnitude;\nVec3.length = Vec3.magnitude;\nVec3.len = Vec3.magnitude;\n\n// src/_lib/f64/Vec4.ts\nvar Vec4 = class _Vec4 extends Float64Array {\n /**\n * Create a {@link Vec4}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the vector. Equivalent to `this[2];`\n * @category Vector Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the vector. Equivalent to `this[3];`\n * @category Vector Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The b component of the vector. Equivalent to `this[2];`\n * @category Color Components\n */\n get b() {\n return this[2];\n }\n set b(value) {\n this[2] = value;\n }\n /**\n * The a component of the vector. Equivalent to `this[3];`\n * @category Color Components\n */\n get a() {\n return this[3];\n }\n set a(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec4.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec4.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec4.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec4} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Adds a {@link Vec4} to `this`.\n * Equivalent to `Vec4.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n this[2] += b[2];\n this[3] += b[3];\n return this;\n }\n /**\n * Subtracts a {@link Vec4} from `this`.\n * Equivalent to `Vec4.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n this[2] -= b[2];\n this[3] -= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec4}.\n * Equivalent to `Vec4.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n this[2] *= b[2];\n this[3] *= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec4}.\n * Equivalent to `Vec4.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n this[2] /= b[2];\n this[3] /= b[3];\n return this;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec4.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n this[2] *= b;\n this[3] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec4.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n this[2] += b[2] * scale;\n this[3] += b[3] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec4.distance(this, b);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec4} and `this`.\n * Equivalent to `Vec4.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec4.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec4.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n this[2] *= -1;\n this[3] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec4.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n this[2] = 1 / this[2];\n this[3] = 1 / this[3];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec4.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n this[2] = Math.abs(this[2]);\n this[3] = Math.abs(this[3]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec4}.\n * Equivalent to `Vec4.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec4.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec4.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec4}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec4}\n * @category Static\n *\n * @returns a new 4D vector\n */\n static create() {\n return new _Vec4();\n }\n /**\n * Creates a new {@link Vec4} initialized with values from an existing vector\n * @category Static\n *\n * @param a - vector to clone\n * @returns a new 4D vector\n */\n static clone(a) {\n return new _Vec4(a);\n }\n /**\n * Creates a new {@link Vec4} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new 4D vector\n */\n static fromValues(x, y, z, w) {\n return new _Vec4(x, y, z, w);\n }\n /**\n * Copy the values from one {@link Vec4} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n static set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n }\n /**\n * Adds two {@link Vec4}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return out;\n }\n /**\n * Multiplies two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Divides two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n }\n /**\n * Alias for {@link Vec4.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return out;\n }\n /**\n * Math.ceil the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n }\n /**\n * Scales a {@link Vec4} by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param scale - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Adds two {@link Vec4}'s after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param scale - the amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns distance between a and b\n */\n static distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n }\n /**\n * Alias for {@link Vec4.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns squared distance between a and b\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredDistance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate length of\n * @returns length of `a`\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec4.magnitude}\n * @category Static\n * @deprecated Use {@link Vec4.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to calculate squared length of\n * @returns squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Alias for {@link Vec4.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n out[2] = 1 / a[2];\n out[3] = 1 / a[3];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec4}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n out[2] = Math.abs(a[2]);\n out[3] = Math.abs(a[3]);\n return out;\n }\n /**\n * Normalize a {@link Vec4}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec4}'s\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n }\n /**\n * Returns the cross-product of three vectors in a 4-dimensional space\n * @category Static\n *\n * @param out the receiving vector\n * @param u - the first vector\n * @param v - the second vector\n * @param w - the third vector\n * @returns result\n */\n static cross(out, u, v, w) {\n const a = v[0] * w[1] - v[1] * w[0];\n const b = v[0] * w[2] - v[2] * w[0];\n const c = v[0] * w[3] - v[3] * w[0];\n const d = v[1] * w[2] - v[2] * w[1];\n const e = v[1] * w[3] - v[3] * w[1];\n const f = v[2] * w[3] - v[3] * w[2];\n const g = u[0];\n const h = u[1];\n const i = u[2];\n const j = u[3];\n out[0] = h * f - i * e + j * d;\n out[1] = -(g * f) + i * c - j * b;\n out[2] = g * e - h * c + j * a;\n out[3] = -(g * d) + h * b - i * a;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec4}'s\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n }\n /**\n * Generates a random vector with the given scale\n * @category Static\n *\n * @param out - the receiving vector\n * @param [scale] - Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns `out`\n */\n /*\n static random(out: Vec4Like, scale): Vec4Like {\n scale = scale || 1.0;\n \n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n var v1, v2, v3, v4;\n var s1, s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n \n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n }*/\n /**\n * Transforms the {@link Vec4} with a {@link Mat4}.\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param m - matrix to transform with\n * @returns `out`\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n }\n /**\n * Transforms the {@link Vec4} with a {@link Quat}\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to transform\n * @param q - quaternion to transform with\n * @returns `out`\n */\n static transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Vec4} to zero\n * @category Static\n *\n * @param out - the receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n }\n /**\n * Returns a string representation of a {@link Vec4}\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Vec4(${a.join(\", \")})`;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3));\n }\n};\nVec4.prototype.sub = Vec4.prototype.subtract;\nVec4.prototype.mul = Vec4.prototype.multiply;\nVec4.prototype.div = Vec4.prototype.divide;\nVec4.prototype.dist = Vec4.prototype.distance;\nVec4.prototype.sqrDist = Vec4.prototype.squaredDistance;\nVec4.sub = Vec4.subtract;\nVec4.mul = Vec4.multiply;\nVec4.div = Vec4.divide;\nVec4.dist = Vec4.distance;\nVec4.sqrDist = Vec4.squaredDistance;\nVec4.sqrLen = Vec4.squaredLength;\nVec4.mag = Vec4.magnitude;\nVec4.length = Vec4.magnitude;\nVec4.len = Vec4.magnitude;\n\n// src/_lib/f64/Quat.ts\nvar _DEFAULT_ANGLE_ORDER, _TMP_QUAT1, _TMP_QUAT2, _TMP_MAT3, _TMP_VEC32, _X_UNIT_VEC3, _Y_UNIT_VEC3;\nvar _Quat = class _Quat extends Float64Array {\n /**\n * Create a {@link Quat}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 4:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 4);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v]);\n } else {\n super(v, 0, 4);\n }\n break;\n }\n default:\n super(4);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the quaternion. Equivalent to `this[0];`\n * @category Quaternion Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the quaternion. Equivalent to `this[1];`\n * @category Quaternion Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n /**\n * The z component of the quaternion. Equivalent to `this[2];`\n * @category Quaternion Components\n */\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = value;\n }\n /**\n * The w component of the quaternion. Equivalent to `this[3];`\n * @category Quaternion Components\n */\n get w() {\n return this[3];\n }\n set w(value) {\n this[3] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Quat.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n const x = this[0];\n const y = this[1];\n const z = this[2];\n const w = this[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /**\n * Alias for {@link Quat.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Quat.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat} into `this`.\n * @category Methods\n *\n * @param a the source quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n /**\n * Set `this` to the identity quaternion\n * Equivalent to Quat.identity(this)\n * @category Methods\n *\n * @returns `this`\n */\n identity() {\n this[0] = 0;\n this[1] = 0;\n this[2] = 0;\n this[3] = 1;\n return this;\n }\n /**\n * Multiplies `this` by a {@link Quat}.\n * Equivalent to `Quat.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n return _Quat.multiply(this, this, b);\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Rotates `this` by the given angle about the X axis\n * Equivalent to `Quat.rotateX(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateX(rad) {\n return _Quat.rotateX(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Y axis\n * Equivalent to `Quat.rotateY(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateY(rad) {\n return _Quat.rotateY(this, this, rad);\n }\n /**\n * Rotates `this` by the given angle about the Z axis\n * Equivalent to `Quat.rotateZ(this, this, rad);`\n * @category Methods\n *\n * @param rad - angle (in radians) to rotate\n * @returns `this`\n */\n rotateZ(rad) {\n return _Quat.rotateZ(this, this, rad);\n }\n /**\n * Inverts `this`\n * Equivalent to `Quat.invert(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n return _Quat.invert(this, this);\n }\n /**\n * Scales `this` by a scalar number\n * Equivalent to `Quat.scale(this, this, scale);`\n * @category Methods\n *\n * @param scale - amount to scale the vector by\n * @returns `this`\n */\n scale(scale) {\n this[0] *= scale;\n this[1] *= scale;\n this[2] *= scale;\n this[3] *= scale;\n return this;\n }\n /**\n * Calculates the dot product of `this` and another {@link Quat}\n * Equivalent to `Quat.dot(this, b);`\n * @category Methods\n *\n * @param b - the second operand\n * @returns dot product of `this` and b\n */\n dot(b) {\n return _Quat.dot(this, b);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat}.\n */\n static get BYTE_LENGTH() {\n return 4 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity quat\n * @category Static\n *\n * @returns a new quaternion\n */\n static create() {\n return new _Quat();\n }\n /**\n * Set a quat to the identity quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n }\n /**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param axis - the axis around which to rotate\n * @param rad - the angle in radians\n * @returns `out`\n **/\n static setAxisAngle(out, axis, rad) {\n rad *= 0.5;\n const s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n }\n /**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as provided in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @category Static\n *\n * @param out_axis - Vector receiving the axis of rotation\n * @param q - Quaternion to be decomposed\n * @return Angle, in radians, of the rotation\n */\n static getAxisAngle(out_axis, q) {\n const rad = Math.acos(q[3]) * 2;\n const s = Math.sin(rad / 2);\n if (s > GLM_EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n }\n /**\n * Gets the angular distance between two unit quaternions\n * @category Static\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n static getAngle(a, b) {\n const dotproduct = _Quat.dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n }\n /**\n * Multiplies two quaternions.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\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 out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the X axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Y axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const by = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n }\n /**\n * Rotates a quaternion by the given angle about the Z axis\n * @category Static\n *\n * @param out - quat receiving operation result\n * @param a - quat to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n rad *= 0.5;\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bz = Math.sin(rad);\n const bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n }\n /**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate W component of\n * @returns `out`\n */\n static calculateW(out, a) {\n const x = a[0], y = a[1], z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));\n return out;\n }\n /**\n * Calculate the exponential of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static exp(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const et = Math.exp(w);\n const s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n }\n /**\n * Calculate the natural logarithm of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @returns `out`\n */\n static ln(out, a) {\n const x = a[0], y = a[1], z = a[2], w = a[3];\n const r = Math.sqrt(x * x + y * y + z * z);\n const t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n }\n /**\n * Calculate the scalar power of a unit quaternion.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate the exponential of\n * @param b - amount to scale the quaternion by\n * @returns `out`\n */\n static pow(out, a, b) {\n _Quat.ln(out, a);\n _Quat.scale(out, out, b);\n _Quat.exp(out, out);\n return out;\n }\n /**\n * Performs a spherical linear interpolation between two quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static slerp(out, a, b, t) {\n const ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n let scale0;\n let scale1;\n let cosom = ax * bx + ay * by + az * bz + aw * bw;\n if (cosom < 0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n if (1 - cosom > GLM_EPSILON) {\n const omega = Math.acos(cosom);\n const sinom = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n scale0 = 1 - t;\n scale1 = t;\n }\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n }\n /**\n * Generates a random unit quaternion\n * @category Static\n *\n * @param out - the receiving quaternion\n * @returns `out`\n */\n /* static random(out: QuatLike): QuatLike {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n let u1 = glMatrix.RANDOM();\n let u2 = glMatrix.RANDOM();\n let u3 = glMatrix.RANDOM();\n \n let sqrt1MinusU1 = Math.sqrt(1 - u1);\n let sqrtU1 = Math.sqrt(u1);\n \n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n }*/\n /**\n * Calculates the inverse of a quat\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n }\n /**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than `quat.inverse` and produces the same result.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quat to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to re-normalize the quaternion yourself where necessary.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param m - rotation matrix\n * @returns `out`\n */\n static fromMat3(out, m) {\n const fTrace = m[0] + m[4] + m[8];\n let fRoot;\n if (fTrace > 0) {\n fRoot = Math.sqrt(fTrace + 1);\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n let i = 0;\n if (m[4] > m[0]) {\n i = 1;\n }\n if (m[8] > m[i * 3 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n return out;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z.\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - Angle to rotate around X axis in degrees.\n * @param y - Angle to rotate around Y axis in degrees.\n * @param z - Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order - Intrinsic order for conversion, default is zyx.\n * @returns `out`\n */\n static fromEuler(out, x, y, z, order = __privateGet(_Quat, _DEFAULT_ANGLE_ORDER)) {\n const halfToRad = 0.5 * Math.PI / 180;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n const sx = Math.sin(x);\n const cx = Math.cos(x);\n const sy = Math.sin(y);\n const cy = Math.cos(y);\n const sz = Math.sin(z);\n const cz = Math.cos(z);\n switch (order) {\n case \"xyz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"xzy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yxz\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz - sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n case \"yzx\":\n out[0] = sx * cy * cz + cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zxy\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz + sx * sy * cz;\n out[3] = cx * cy * cz - sx * sy * sz;\n break;\n case \"zyx\":\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown angle order ${order}`);\n }\n return out;\n }\n /**\n * Returns a string representation of a quatenion\n * @category Static\n *\n * @param a - vector to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat(${a.join(\", \")})`;\n }\n /**\n * Creates a new quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - quaternion to clone\n * @returns a new quaternion\n */\n static clone(a) {\n return new _Quat(a);\n }\n /**\n * Creates a new quat initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns a new quaternion\n */\n static fromValues(x, y, z, w) {\n return new _Quat(x, y, z, w);\n }\n /**\n * Copy the values from one quat to another\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the source quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the components of a {@link Quat} to the given values\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param x - X component\n * @param y - Y component\n * @param z - Z component\n * @param w - W component\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static set(out, x, y, z, w) {\n return out;\n }\n /**\n * Adds two {@link Quat}'s\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static add(out, a, b) {\n return out;\n }\n /**\n * Alias for {@link Quat.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a quat by a scalar number\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - the vector to scale\n * @param b - amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, scale) {\n out[0] = a[0] * scale;\n out[1] = a[1] * scale;\n out[2] = a[2] * scale;\n out[3] = a[3] * scale;\n return out;\n }\n /**\n * Calculates the dot product of two quat's\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n static 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 a linear interpolation between two quat's\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static lerp(out, a, b, t) {\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mag(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat.magnitude}\n * @category Static\n * @deprecated Use {@link Quat.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat}\n * @category Static\n *\n * @param a - quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat}\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - quaternion to normalize\n * @returns `out`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static normalize(out, a) {\n return out;\n }\n /**\n * Returns whether the quaternions have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first quaternion.\n * @param b - The second quaternion.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static exactEquals(a, b) {\n return false;\n }\n /**\n * Returns whether the quaternions have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns True if the vectors are equal, false otherwise.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static equals(a, b) {\n return false;\n }\n /**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n * @category Static\n *\n * @param out - the receiving quaternion.\n * @param a - the initial vector\n * @param b - the destination vector\n * @returns `out`\n */\n static rotationTo(out, a, b) {\n const dot = Vec3.dot(a, b);\n if (dot < -0.999999) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _X_UNIT_VEC3), a);\n if (Vec3.mag(__privateGet(_Quat, _TMP_VEC32)) < 1e-6) {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _Y_UNIT_VEC3), a);\n }\n Vec3.normalize(__privateGet(_Quat, _TMP_VEC32), __privateGet(_Quat, _TMP_VEC32));\n _Quat.setAxisAngle(out, __privateGet(_Quat, _TMP_VEC32), Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n Vec3.cross(__privateGet(_Quat, _TMP_VEC32), a, b);\n out[0] = __privateGet(_Quat, _TMP_VEC32)[0];\n out[1] = __privateGet(_Quat, _TMP_VEC32)[1];\n out[2] = __privateGet(_Quat, _TMP_VEC32)[2];\n out[3] = 1 + dot;\n return _Quat.normalize(out, out);\n }\n }\n /**\n * Performs a spherical linear interpolation with two control points\n * @category Static\n *\n * @param out - the receiving quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @param c - the third operand\n * @param d - the fourth operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static sqlerp(out, a, b, c, d, t) {\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT1), a, d, t);\n _Quat.slerp(__privateGet(_Quat, _TMP_QUAT2), b, c, t);\n _Quat.slerp(out, __privateGet(_Quat, _TMP_QUAT1), __privateGet(_Quat, _TMP_QUAT2), 2 * t * (1 - t));\n return out;\n }\n /**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n * @category Static\n *\n * @param out - The receiving quaternion\n * @param view - the vector representing the viewing direction\n * @param right - the vector representing the local `right` direction\n * @param up - the vector representing the local `up` direction\n * @returns `out`\n */\n static setAxes(out, view, right, up) {\n __privateGet(_Quat, _TMP_MAT3)[0] = right[0];\n __privateGet(_Quat, _TMP_MAT3)[3] = right[1];\n __privateGet(_Quat, _TMP_MAT3)[6] = right[2];\n __privateGet(_Quat, _TMP_MAT3)[1] = up[0];\n __privateGet(_Quat, _TMP_MAT3)[4] = up[1];\n __privateGet(_Quat, _TMP_MAT3)[7] = up[2];\n __privateGet(_Quat, _TMP_MAT3)[2] = -view[0];\n __privateGet(_Quat, _TMP_MAT3)[5] = -view[1];\n __privateGet(_Quat, _TMP_MAT3)[8] = -view[2];\n return _Quat.normalize(out, _Quat.fromMat3(out, __privateGet(_Quat, _TMP_MAT3)));\n }\n};\n_DEFAULT_ANGLE_ORDER = new WeakMap();\n_TMP_QUAT1 = new WeakMap();\n_TMP_QUAT2 = new WeakMap();\n_TMP_MAT3 = new WeakMap();\n_TMP_VEC32 = new WeakMap();\n_X_UNIT_VEC3 = new WeakMap();\n_Y_UNIT_VEC3 = new WeakMap();\n__privateAdd(_Quat, _DEFAULT_ANGLE_ORDER, \"zyx\");\n// Temporary variables to prevent repeated allocations in the algorithms within Quat.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat, _TMP_QUAT1, new Float64Array(4));\n__privateAdd(_Quat, _TMP_QUAT2, new Float64Array(4));\n__privateAdd(_Quat, _TMP_MAT3, new Float64Array(9));\n__privateAdd(_Quat, _TMP_VEC32, new Float64Array(3));\n__privateAdd(_Quat, _X_UNIT_VEC3, new Float64Array([1, 0, 0]));\n__privateAdd(_Quat, _Y_UNIT_VEC3, new Float64Array([0, 1, 0]));\nvar Quat = _Quat;\nQuat.set = Vec4.set;\nQuat.add = Vec4.add;\nQuat.lerp = Vec4.lerp;\nQuat.normalize = Vec4.normalize;\nQuat.squaredLength = Vec4.squaredLength;\nQuat.sqrLen = Vec4.squaredLength;\nQuat.exactEquals = Vec4.exactEquals;\nQuat.equals = Vec4.equals;\nQuat.magnitude = Vec4.magnitude;\nQuat.prototype.mul = Quat.prototype.multiply;\nQuat.mul = Quat.multiply;\nQuat.mag = Quat.magnitude;\nQuat.length = Quat.magnitude;\nQuat.len = Quat.magnitude;\n\n// src/_lib/f64/Quat2.ts\nvar _TMP_QUAT, _TMP_VEC33;\nvar _Quat2 = class _Quat2 extends Float64Array {\n /**\n * Create a {@link Quat2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 8:\n super(values);\n break;\n case 2:\n super(values[0], values[1], 8);\n break;\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v, v, v, v, v, v, v]);\n } else {\n super(v, 0, 8);\n }\n break;\n }\n default:\n super(8);\n this[3] = 1;\n break;\n }\n }\n // ============\n // Accessors\n // ============\n /**\n * A string representation of `this`\n * Equivalent to `Quat2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Quat2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Quat2} into `this`.\n * @category Methods\n *\n * @param a the source dual quaternion\n * @returns `this`\n */\n copy(a) {\n super.set(a);\n return this;\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Quat2}.\n */\n static get BYTE_LENGTH() {\n return 8 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new identity {@link Quat2}\n * @category Static\n *\n * @returns a new dual quaternion [real -> rotation, dual -> translation]\n */\n static create() {\n return new _Quat2();\n }\n /**\n * Creates a {@link Quat2} quat initialized with values from an existing quaternion\n * @category Static\n *\n * @param a - dual quaternion to clone\n * @returns a new dual quaternion\n */\n static clone(a) {\n return new _Quat2(a);\n }\n /**\n * Creates a new {@link Quat2} initialized with the given values\n * @category Static\n *\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns a new dual quaternion\n */\n static fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n return new _Quat2(x1, y1, z1, w1, x2, y2, z2, w2);\n }\n /**\n * Creates a new {@link Quat2} from the given values (quat and translation)\n * @category Static\n *\n * @param x1 - X component (rotation)\n * @param y1 - Y component (rotation)\n * @param z1 - Z component (rotation)\n * @param w1 - W component (rotation)\n * @param x2 - X component (translation)\n * @param y2 - Y component (translation)\n * @param z2 - Z component (translation)\n * @returns a new dual quaternion\n */\n static fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n const ax = x2 * 0.5;\n const ay = y2 * 0.5;\n const az = z2 * 0.5;\n return new _Quat2(\n x1,\n y1,\n z1,\n w1,\n ax * w1 + ay * z1 - az * y1,\n ay * w1 + az * x1 - ax * z1,\n az * w1 + ax * y1 - ay * x1,\n -ax * x1 - ay * y1 - az * z1\n );\n }\n /**\n * Sets a {@link Quat2} from a quaternion and a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @param t - translation vector\n * @returns `out`\n */\n static fromRotationTranslation(out, q, t) {\n const ax = t[0] * 0.5;\n const ay = t[1] * 0.5;\n const az = t[2] * 0.5;\n const bx = q[0];\n const by = q[1];\n const bz = q[2];\n const bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a translation\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param t - translation vector\n * @returns `out`\n */\n static fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param q - a normalized quaternion\n * @returns `out`\n */\n static fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Sets a {@link Quat2} from a quaternion\n * @category Static\n *\n * @param out - dual quaternion receiving operation result\n * @param a - the matrix\n * @returns `out`\n */\n static fromMat4(out, a) {\n Mat4.getRotation(__privateGet(_Quat2, _TMP_QUAT), a);\n Mat4.getTranslation(__privateGet(_Quat2, _TMP_VEC33), a);\n return _Quat2.fromRotationTranslation(out, __privateGet(_Quat2, _TMP_QUAT), __privateGet(_Quat2, _TMP_VEC33));\n }\n /**\n * Copy the values from one {@link Quat2} to another\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the source dual quaternion\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Set a {@link Quat2} to the identity dual quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @returns `out`\n */\n static identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n }\n /**\n * Set the components of a {@link Quat2} to the given values\n * @category Static\n *\n * @param out - the receiving vector\n * @param x1 - 1st X component\n * @param y1 - 1st Y component\n * @param z1 - 1st Z component\n * @param w1 - 1st W component\n * @param x2 - 2nd X component\n * @param y2 - 2nd Y component\n * @param z2 - 2nd Z component\n * @param w2 - 2nd W component\n * @returns `out`\n */\n static set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n }\n /**\n * Gets the real part of a dual quat\n * @category Static\n *\n * @param out - real part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Gets the dual part of a dual quat\n * @category Static\n *\n * @param out - dual part\n * @param a - Dual Quaternion\n * @return `out`\n */\n static getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n }\n /**\n * Set the real component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the real part\n * @return `out`\n */\n static setReal(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n }\n /**\n * Set the dual component of a {@link Quat2} to the given quaternion\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - a quaternion representing the dual part\n * @return `out`\n */\n static setDual(out, a) {\n out[4] = a[0];\n out[5] = a[1];\n out[6] = a[2];\n out[7] = a[3];\n return out;\n }\n /**\n * Gets the translation of a normalized {@link Quat2}\n * @category Static\n *\n * @param out - the receiving translation vector\n * @param a - Dual Quaternion to be decomposed\n * @return `out`\n */\n static getTranslation(out, a) {\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n }\n /**\n * Translates a {@link Quat2} by the given vector\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to translate\n * @param v - vector to translate by\n * @returns `out`\n */\n static translate(out, a, v) {\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n const bx1 = v[0] * 0.5;\n const by1 = v[1] * 0.5;\n const bz1 = v[2] * 0.5;\n const ax2 = a[4];\n const ay2 = a[5];\n const az2 = a[6];\n const aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the X axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateX(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateX(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Y axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateY(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateY(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around the Z axis\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param rad - angle (in radians) to rotate\n * @returns `out`\n */\n static rotateZ(out, a, rad) {\n let bx = -a[0];\n let by = -a[1];\n let bz = -a[2];\n let bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const ax1 = ax * bw + aw * bx + ay * bz - az * by;\n const ay1 = ay * bw + aw * by + az * bx - ax * bz;\n const az1 = az * bw + aw * bz + ax * by - ay * bx;\n const aw1 = aw * bw - ax * bx - ay * by - az * bz;\n Quat.rotateZ(out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (a * q)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param q - quaternion to rotate by\n * @returns `out`\n */\n static rotateByQuatAppend(out, a, q) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} by a given quaternion (q * a)\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param q - quaternion to rotate by\n * @param a - the dual quaternion to rotate\n * @returns `out`\n */\n static rotateByQuatPrepend(out, q, a) {\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n let bx = a[0];\n let by = a[1];\n let bz = a[2];\n let bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n }\n /**\n * Rotates a {@link Quat2} around a given axis. Does the normalization automatically\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the dual quaternion to rotate\n * @param axis - the axis to rotate around\n * @param rad - how far the rotation should be\n * @returns `out`\n */\n static rotateAroundAxis(out, a, axis, rad) {\n if (Math.abs(rad) < GLM_EPSILON) {\n return _Quat2.copy(out, a);\n }\n const axisLength = Math.sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n rad *= 0.5;\n const s = Math.sin(rad);\n const bx = s * axis[0] / axisLength;\n const by = s * axis[1] / axisLength;\n const bz = s * axis[2] / axisLength;\n const bw = Math.cos(rad);\n const ax1 = a[0];\n const ay1 = a[1];\n const az1 = a[2];\n const aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n }\n /**\n * Adds two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n }\n /**\n * Multiplies two {@link Quat2}s\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - the first operand\n * @param b - the second operand\n * @returns {quat2} out\n */\n static multiply(out, a, b) {\n const ax0 = a[0];\n const ay0 = a[1];\n const az0 = a[2];\n const aw0 = a[3];\n const bx1 = b[4];\n const by1 = b[5];\n const bz1 = b[6];\n const bw1 = b[7];\n const ax1 = a[4];\n const ay1 = a[5];\n const az1 = a[6];\n const aw1 = a[7];\n const bx0 = b[0];\n const by0 = b[1];\n const bz0 = b[2];\n const bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n }\n /**\n * Alias for {@link Quat2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return out;\n }\n /**\n * Scales a {@link Quat2} by a scalar value\n * @category Static\n *\n * @param out - the receiving dual quaterion\n * @param a - the dual quaternion to scale\n * @param b - scalar value to scale the dual quaterion by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Quat2}s (The dot product of the real parts)\n * @category Static\n *\n * @param a - the first operand\n * @param b - the second operand\n * @returns dot product of a and b\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dot(a, b) {\n return 0;\n }\n /**\n * Performs a linear interpolation between two {@link Quat2}s\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when `t = 0.5`)\n * @category Static\n *\n * @param out - the receiving dual quat\n * @param a - the first operand\n * @param b - the second operand\n * @param t - interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const mt = 1 - t;\n if (_Quat2.dot(a, b) < 0) {\n t = -t;\n }\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n }\n /**\n * Calculates the inverse of a {@link Quat2}. If they are normalized, conjugate is cheaper\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quat to calculate inverse of\n * @returns `out`\n */\n static invert(out, a) {\n const sqlen = _Quat2.squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n }\n /**\n * Calculates the conjugate of a {@link Quat2}. If the dual quaternion is normalized, this function is faster than\n * {@link Quat2.invert} and produces the same result.\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to calculate conjugate of\n * @returns `out`\n */\n static conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n }\n /**\n * Calculates the magnitude (length) of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate length of\n * @returns length of `a`\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static magnitude(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Quat2.magnitude}\n * @category Static\n * @deprecated Use {@link Quat2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to calculate squared length of\n * @returns squared length of a\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static squaredLength(a) {\n return 0;\n }\n /**\n * Alias for {@link Quat2.squaredLength}\n * @category Static\n */\n static sqrLen(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Normalize a {@link Quat2}\n * @category Static\n *\n * @param out - the receiving dual quaternion\n * @param a - dual quaternion to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n let magnitude = _Quat2.squaredLength(a);\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n const a0 = a[0] / magnitude;\n const a1 = a[1] / magnitude;\n const a2 = a[2] / magnitude;\n const a3 = a[3] / magnitude;\n const b0 = a[4];\n const b1 = a[5];\n const b2 = a[6];\n const b3 = a[7];\n const a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n return out;\n }\n /**\n * Returns a string representation of a {@link Quat2}\n * @category Static\n *\n * @param a - dual quaternion to represent as a string\n * @returns string representation of the vector\n */\n static str(a) {\n return `Quat2(${a.join(\", \")})`;\n }\n /**\n * Returns whether the {@link Quat2}s have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static exactEquals(a, b) {\n 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];\n }\n /**\n * Returns whether the {@link Quat2}s have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first dual quaternion.\n * @param b - The second dual quaternion.\n * @returns True if the dual quaternions are equal, false otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= GLM_EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= GLM_EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= GLM_EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= GLM_EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= GLM_EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= GLM_EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7));\n }\n};\n_TMP_QUAT = new WeakMap();\n_TMP_VEC33 = new WeakMap();\n// Temporary variables to prevent repeated allocations in the algorithms within Quat2.\n// These are declared as TypedArrays to aid in tree-shaking.\n__privateAdd(_Quat2, _TMP_QUAT, new Float64Array(4));\n__privateAdd(_Quat2, _TMP_VEC33, new Float64Array(3));\nvar Quat2 = _Quat2;\nQuat2.dot = Quat.dot;\nQuat2.squaredLength = Quat.squaredLength;\nQuat2.sqrLen = Quat.squaredLength;\nQuat2.mag = Quat.magnitude;\nQuat2.length = Quat.magnitude;\nQuat2.len = Quat.magnitude;\nQuat2.mul = Quat2.multiply;\n\n// src/_lib/f64/Vec2.ts\nvar Vec2 = class _Vec2 extends Float64Array {\n /**\n * Create a {@link Vec2}.\n *\n * @category Constructor\n */\n constructor(...values) {\n switch (values.length) {\n case 2: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, values[1]]);\n } else {\n super(v, values[1], 2);\n }\n break;\n }\n case 1: {\n const v = values[0];\n if (typeof v === \"number\") {\n super([v, v]);\n } else {\n super(v, 0, 2);\n }\n break;\n }\n default:\n super(2);\n break;\n }\n }\n // ============\n // Accessors\n // ============\n // Getters and setters to make component access read better.\n // These are likely to be a little bit slower than direct array access.\n /**\n * The x component of the vector. Equivalent to `this[0];`\n * @category Vector Components\n */\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = value;\n }\n /**\n * The y component of the vector. Equivalent to `this[1];`\n * @category Vector Components\n */\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = value;\n }\n // Alternate set of getters and setters in case this is being used to define\n // a color.\n /**\n * The r component of the vector. Equivalent to `this[0];`\n * @category Color Components\n */\n get r() {\n return this[0];\n }\n set r(value) {\n this[0] = value;\n }\n /**\n * The g component of the vector. Equivalent to `this[1];`\n * @category Color Components\n */\n get g() {\n return this[1];\n }\n set g(value) {\n this[1] = value;\n }\n /**\n * The magnitude (length) of this.\n * Equivalent to `Vec2.magnitude(this);`\n *\n * Magnitude is used because the `length` attribute is already defined by\n * TypedArrays to mean the number of elements in the array.\n *\n * @category Accessors\n */\n get magnitude() {\n return Math.hypot(this[0], this[1]);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n *\n * @category Accessors\n */\n get mag() {\n return this.magnitude;\n }\n /**\n * The squared magnitude (length) of `this`.\n * Equivalent to `Vec2.squaredMagnitude(this);`\n *\n * @category Accessors\n */\n get squaredMagnitude() {\n const x = this[0];\n const y = this[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredMagnitude}\n *\n * @category Accessors\n */\n get sqrMag() {\n return this.squaredMagnitude;\n }\n /**\n * A string representation of `this`\n * Equivalent to `Vec2.str(this);`\n *\n * @category Accessors\n */\n get str() {\n return _Vec2.str(this);\n }\n // ===================\n // Instances methods\n // ===================\n /**\n * Copy the values from another {@link Vec2} into `this`.\n * @category Methods\n *\n * @param a the source vector\n * @returns `this`\n */\n copy(a) {\n this.set(a);\n return this;\n }\n // Instead of zero(), use a.fill(0) for instances;\n /**\n * Adds a {@link Vec2} to `this`.\n * Equivalent to `Vec2.add(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @returns `this`\n */\n add(b) {\n this[0] += b[0];\n this[1] += b[1];\n return this;\n }\n /**\n * Subtracts a {@link Vec2} from `this`.\n * Equivalent to `Vec2.subtract(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to subtract from `this`\n * @returns `this`\n */\n subtract(b) {\n this[0] -= b[0];\n this[1] -= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Methods\n */\n sub(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Multiplies `this` by a {@link Vec2}.\n * Equivalent to `Vec2.multiply(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to multiply `this` by\n * @returns `this`\n */\n multiply(b) {\n this[0] *= b[0];\n this[1] *= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Methods\n */\n mul(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Divides `this` by a {@link Vec2}.\n * Equivalent to `Vec2.divide(this, this, b);`\n * @category Methods\n *\n * @param b - The vector to divide `this` by\n * @returns `this`\n */\n divide(b) {\n this[0] /= b[0];\n this[1] /= b[1];\n return this;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Methods\n */\n div(b) {\n return this;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Scales `this` by a scalar number.\n * Equivalent to `Vec2.scale(this, this, b);`\n * @category Methods\n *\n * @param b - Amount to scale `this` by\n * @returns `this`\n */\n scale(b) {\n this[0] *= b;\n this[1] *= b;\n return this;\n }\n /**\n * Calculates `this` scaled by a scalar value then adds the result to `this`.\n * Equivalent to `Vec2.scaleAndAdd(this, this, b, scale);`\n * @category Methods\n *\n * @param b - The vector to add to `this`\n * @param scale - The amount to scale `b` by before adding\n * @returns `this`\n */\n scaleAndAdd(b, scale) {\n this[0] += b[0] * scale;\n this[1] += b[1] * scale;\n return this;\n }\n /**\n * Calculates the Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.distance(this, b);`\n * @category Methods\n *\n * @param b - The vector to calculate the distance to\n * @returns Distance between `this` and `b`\n */\n distance(b) {\n return _Vec2.distance(this, b);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Methods\n */\n dist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared Euclidean distance between another {@link Vec2} and `this`.\n * Equivalent to `Vec2.squaredDistance(this, b);`\n * @category Methods\n *\n * @param b The vector to calculate the squared distance to\n * @returns Squared distance between `this` and `b`\n */\n squaredDistance(b) {\n return _Vec2.squaredDistance(this, b);\n }\n /**\n * Alias for {@link Vec2.squaredDistance}\n * @category Methods\n */\n sqrDist(b) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Negates the components of `this`.\n * Equivalent to `Vec2.negate(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n negate() {\n this[0] *= -1;\n this[1] *= -1;\n return this;\n }\n /**\n * Inverts the components of `this`.\n * Equivalent to `Vec2.inverse(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n invert() {\n this[0] = 1 / this[0];\n this[1] = 1 / this[1];\n return this;\n }\n /**\n * Sets each component of `this` to it's absolute value.\n * Equivalent to `Vec2.abs(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n abs() {\n this[0] = Math.abs(this[0]);\n this[1] = Math.abs(this[1]);\n return this;\n }\n /**\n * Calculates the dot product of this and another {@link Vec2}.\n * Equivalent to `Vec2.dot(this, b);`\n * @category Methods\n *\n * @param b - The second operand\n * @returns Dot product of `this` and `b`\n */\n dot(b) {\n return this[0] * b[0] + this[1] * b[1];\n }\n /**\n * Normalize `this`.\n * Equivalent to `Vec2.normalize(this, this);`\n * @category Methods\n *\n * @returns `this`\n */\n normalize() {\n return _Vec2.normalize(this, this);\n }\n // ===================\n // Static accessors\n // ===================\n /**\n * @category Static\n *\n * @returns The number of bytes in a {@link Vec2}.\n */\n static get BYTE_LENGTH() {\n return 2 * Float64Array.BYTES_PER_ELEMENT;\n }\n // ===================\n // Static methods\n // ===================\n /**\n * Creates a new, empty {@link Vec2}\n * @category Static\n *\n * @returns A new 2D vector\n */\n static create() {\n return new _Vec2();\n }\n /**\n * Creates a new {@link Vec2} initialized with values from an existing vector\n * @category Static\n *\n * @param a - Vector to clone\n * @returns A new 2D vector\n */\n static clone(a) {\n return new _Vec2(a);\n }\n /**\n * Creates a new {@link Vec2} initialized with the given values\n * @category Static\n *\n * @param x - X component\n * @param y - Y component\n * @returns A new 2D vector\n */\n static fromValues(x, y) {\n return new _Vec2(x, y);\n }\n /**\n * Copy the values from one {@link Vec2} to another\n * @category Static\n *\n * @param out - the receiving vector\n * @param a - The source vector\n * @returns `out`\n */\n static copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n }\n /**\n * Set the components of a {@link Vec2} to the given values\n * @category Static\n *\n * @param out - The receiving vector\n * @param x - X component\n * @param y - Y component\n * @returns `out`\n */\n static set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n }\n /**\n * Adds two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n }\n /**\n * Subtracts vector b from vector a\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.subtract}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sub(out, a, b) {\n return [0, 0];\n }\n /**\n * Multiplies two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.multiply}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static mul(out, a, b) {\n return [0, 0];\n }\n /**\n * Divides two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n }\n /**\n * Alias for {@link Vec2.divide}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static div(out, a, b) {\n return [0, 0];\n }\n /**\n * Math.ceil the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to ceil\n * @returns `out`\n */\n static ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n }\n /**\n * Math.floor the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to floor\n * @returns `out`\n */\n static floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n }\n /**\n * Returns the minimum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n }\n /**\n * Returns the maximum of two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n }\n /**\n * Math.round the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to round\n * @returns `out`\n */\n static round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n }\n /**\n * Scales a {@link Vec2} by a scalar number\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The vector to scale\n * @param b - Amount to scale the vector by\n * @returns `out`\n */\n static scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n }\n /**\n * Adds two Vec2's after scaling the second operand by a scalar value\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param scale - The amount to scale b by before adding\n * @returns `out`\n */\n static scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n }\n /**\n * Calculates the Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns distance between `a` and `b`\n */\n static distance(a, b) {\n return Math.hypot(b[0] - a[0], b[1] - a[1]);\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static dist(a, b) {\n return 0;\n }\n /**\n * Calculates the squared Euclidean distance between two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Squared distance between `a` and `b`\n */\n static squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.distance}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrDist(a, b) {\n return 0;\n }\n /**\n * Calculates the magnitude (length) of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate magnitude of\n * @returns Magnitude of a\n */\n static magnitude(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n */\n static mag(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.magnitude} to avoid conflicts with builtin `length` methods/attribs\n *\n * @param a - vector to calculate length of\n * @returns length of a\n */\n // Length conflicts with Function.length\n static length(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Alias for {@link Vec2.magnitude}\n * @category Static\n * @deprecated Use {@link Vec2.mag}\n */\n static len(a) {\n return 0;\n }\n // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Calculates the squared length of a {@link Vec2}\n * @category Static\n *\n * @param a - Vector to calculate squared length of\n * @returns Squared length of a\n */\n static squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n }\n /**\n * Alias for {@link Vec2.squaredLength}\n * @category Static\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static sqrLen(a, b) {\n return 0;\n }\n /**\n * Negates the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to negate\n * @returns `out`\n */\n static negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n }\n /**\n * Returns the inverse of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to invert\n * @returns `out`\n */\n static inverse(out, a) {\n out[0] = 1 / a[0];\n out[1] = 1 / a[1];\n return out;\n }\n /**\n * Returns the absolute value of the components of a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to compute the absolute values of\n * @returns `out`\n */\n static abs(out, a) {\n out[0] = Math.abs(a[0]);\n out[1] = Math.abs(a[1]);\n return out;\n }\n /**\n * Normalize a {@link Vec2}\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - Vector to normalize\n * @returns `out`\n */\n static normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n }\n /**\n * Calculates the dot product of two {@link Vec2}s\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns Dot product of `a` and `b`\n */\n static dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the cross product of two {@link Vec2}s\n * Note that the cross product must by definition produce a 3D vector.\n * For this reason there is also not instance equivalent for this function.\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @returns `out`\n */\n static cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n }\n /**\n * Performs a linear interpolation between two {@link Vec2}s\n * @category Static\n *\n * @param out - The receiving vector\n * @param a - The first operand\n * @param b - The second operand\n * @param t - Interpolation amount, in the range [0-1], between the two inputs\n * @returns `out`\n */\n static lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat2d}\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat3}\n * 3rd vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n }\n /**\n * Transforms the {@link Vec2} with a {@link Mat4}\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param out - The receiving vector\n * @param a - The vector to transform\n * @param m - Matrix to transform with\n * @returns `out`\n * @category Static\n */\n static transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n }\n /**\n * Rotate a 2D vector\n * @category Static\n *\n * @param out - The receiving {@link Vec2}\n * @param a - The {@link Vec2} point to rotate\n * @param b - The origin of the rotation\n * @param rad - The angle of rotation in radians\n * @returns `out`\n */\n static rotate(out, a, b, rad) {\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 out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n }\n /**\n * Get the angle between two 2D vectors\n * @category Static\n *\n * @param a - The first operand\n * @param b - The second operand\n * @returns The angle in radians\n */\n static angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n const mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2);\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n }\n /**\n * Set the components of a {@link Vec2} to zero\n * @category Static\n *\n * @param out - The receiving vector\n * @returns `out`\n */\n static zero(out) {\n out[0] = 0;\n out[1] = 0;\n return out;\n }\n /**\n * Returns whether the vectors have exactly the same elements in the same position (when compared with ===)\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors components are ===, `false` otherwise.\n */\n static exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Returns whether the vectors have approximately the same elements in the same position.\n * @category Static\n *\n * @param a - The first vector.\n * @param b - The second vector.\n * @returns `true` if the vectors are approximately equal, `false` otherwise.\n */\n static equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return Math.abs(a0 - b0) <= GLM_EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= GLM_EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1));\n }\n /**\n * Returns a string representation of a vector\n * @category Static\n *\n * @param a - Vector to represent as a string\n * @returns String representation of the vector\n */\n static str(a) {\n return `Vec2(${a.join(\", \")})`;\n }\n};\nVec2.prototype.sub = Vec2.prototype.subtract;\nVec2.prototype.mul = Vec2.prototype.multiply;\nVec2.prototype.div = Vec2.prototype.divide;\nVec2.prototype.dist = Vec2.prototype.distance;\nVec2.prototype.sqrDist = Vec2.prototype.squaredDistance;\nVec2.sub = Vec2.subtract;\nVec2.mul = Vec2.multiply;\nVec2.div = Vec2.divide;\nVec2.dist = Vec2.distance;\nVec2.sqrDist = Vec2.squaredDistance;\nVec2.sqrLen = Vec2.squaredLength;\nVec2.mag = Vec2.magnitude;\nVec2.length = Vec2.magnitude;\nVec2.len = Vec2.magnitude;\n\n// src/swizzle/f64/index.ts\nvar GLM_SWIZZLES_ENABLED_F64 = false;\nfunction EnableSwizzlesF64() {\n if (GLM_SWIZZLES_ENABLED_F64) {\n return;\n }\n const VEC2_SWIZZLES = [\"xx\", \"xy\", \"yx\", \"yy\", \"xxx\", \"xxy\", \"xyx\", \"xyy\", \"yxx\", \"yxy\", \"yyx\", \"yyy\", \"xxxx\", \"xxxy\", \"xxyx\", \"xxyy\", \"xyxx\", \"xyxy\", \"xyyx\", \"xyyy\", \"yxxx\", \"yxxy\", \"yxyx\", \"yxyy\", \"yyxx\", \"yyxy\", \"yyyx\", \"yyyy\", \"rr\", \"rg\", \"gr\", \"gg\", \"rrr\", \"rrg\", \"rgr\", \"rgg\", \"grr\", \"grg\", \"ggr\", \"ggg\", \"rrrr\", \"rrrg\", \"rrgr\", \"rrgg\", \"rgrr\", \"rgrg\", \"rggr\", \"rggg\", \"grrr\", \"grrg\", \"grgr\", \"grgg\", \"ggrr\", \"ggrg\", \"gggr\", \"gggg\"];\n const VEC3_SWIZZLES = [\"xz\", \"yz\", \"zx\", \"zy\", \"zz\", \"xxz\", \"xyz\", \"xzx\", \"xzy\", \"xzz\", \"yxz\", \"yyz\", \"yzx\", \"yzy\", \"yzz\", \"zxx\", \"zxy\", \"zxz\", \"zyx\", \"zyy\", \"zyz\", \"zzx\", \"zzy\", \"zzz\", \"xxxz\", \"xxyz\", \"xxzx\", \"xxzy\", \"xxzz\", \"xyxz\", \"xyyz\", \"xyzx\", \"xyzy\", \"xyzz\", \"xzxx\", \"xzxy\", \"xzxz\", \"xzyx\", \"xzyy\", \"xzyz\", \"xzzx\", \"xzzy\", \"xzzz\", \"yxxz\", \"yxyz\", \"yxzx\", \"yxzy\", \"yxzz\", \"yyxz\", \"yyyz\", \"yyzx\", \"yyzy\", \"yyzz\", \"yzxx\", \"yzxy\", \"yzxz\", \"yzyx\", \"yzyy\", \"yzyz\", \"yzzx\", \"yzzy\", \"yzzz\", \"zxxx\", \"zxxy\", \"zxxz\", \"zxyx\", \"zxyy\", \"zxyz\", \"zxzx\", \"zxzy\", \"zxzz\", \"zyxx\", \"zyxy\", \"zyxz\", \"zyyx\", \"zyyy\", \"zyyz\", \"zyzx\", \"zyzy\", \"zyzz\", \"zzxx\", \"zzxy\", \"zzxz\", \"zzyx\", \"zzyy\", \"zzyz\", \"zzzx\", \"zzzy\", \"zzzz\", \"rb\", \"gb\", \"br\", \"bg\", \"bb\", \"rrb\", \"rgb\", \"rbr\", \"rbg\", \"rbb\", \"grb\", \"ggb\", \"gbr\", \"gbg\", \"gbb\", \"brr\", \"brg\", \"brb\", \"bgr\", \"bgg\", \"bgb\", \"bbr\", \"bbg\", \"bbb\", \"rrrb\", \"rrgb\", \"rrbr\", \"rrbg\", \"rrbb\", \"rgrb\", \"rggb\", \"rgbr\", \"rgbg\", \"rgbb\", \"rbrr\", \"rbrg\", \"rbrb\", \"rbgr\", \"rbgg\", \"rbgb\", \"rbbr\", \"rbbg\", \"rbbb\", \"grrb\", \"grgb\", \"grbr\", \"grbg\", \"grbb\", \"ggrb\", \"gggb\", \"ggbr\", \"ggbg\", \"ggbb\", \"gbrr\", \"gbrg\", \"gbrb\", \"gbgr\", \"gbgg\", \"gbgb\", \"gbbr\", \"gbbg\", \"gbbb\", \"brrr\", \"brrg\", \"brrb\", \"brgr\", \"brgg\", \"brgb\", \"brbr\", \"brbg\", \"brbb\", \"bgrr\", \"bgrg\", \"bgrb\", \"bggr\", \"bggg\", \"bggb\", \"bgbr\", \"bgbg\", \"bgbb\", \"bbrr\", \"bbrg\", \"bbrb\", \"bbgr\", \"bbgg\", \"bbgb\", \"bbbr\", \"bbbg\", \"bbbb\"];\n const VEC4_SWIZZLES = [\"xw\", \"yw\", \"zw\", \"wx\", \"wy\", \"wz\", \"ww\", \"xxw\", \"xyw\", \"xzw\", \"xwx\", \"xwy\", \"xwz\", \"xww\", \"yxw\", \"yyw\", \"yzw\", \"ywx\", \"ywy\", \"ywz\", \"yww\", \"zxw\", \"zyw\", \"zzw\", \"zwx\", \"zwy\", \"zwz\", \"zww\", \"wxx\", \"wxy\", \"wxz\", \"wxw\", \"wyx\", \"wyy\", \"wyz\", \"wyw\", \"wzx\", \"wzy\", \"wzz\", \"wzw\", \"wwx\", \"wwy\", \"wwz\", \"www\", \"xxxw\", \"xxyw\", \"xxzw\", \"xxwx\", \"xxwy\", \"xxwz\", \"xxww\", \"xyxw\", \"xyyw\", \"xyzw\", \"xywx\", \"xywy\", \"xywz\", \"xyww\", \"xzxw\", \"xzyw\", \"xzzw\", \"xzwx\", \"xzwy\", \"xzwz\", \"xzww\", \"xwxx\", \"xwxy\", \"xwxz\", \"xwxw\", \"xwyx\", \"xwyy\", \"xwyz\", \"xwyw\", \"xwzx\", \"xwzy\", \"xwzz\", \"xwzw\", \"xwwx\", \"xwwy\", \"xwwz\", \"xwww\", \"yxxw\", \"yxyw\", \"yxzw\", \"yxwx\", \"yxwy\", \"yxwz\", \"yxww\", \"yyxw\", \"yyyw\", \"yyzw\", \"yywx\", \"yywy\", \"yywz\", \"yyww\", \"yzxw\", \"yzyw\", \"yzzw\", \"yzwx\", \"yzwy\", \"yzwz\", \"yzww\", \"ywxx\", \"ywxy\", \"ywxz\", \"ywxw\", \"ywyx\", \"ywyy\", \"ywyz\", \"ywyw\", \"ywzx\", \"ywzy\", \"ywzz\", \"ywzw\", \"ywwx\", \"ywwy\", \"ywwz\", \"ywww\", \"zxxw\", \"zxyw\", \"zxzw\", \"zxwx\", \"zxwy\", \"zxwz\", \"zxww\", \"zyxw\", \"zyyw\", \"zyzw\", \"zywx\", \"zywy\", \"zywz\", \"zyww\", \"zzxw\", \"zzyw\", \"zzzw\", \"zzwx\", \"zzwy\", \"zzwz\", \"zzww\", \"zwxx\", \"zwxy\", \"zwxz\", \"zwxw\", \"zwyx\", \"zwyy\", \"zwyz\", \"zwyw\", \"zwzx\", \"zwzy\", \"zwzz\", \"zwzw\", \"zwwx\", \"zwwy\", \"zwwz\", \"zwww\", \"wxxx\", \"wxxy\", \"wxxz\", \"wxxw\", \"wxyx\", \"wxyy\", \"wxyz\", \"wxyw\", \"wxzx\", \"wxzy\", \"wxzz\", \"wxzw\", \"wxwx\", \"wxwy\", \"wxwz\", \"wxww\", \"wyxx\", \"wyxy\", \"wyxz\", \"wyxw\", \"wyyx\", \"wyyy\", \"wyyz\", \"wyyw\", \"wyzx\", \"wyzy\", \"wyzz\", \"wyzw\", \"wywx\", \"wywy\", \"wywz\", \"wyww\", \"wzxx\", \"wzxy\", \"wzxz\", \"wzxw\", \"wzyx\", \"wzyy\", \"wzyz\", \"wzyw\", \"wzzx\", \"wzzy\", \"wzzz\", \"wzzw\", \"wzwx\", \"wzwy\", \"wzwz\", \"wzww\", \"wwxx\", \"wwxy\", \"wwxz\", \"wwxw\", \"wwyx\", \"wwyy\", \"wwyz\", \"wwyw\", \"wwzx\", \"wwzy\", \"wwzz\", \"wwzw\", \"wwwx\", \"wwwy\", \"wwwz\", \"wwww\", \"ra\", \"ga\", \"ba\", \"ar\", \"ag\", \"ab\", \"aa\", \"rra\", \"rga\", \"rba\", \"rar\", \"rag\", \"rab\", \"raa\", \"gra\", \"gga\", \"gba\", \"gar\", \"gag\", \"gab\", \"gaa\", \"bra\", \"bga\", \"bba\", \"bar\", \"bag\", \"bab\", \"baa\", \"arr\", \"arg\", \"arb\", \"ara\", \"agr\", \"agg\", \"agb\", \"aga\", \"abr\", \"abg\", \"abb\", \"aba\", \"aar\", \"aag\", \"aab\", \"aaa\", \"rrra\", \"rrga\", \"rrba\", \"rrar\", \"rrag\", \"rrab\", \"rraa\", \"rgra\", \"rgga\", \"rgba\", \"rgar\", \"rgag\", \"rgab\", \"rgaa\", \"rbra\", \"rbga\", \"rbba\", \"rbar\", \"rbag\", \"rbab\", \"rbaa\", \"rarr\", \"rarg\", \"rarb\", \"rara\", \"ragr\", \"ragg\", \"ragb\", \"raga\", \"rabr\", \"rabg\", \"rabb\", \"raba\", \"raar\", \"raag\", \"raab\", \"raaa\", \"grra\", \"grga\", \"grba\", \"grar\", \"grag\", \"grab\", \"graa\", \"ggra\", \"ggga\", \"ggba\", \"ggar\", \"ggag\", \"ggab\", \"ggaa\", \"gbra\", \"gbga\", \"gbba\", \"gbar\", \"gbag\", \"gbab\", \"gbaa\", \"garr\", \"garg\", \"garb\", \"gara\", \"gagr\", \"gagg\", \"gagb\", \"gaga\", \"gabr\", \"gabg\", \"gabb\", \"gaba\", \"gaar\", \"gaag\", \"gaab\", \"gaaa\", \"brra\", \"brga\", \"brba\", \"brar\", \"brag\", \"brab\", \"braa\", \"bgra\", \"bgga\", \"bgba\", \"bgar\", \"bgag\", \"bgab\", \"bgaa\", \"bbra\", \"bbga\", \"bbba\", \"bbar\", \"bbag\", \"bbab\", \"bbaa\", \"barr\", \"barg\", \"barb\", \"bara\", \"bagr\", \"bagg\", \"bagb\", \"baga\", \"babr\", \"babg\", \"babb\", \"baba\", \"baar\", \"baag\", \"baab\", \"baaa\", \"arrr\", \"arrg\", \"arrb\", \"arra\", \"argr\", \"argg\", \"argb\", \"arga\", \"arbr\", \"arbg\", \"arbb\", \"arba\", \"arar\", \"arag\", \"arab\", \"araa\", \"agrr\", \"agrg\", \"agrb\", \"agra\", \"aggr\", \"aggg\", \"aggb\", \"agga\", \"agbr\", \"agbg\", \"agbb\", \"agba\", \"agar\", \"agag\", \"agab\", \"agaa\", \"abrr\", \"abrg\", \"abrb\", \"abra\", \"abgr\", \"abgg\", \"abgb\", \"abga\", \"abbr\", \"abbg\", \"abbb\", \"abba\", \"abar\", \"abag\", \"abab\", \"abaa\", \"aarr\", \"aarg\", \"aarb\", \"aara\", \"aagr\", \"aagg\", \"aagb\", \"aaga\", \"aabr\", \"aabg\", \"aabb\", \"aaba\", \"aaar\", \"aaag\", \"aaab\", \"aaaa\"];\n const SWIZZLE_INDEX = {\n x: 0,\n r: 0,\n y: 1,\n g: 1,\n z: 2,\n b: 2,\n w: 3,\n a: 3\n };\n function getSwizzleImpl(swizzle) {\n switch (swizzle.length) {\n case 2:\n return function() {\n return new Vec2(this[SWIZZLE_INDEX[swizzle[0]]], this[SWIZZLE_INDEX[swizzle[1]]]);\n };\n case 3:\n return function() {\n return new Vec3(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]]\n );\n };\n case 4:\n return function() {\n return new Vec4(\n this[SWIZZLE_INDEX[swizzle[0]]],\n this[SWIZZLE_INDEX[swizzle[1]]],\n this[SWIZZLE_INDEX[swizzle[2]]],\n this[SWIZZLE_INDEX[swizzle[3]]]\n );\n };\n }\n throw new Error(\"Illegal swizzle length\");\n }\n for (const swizzle of VEC2_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec2.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC3_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec3.prototype, swizzle, {\n get: impl\n });\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n for (const swizzle of VEC4_SWIZZLES) {\n const impl = getSwizzleImpl(swizzle);\n Object.defineProperty(Vec4.prototype, swizzle, {\n get: impl\n });\n }\n GLM_SWIZZLES_ENABLED_F64 = true;\n}\n\n// src/util/angleConversion.ts\nvar GLM_DEG_TO_RAD = Math.PI / 180;\nvar GLM_RAD_TO_DEG = 180 / Math.PI;\nfunction toDegree(value) {\n return value * GLM_RAD_T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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist-cdn/umd/gl-matrix-f64.min.js b/dist-cdn/umd/gl-matrix-f64.min.js index 8e876e01..ea722ec7 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.js +++ b/dist-cdn/umd/gl-matrix-f64.min.js @@ -91,10 +91,10 @@ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } - function _superPropGet(t, e, o, r) { - var p = _get(_getPrototypeOf(t.prototype ), e, o); + function _superPropGet(t, o, e, r) { + var p = _get(_getPrototypeOf(t.prototype ), o, e); return "function" == typeof p ? function (t) { - return p.apply(o, t); + return p.apply(e, t); } : p; } function _toPrimitive(t, r) { diff --git a/dist-cdn/umd/gl-matrix-f64.min.js.map b/dist-cdn/umd/gl-matrix-f64.min.js.map index e90f7a4f..4b0b7336 100644 --- a/dist-cdn/umd/gl-matrix-f64.min.js.map +++ b/dist-cdn/umd/gl-matrix-f64.min.js.map @@ -1 +1 @@ -{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float64Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t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s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float64Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*xe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAAA,EAAA;EAOaC,EAAAA,CAAA,0BAAAC,aAAA,EAAA;EAWX,IAAA,SAAAD,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"gl-matrix-f64.min.js","sources":["../esm/2016/gl-matrix-f64.min.js"],"sourcesContent":["// gl-matrix - v4.0.0-beta.3 - A high performance matrix and vector library.\n// @author Brandon Jones\n// @author Colin MacKenzie IV\n// @license MIT (https://github.com/toji/gl-matrix/blob/master/LICENSE.md)\nvar de=A=>{throw TypeError(A)};var oe=(A,e,t)=>e.has(A)||de(\"Cannot \"+t);var E=(A,e,t)=>(oe(A,e,\"read from private field\"),t?t.call(A):e.get(A)),Z=(A,e,t)=>e.has(A)?de(\"Cannot add the same private member more than once\"):e instanceof WeakSet?e.add(A):e.set(A,t);var ne,C=class C extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break;default:super(E(C,ne));break}}get str(){return C.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(C,ne)),this}multiply(e){return C.multiply(this,this,e)}mul(e){return this}transpose(){return C.transpose(this,this)}invert(){return C.invert(this,this)}scale(e){return C.scale(this,this,e)}rotate(e){return C.rotate(this,this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new C}static clone(e){return new C(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static fromValues(...e){return new C(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}static transpose(e,t){if(e===t){let n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*a-r*s;return i?(i=1/i,e[0]=a*i,e[1]=-s*i,e[2]=-r*i,e[3]=n*i,e):null}static adjoint(e,t){let n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}static determinant(e){return e[0]*e[3]-e[2]*e[1]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*c+a*y,e[1]=r*c+i*y,e[2]=s*L+a*k,e[3]=r*L+i*k,e}static mul(e,t,n){return e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+a*c,e[1]=r*y+i*c,e[2]=s*-c+a*y,e[3]=r*-c+i*y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1];return e[0]=s*c,e[1]=r*c,e[2]=a*y,e[3]=i*y,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static LDU(e,t,n,s){return e[2]=s[2]/s[0],n[0]=s[0],n[1]=s[1],n[3]=s[3]-e[2]*n[1],[e,t,n]}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}static str(e){return`Mat2(${e.join(\", \")})`}};ne=new WeakMap,Z(C,ne,new Float64Array([1,0,0,1]));var v=C;v.prototype.mul=v.prototype.multiply;v.mul=v.multiply;v.sub=v.subtract;var se,H=class H extends Float64Array{constructor(...e){switch(e.length){case 6:super(e);break;case 2:super(e[0],e[1],6);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t]):super(t,0,6);break;default:super(E(H,se));break}}get str(){return H.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(H,se)),this}multiply(e){return H.multiply(this,this,e)}mul(e){return this}translate(e){return H.translate(this,this,e)}rotate(e){return H.rotate(this,this,e)}scale(e){return H.scale(this,this,e)}static get BYTE_LENGTH(){return 6*Float64Array.BYTES_PER_ELEMENT}static create(){return new H}static clone(e){return new H(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static fromValues(...e){return new H(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=n*a-s*r;return y?(y=1/y,e[0]=a*y,e[1]=-s*y,e[2]=-r*y,e[3]=n*y,e[4]=(r*c-a*i)*y,e[5]=(s*i-n*c)*y,e):null}static determinant(e){return e[0]*e[3]-e[1]*e[2]}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1],l=n[2],M=n[3],h=n[4],b=n[5];return e[0]=s*L+a*k,e[1]=r*L+i*k,e[2]=s*l+a*M,e[3]=r*l+i*M,e[4]=s*h+a*b+c,e[5]=r*h+i*b+y,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=s*L+a*k+c,e[5]=r*L+i*k+y,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=Math.sin(n),k=Math.cos(n);return e[0]=s*k+a*L,e[1]=r*k+i*L,e[2]=s*-L+a*k,e[3]=r*-L+i*k,e[4]=c,e[5]=y,e}static scale(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=n[0],k=n[1];return e[0]=s*L,e[1]=r*L,e[2]=a*k,e[3]=i*k,e[4]=c,e[5]=y,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=-n,e[3]=s,e[4]=0,e[5]=0,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+1)}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=t[0],L=t[1],k=t[2],l=t[3],M=t[4],h=t[5];return Math.abs(n-y)<=1e-6*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(s-L)<=1e-6*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(r-k)<=1e-6*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(a-l)<=1e-6*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(i-M)<=1e-6*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(c-h)<=1e-6*Math.max(1,Math.abs(c),Math.abs(h))}static str(e){return`Mat2d(${e.join(\", \")})`}};se=new WeakMap,Z(H,se,new Float64Array([1,0,0,1,0,0]));var _=H;_.mul=_.multiply;_.sub=_.subtract;var re,X=class X extends Float64Array{constructor(...e){switch(e.length){case 9:super(e);break;case 2:super(e[0],e[1],9);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t]):super(t,0,9);break;default:super(E(X,re));break}}get str(){return X.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(X,re)),this}multiply(e){return X.multiply(this,this,e)}mul(e){return this}transpose(){return X.transpose(this,this)}invert(){return X.invert(this,this)}translate(e){return X.translate(this,this,e)}rotate(e){return X.rotate(this,this,e)}scale(e){return X.scale(this,this,e)}static get BYTE_LENGTH(){return 9*Float64Array.BYTES_PER_ELEMENT}static create(){return new X}static clone(e){return new X(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromValues(...e){return new X(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=k*i-c*L,M=-k*a+c*y,h=L*a-i*y,b=n*l+s*M+r*h;return b?(b=1/b,e[0]=l*b,e[1]=(-k*s+r*L)*b,e[2]=(c*s-r*i)*b,e[3]=M*b,e[4]=(k*n-r*y)*b,e[5]=(-c*n+r*a)*b,e[6]=h*b,e[7]=(-L*n+s*y)*b,e[8]=(i*n-s*a)*b,e):null}static adjoint(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8];return e[0]=i*k-c*L,e[1]=r*L-s*k,e[2]=s*c-r*i,e[3]=c*y-a*k,e[4]=n*k-r*y,e[5]=r*a-n*c,e[6]=a*L-i*y,e[7]=s*y-n*L,e[8]=n*i-s*a,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8];return t*(L*a-i*y)+n*(-L*r+i*c)+s*(y*r-a*c)}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}static sub(e,t,n){return e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1],b=n[2];return e[0]=M*s+h*i+b*L,e[1]=M*r+h*c+b*k,e[2]=M*a+h*y+b*l,M=n[3],h=n[4],b=n[5],e[3]=M*s+h*i+b*L,e[4]=M*r+h*c+b*k,e[5]=M*a+h*y+b*l,M=n[6],h=n[7],b=n[8],e[6]=M*s+h*i+b*L,e[7]=M*r+h*c+b*k,e[8]=M*a+h*y+b*l,e}static mul(e,t,n){return e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=n[0],h=n[1];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=y,e[6]=M*s+h*i+L,e[7]=M*r+h*c+k,e[8]=M*a+h*y+l,e}static rotate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=Math.sin(n),h=Math.cos(n);return e[0]=h*s+M*i,e[1]=h*r+M*c,e[2]=h*a+M*y,e[3]=h*i-M*s,e[4]=h*c-M*r,e[5]=h*y-M*a,e[6]=L,e[7]=k,e[8]=l,e}static scale(e,t,n){let s=n[0],r=n[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}static fromRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=-n,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}static fromMat2d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[3]=k-o,e[6]=M+m,e[1]=k+o,e[4]=1-L-b,e[7]=h-d,e[2]=M-m,e[5]=h+d,e[8]=1-L-l,e}static fromMat4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=(r*I-s*P-a*Y)*Q,e[4]=(n*P-r*p+a*F)*Q,e[5]=(s*p-n*I-a*D)*Q,e[6]=(d*B-m*g+o*z)*Q,e[7]=(m*R-b*B-o*x)*Q,e[8]=(b*g-d*R+o*V)*Q,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=L*r-k*s,e[4]=k*n-y*r,e[5]=y*s-L*n,e[6]=s*c-r*i,e[7]=r*a-n*c,e[8]=n*i-s*a,e}static projection(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8])}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(r-h)<=1e-6*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(a-b)<=1e-6*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(y-o)<=1e-6*Math.max(1,Math.abs(y),Math.abs(o))&&Math.abs(L-V)<=1e-6*Math.max(1,Math.abs(L),Math.abs(V))&&Math.abs(k-x)<=1e-6*Math.max(1,Math.abs(k),Math.abs(x))}static str(e){return`Mat3(${e.join(\", \")})`}};re=new WeakMap,Z(X,re,new Float64Array([1,0,0,0,1,0,0,0,1]));var u=X;u.prototype.mul=u.prototype.multiply;u.mul=u.multiply;u.sub=u.subtract;var ae,$,S=class S extends Float64Array{constructor(...e){switch(e.length){case 16:super(e);break;case 2:super(e[0],e[1],16);break;case 1:let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]):super(t,0,16);break;default:super(E(S,ae));break}}get str(){return S.str(this)}copy(e){return this.set(e),this}identity(){return this.set(E(S,ae)),this}multiply(e){return S.multiply(this,this,e)}mul(e){return this}transpose(){return S.transpose(this,this)}invert(){return S.invert(this,this)}translate(e){return S.translate(this,this,e)}rotate(e,t){return S.rotate(this,this,e,t)}scale(e){return S.scale(this,this,e)}rotateX(e){return S.rotateX(this,this,e)}rotateY(e){return S.rotateY(this,this,e)}rotateZ(e){return S.rotateZ(this,this,e)}perspectiveNO(e,t,n,s){return S.perspectiveNO(this,e,t,n,s)}perspectiveZO(e,t,n,s){return S.perspectiveZO(this,e,t,n,s)}orthoNO(e,t,n,s,r,a){return S.orthoNO(this,e,t,n,s,r,a)}orthoZO(e,t,n,s,r,a){return S.orthoZO(this,e,t,n,s,r,a)}static get BYTE_LENGTH(){return 16*Float64Array.BYTES_PER_ELEMENT}static create(){return new S}static clone(e){return new S(e)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static fromValues(...e){return new S(...e)}static set(e,...t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static transpose(e,t){if(e===t){let n=t[1],s=t[2],r=t[3],a=t[6],i=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=s,e[9]=a,e[11]=t[14],e[12]=r,e[13]=i,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[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]=y*p-i*P-L*F,e[5]=n*P-r*p+a*F,e[6]=m*R-b*B-o*x,e[7]=k*B-M*R+h*x,e[8]=i*I-c*p+L*D,e[9]=s*p-n*I-a*D,e[10]=b*g-d*R+o*V,e[11]=l*R-k*g-h*V,e[12]=c*F-i*Y-y*D,e[13]=n*Y-s*F+r*D,e[14]=d*x-b*z-m*V,e[15]=k*z-l*x+M*V,e}static determinant(e){let t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],i=e[5],c=e[6],y=e[7],L=e[8],k=e[9],l=e[10],M=e[11],h=e[12],b=e[13],d=e[14],m=e[15],o=t*i-n*a,V=t*c-s*a,x=n*c-s*i,R=L*b-k*h,z=L*d-l*h,g=k*d-l*b,B=t*g-n*z+s*R,D=a*g-i*z+c*R,F=L*x-k*V+l*o,p=h*x-b*V+d*o;return y*B-r*D+m*F-M*p}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=t[8],M=t[9],h=t[10],b=t[11],d=t[12],m=t[13],o=t[14],V=t[15],x=n[0],R=n[1],z=n[2],g=n[3];return e[0]=x*s+R*c+z*l+g*d,e[1]=x*r+R*y+z*M+g*m,e[2]=x*a+R*L+z*h+g*o,e[3]=x*i+R*k+z*b+g*V,x=n[4],R=n[5],z=n[6],g=n[7],e[4]=x*s+R*c+z*l+g*d,e[5]=x*r+R*y+z*M+g*m,e[6]=x*a+R*L+z*h+g*o,e[7]=x*i+R*k+z*b+g*V,x=n[8],R=n[9],z=n[10],g=n[11],e[8]=x*s+R*c+z*l+g*d,e[9]=x*r+R*y+z*M+g*m,e[10]=x*a+R*L+z*h+g*o,e[11]=x*i+R*k+z*b+g*V,x=n[12],R=n[13],z=n[14],g=n[15],e[12]=x*s+R*c+z*l+g*d,e[13]=x*r+R*y+z*M+g*m,e[14]=x*a+R*L+z*h+g*o,e[15]=x*i+R*k+z*b+g*V,e}static mul(e,t,n){return e}static translate(e,t,n){let s=n[0],r=n[1],a=n[2];if(t===e)e[12]=t[0]*s+t[4]*r+t[8]*a+t[12],e[13]=t[1]*s+t[5]*r+t[9]*a+t[13],e[14]=t[2]*s+t[6]*r+t[10]*a+t[14],e[15]=t[3]*s+t[7]*r+t[11]*a+t[15];else{let i=t[0],c=t[1],y=t[2],L=t[3],k=t[4],l=t[5],M=t[6],h=t[7],b=t[8],d=t[9],m=t[10],o=t[11];e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=k,e[5]=l,e[6]=M,e[7]=h,e[8]=b,e[9]=d,e[10]=m,e[11]=o,e[12]=i*s+k*r+b*a+t[12],e[13]=c*s+l*r+d*a+t[13],e[14]=y*s+M*r+m*a+t[14],e[15]=L*s+h*r+o*a+t[15]}return e}static scale(e,t,n){let s=n[0],r=n[1],a=n[2];return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}static rotate(e,t,n,s){let r=s[0],a=s[1],i=s[2],c=Math.sqrt(r*r+a*a+i*i);if(c<1e-6)return null;c=1/c,r*=c,a*=c,i*=c;let y=Math.sin(n),L=Math.cos(n),k=1-L,l=t[0],M=t[1],h=t[2],b=t[3],d=t[4],m=t[5],o=t[6],V=t[7],x=t[8],R=t[9],z=t[10],g=t[11],B=r*r*k+L,D=a*r*k+i*y,F=i*r*k-a*y,p=r*a*k-i*y,Y=a*a*k+L,I=i*a*k+r*y,P=r*i*k+a*y,Q=a*i*k-r*y,K=i*i*k+L;return e[0]=l*B+d*D+x*F,e[1]=M*B+m*D+R*F,e[2]=h*B+o*D+z*F,e[3]=b*B+V*D+g*F,e[4]=l*p+d*Y+x*I,e[5]=M*p+m*Y+R*I,e[6]=h*p+o*Y+z*I,e[7]=b*p+V*Y+g*I,e[8]=l*P+d*Q+x*K,e[9]=M*P+m*Q+R*K,e[10]=h*P+o*Q+z*K,e[11]=b*P+V*Q+g*K,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e}static rotateX(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[4],i=t[5],c=t[6],y=t[7],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+L*s,e[5]=i*r+k*s,e[6]=c*r+l*s,e[7]=y*r+M*s,e[8]=L*r-a*s,e[9]=k*r-i*s,e[10]=l*r-c*s,e[11]=M*r-y*s,e}static rotateY(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[8],k=t[9],l=t[10],M=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-L*s,e[1]=i*r-k*s,e[2]=c*r-l*s,e[3]=y*r-M*s,e[8]=a*s+L*r,e[9]=i*s+k*r,e[10]=c*s+l*r,e[11]=y*s+M*r,e}static rotateZ(e,t,n){let s=Math.sin(n),r=Math.cos(n),a=t[0],i=t[1],c=t[2],y=t[3],L=t[4],k=t[5],l=t[6],M=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+L*s,e[1]=i*r+k*s,e[2]=c*r+l*s,e[3]=y*r+M*s,e[4]=L*r-a*s,e[5]=k*r-i*s,e[6]=l*r-c*s,e[7]=M*r-y*s,e}static fromTranslation(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}static fromScaling(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotation(e,t,n){let s=n[0],r=n[1],a=n[2],i=Math.sqrt(s*s+r*r+a*a);if(i<1e-6)return null;i=1/i,s*=i,r*=i,a*=i;let c=Math.sin(t),y=Math.cos(t),L=1-y;return e[0]=s*s*L+y,e[1]=r*s*L+a*c,e[2]=a*s*L-r*c,e[3]=0,e[4]=s*r*L-a*c,e[5]=r*r*L+y,e[6]=a*r*L+s*c,e[7]=0,e[8]=s*a*L+r*c,e[9]=r*a*L-s*c,e[10]=a*a*L+y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromXRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromYRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromZRotation(e,t){let n=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static fromRotationTranslation(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=s+s,y=r+r,L=a+a,k=s*c,l=s*y,M=s*L,h=r*y,b=r*L,d=a*L,m=i*c,o=i*y,V=i*L;return e[0]=1-(h+d),e[1]=l+V,e[2]=M-o,e[3]=0,e[4]=l-V,e[5]=1-(k+d),e[6]=b+m,e[7]=0,e[8]=M+o,e[9]=b-m,e[10]=1-(k+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromQuat2(e,t){let n=-t[0],s=-t[1],r=-t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=n*n+s*s+r*r+a*a;return k>0?(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2/k,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2/k,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2/k):(E(S,$)[0]=(i*a+L*n+c*r-y*s)*2,E(S,$)[1]=(c*a+L*s+y*n-i*r)*2,E(S,$)[2]=(y*a+L*r+i*s-c*n)*2),S.fromRotationTranslation(e,t,E(S,$)),e}static normalFromMat4(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=t[4],c=t[5],y=t[6],L=t[7],k=t[8],l=t[9],M=t[10],h=t[11],b=t[12],d=t[13],m=t[14],o=t[15],V=n*c-s*i,x=n*y-r*i,R=n*L-a*i,z=s*y-r*c,g=s*L-a*c,B=r*L-a*y,D=k*d-l*b,F=k*m-M*b,p=k*o-h*b,Y=l*m-M*d,I=l*o-h*d,P=M*o-h*m,Q=V*P-x*I+R*Y+z*p-g*F+B*D;return Q?(Q=1/Q,e[0]=(c*P-y*I+L*Y)*Q,e[1]=(y*p-i*P-L*F)*Q,e[2]=(i*I-c*p+L*D)*Q,e[3]=0,e[4]=(r*I-s*P-a*Y)*Q,e[5]=(n*P-r*p+a*F)*Q,e[6]=(s*p-n*I-a*D)*Q,e[7]=0,e[8]=(d*B-m*g+o*z)*Q,e[9]=(m*R-b*B-o*x)*Q,e[10]=(b*g-d*R+o*V)*Q,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):null}static normalFromMat4Fast(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=i*k-k*L,e[1]=c*y-y*k,e[2]=a*L-L*y,e[3]=0,e[4]=L*r-k*s,e[5]=k*n-y*r,e[6]=y*s-L*n,e[7]=0,e[8]=s*c-r*i,e[9]=r*a-n*c,e[10]=n*i-s*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static getTranslation(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}static getScaling(e,t){let n=t[0],s=t[1],r=t[2],a=t[4],i=t[5],c=t[6],y=t[8],L=t[9],k=t[10];return e[0]=Math.sqrt(n*n+s*s+r*r),e[1]=Math.sqrt(a*a+i*i+c*c),e[2]=Math.sqrt(y*y+L*L+k*k),e}static getRotation(e,t){S.getScaling(E(S,$),t);let n=1/E(S,$)[0],s=1/E(S,$)[1],r=1/E(S,$)[2],a=t[0]*n,i=t[1]*s,c=t[2]*r,y=t[4]*n,L=t[5]*s,k=t[6]*r,l=t[8]*n,M=t[9]*s,h=t[10]*r,b=a+L+h,d=0;return b>0?(d=Math.sqrt(b+1)*2,e[3]=.25*d,e[0]=(k-M)/d,e[1]=(l-c)/d,e[2]=(i-y)/d):a>L&&a>h?(d=Math.sqrt(1+a-L-h)*2,e[3]=(k-M)/d,e[0]=.25*d,e[1]=(i+y)/d,e[2]=(l+c)/d):L>h?(d=Math.sqrt(1+L-a-h)*2,e[3]=(l-c)/d,e[0]=(i+y)/d,e[1]=.25*d,e[2]=(k+M)/d):(d=Math.sqrt(1+h-a-L)*2,e[3]=(i-y)/d,e[0]=(l+c)/d,e[1]=(k+M)/d,e[2]=.25*d),e}static decompose(e,t,n,s){t[0]=s[12],t[1]=s[13],t[2]=s[14];let r=s[0],a=s[1],i=s[2],c=s[4],y=s[5],L=s[6],k=s[8],l=s[9],M=s[10];n[0]=Math.sqrt(r*r+a*a+i*i),n[1]=Math.sqrt(c*c+y*y+L*L),n[2]=Math.sqrt(k*k+l*l+M*M);let h=1/n[0],b=1/n[1],d=1/n[2],m=r*h,o=a*b,V=i*d,x=c*h,R=y*b,z=L*d,g=k*h,B=l*b,D=M*d,F=m+R+D,p=0;return F>0?(p=Math.sqrt(F+1)*2,e[3]=.25*p,e[0]=(z-B)/p,e[1]=(g-V)/p,e[2]=(o-x)/p):m>R&&m>D?(p=Math.sqrt(1+m-R-D)*2,e[3]=(z-B)/p,e[0]=.25*p,e[1]=(o+x)/p,e[2]=(g+V)/p):R>D?(p=Math.sqrt(1+R-m-D)*2,e[3]=(g-V)/p,e[0]=(o+x)/p,e[1]=.25*p,e[2]=(z+B)/p):(p=Math.sqrt(1+D-m-R)*2,e[3]=(o-x)/p,e[0]=(g+V)/p,e[1]=(z+B)/p,e[2]=.25*p),e}static fromRotationTranslationScale(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=r+r,L=a+a,k=i+i,l=r*y,M=r*L,h=r*k,b=a*L,d=a*k,m=i*k,o=c*y,V=c*L,x=c*k,R=s[0],z=s[1],g=s[2];return e[0]=(1-(b+m))*R,e[1]=(M+x)*R,e[2]=(h-V)*R,e[3]=0,e[4]=(M-x)*z,e[5]=(1-(l+m))*z,e[6]=(d+o)*z,e[7]=0,e[8]=(h+V)*g,e[9]=(d-o)*g,e[10]=(1-(l+b))*g,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}static fromRotationTranslationScaleOrigin(e,t,n,s,r){let a=t[0],i=t[1],c=t[2],y=t[3],L=a+a,k=i+i,l=c+c,M=a*L,h=a*k,b=a*l,d=i*k,m=i*l,o=c*l,V=y*L,x=y*k,R=y*l,z=s[0],g=s[1],B=s[2],D=r[0],F=r[1],p=r[2],Y=(1-(d+o))*z,I=(h+R)*z,P=(b-x)*z,Q=(h-R)*g,K=(1-(M+o))*g,ee=(m+V)*g,te=(b+x)*B,Me=(m-V)*B,be=(1-(M+d))*B;return e[0]=Y,e[1]=I,e[2]=P,e[3]=0,e[4]=Q,e[5]=K,e[6]=ee,e[7]=0,e[8]=te,e[9]=Me,e[10]=be,e[11]=0,e[12]=n[0]+D-(Y*D+Q*F+te*p),e[13]=n[1]+F-(I*D+K*F+Me*p),e[14]=n[2]+p-(P*D+ee*F+be*p),e[15]=1,e}static fromQuat(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n+n,c=s+s,y=r+r,L=n*i,k=s*i,l=s*c,M=r*i,h=r*c,b=r*y,d=a*i,m=a*c,o=a*y;return e[0]=1-l-b,e[1]=k+o,e[2]=M-m,e[3]=0,e[4]=k-o,e[5]=1-L-b,e[6]=h+d,e[7]=0,e[8]=M+m,e[9]=h-d,e[10]=1-L-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}static frustumNO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=(i+a)*L,e[14]=2*i*a*L}else e[10]=-1,e[14]=-2*a;return e}static frustum(e,t,n,s,r,a,i=1/0){return e}static frustumZO(e,t,n,s,r,a,i=1/0){let c=1/(n-t),y=1/(r-s);if(e[0]=a*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*y,e[6]=0,e[7]=0,e[8]=(n+t)*c,e[9]=(r+s)*y,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let L=1/(a-i);e[10]=i*L,e[14]=i*a*L}else e[10]=-1,e[14]=-a;return e}static perspectiveNO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=(r+s)*i,e[14]=2*r*s*i}else e[10]=-1,e[14]=-2*s;return e}static perspective(e,t,n,s,r=1/0){return e}static perspectiveZO(e,t,n,s,r=1/0){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0){let i=1/(s-r);e[10]=r*i,e[14]=r*s*i}else e[10]=-1,e[14]=-s;return e}static perspectiveFromFieldOfView(e,t,n,s){let r=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),c=Math.tan(t.rightDegrees*Math.PI/180),y=2/(i+c),L=2/(r+a);return e[0]=y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=L,e[6]=0,e[7]=0,e[8]=-((i-c)*y*.5),e[9]=(r-a)*L*.5,e[10]=s/(n-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*n/(n-s),e[15]=0,e}static orthoNO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=(i+a)*L,e[15]=1,e}static ortho(e,t,n,s,r,a,i){return e}static orthoZO(e,t,n,s,r,a,i){let c=1/(t-n),y=1/(s-r),L=1/(a-i);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=L,e[11]=0,e[12]=(t+n)*c,e[13]=(r+s)*y,e[14]=a*L,e[15]=1,e}static lookAt(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=n[0],l=n[1],M=n[2];if(Math.abs(r-k)<1e-6&&Math.abs(a-l)<1e-6&&Math.abs(i-M)<1e-6)return S.identity(e);let h=r-k,b=a-l,d=i-M,m=1/Math.sqrt(h*h+b*b+d*d);h*=m,b*=m,d*=m;let o=y*d-L*b,V=L*h-c*d,x=c*b-y*h;m=Math.sqrt(o*o+V*V+x*x),m?(m=1/m,o*=m,V*=m,x*=m):(o=0,V=0,x=0);let R=b*x-d*V,z=d*o-h*x,g=h*V-b*o;return m=Math.sqrt(R*R+z*z+g*g),m?(m=1/m,R*=m,z*=m,g*=m):(R=0,z=0,g=0),e[0]=o,e[1]=R,e[2]=h,e[3]=0,e[4]=V,e[5]=z,e[6]=b,e[7]=0,e[8]=x,e[9]=g,e[10]=d,e[11]=0,e[12]=-(o*r+V*a+x*i),e[13]=-(R*r+z*a+g*i),e[14]=-(h*r+b*a+d*i),e[15]=1,e}static targetTo(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=s[0],y=s[1],L=s[2],k=r-n[0],l=a-n[1],M=i-n[2],h=k*k+l*l+M*M;h>0&&(h=1/Math.sqrt(h),k*=h,l*=h,M*=h);let b=y*M-L*l,d=L*k-c*M,m=c*l-y*k;return h=b*b+d*d+m*m,h>0&&(h=1/Math.sqrt(h),b*=h,d*=h,m*=h),e[0]=b,e[1]=d,e[2]=m,e[3]=0,e[4]=l*m-M*d,e[5]=M*b-k*m,e[6]=k*d-l*b,e[7]=0,e[8]=k,e[9]=l,e[10]=M,e[11]=0,e[12]=r,e[13]=a,e[14]=i,e[15]=1,e}static frob(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}static sub(e,t,n){return e}static multiplyScalar(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}static multiplyScalarAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e[4]=t[4]+n[4]*s,e[5]=t[5]+n[5]*s,e[6]=t[6]+n[6]*s,e[7]=t[7]+n[7]*s,e[8]=t[8]+n[8]*s,e[9]=t[9]+n[9]*s,e[10]=t[10]+n[10]*s,e[11]=t[11]+n[11]*s,e[12]=t[12]+n[12]*s,e[13]=t[13]+n[13]*s,e[14]=t[14]+n[14]*s,e[15]=t[15]+n[15]*s,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=e[8],l=e[9],M=e[10],h=e[11],b=e[12],d=e[13],m=e[14],o=e[15],V=t[0],x=t[1],R=t[2],z=t[3],g=t[4],B=t[5],D=t[6],F=t[7],p=t[8],Y=t[9],I=t[10],P=t[11],Q=t[12],K=t[13],ee=t[14],te=t[15];return Math.abs(n-V)<=1e-6*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-x)<=1e-6*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(r-R)<=1e-6*Math.max(1,Math.abs(r),Math.abs(R))&&Math.abs(a-z)<=1e-6*Math.max(1,Math.abs(a),Math.abs(z))&&Math.abs(i-g)<=1e-6*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(y-D)<=1e-6*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(L-F)<=1e-6*Math.max(1,Math.abs(L),Math.abs(F))&&Math.abs(k-p)<=1e-6*Math.max(1,Math.abs(k),Math.abs(p))&&Math.abs(l-Y)<=1e-6*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(M-I)<=1e-6*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(h-P)<=1e-6*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(b-Q)<=1e-6*Math.max(1,Math.abs(b),Math.abs(Q))&&Math.abs(d-K)<=1e-6*Math.max(1,Math.abs(d),Math.abs(K))&&Math.abs(m-ee)<=1e-6*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(o-te)<=1e-6*Math.max(1,Math.abs(o),Math.abs(te))}static str(e){return`Mat4(${e.join(\", \")})`}};ae=new WeakMap,$=new WeakMap,Z(S,ae,new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),Z(S,$,new Float64Array(3));var G=S;G.prototype.mul=G.prototype.multiply;G.sub=G.subtract;G.mul=G.multiply;G.frustum=G.frustumNO;G.perspective=G.perspectiveNO;G.ortho=G.orthoNO;var T=class A extends Float64Array{constructor(...e){switch(e.length){case 3:super(e);break;case 2:super(e[0],e[1],3);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t]):super(t,0,3);break}default:super(3);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get magnitude(){let e=this[0],t=this[1],n=this[2];return Math.sqrt(e*e+t*t+n*n)}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1],n=this[2];return e*e+t*t+n*n}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 3*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static magnitude(e){let t=e[0],n=e[1],s=e[2];return Math.sqrt(t*t+n*n+s*s)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static fromValues(e,t,n){return new A(e,t,n)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}static set(e,t,n,s){return e[0]=t,e[1]=n,e[2]=s,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}static sub(e,t,n){return[0,0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}static mul(e,t,n){return[0,0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}static div(e,t,n){return[0,0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+s*s+r*r)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2];return n*n+s*s+r*r}static sqrDist(e,t){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2];return t*t+n*n+s*s}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=n*n+s*s+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}static cross(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2];return e[0]=r*y-a*c,e[1]=a*i-s*y,e[2]=s*c-r*i,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e}static slerp(e,t,n,s){let r=Math.acos(Math.min(Math.max(A.dot(t,n),-1),1)),a=Math.sin(r),i=Math.sin((1-s)*r)/a,c=Math.sin(s*r)/a;return e[0]=i*t[0]+c*n[0],e[1]=i*t[1]+c*n[1],e[2]=i*t[2]+c*n[2],e}static hermite(e,t,n,s,r,a){let i=a*a,c=i*(2*a-3)+1,y=i*(a-2)+a,L=i*(a-1),k=i*(3-2*a);return e[0]=t[0]*c+n[0]*y+s[0]*L+r[0]*k,e[1]=t[1]*c+n[1]*y+s[1]*L+r[1]*k,e[2]=t[2]*c+n[2]*y+s[2]*L+r[2]*k,e}static bezier(e,t,n,s,r,a){let i=1-a,c=i*i,y=a*a,L=c*i,k=3*a*c,l=3*y*i,M=y*a;return e[0]=t[0]*L+n[0]*k+s[0]*l+r[0]*M,e[1]=t[1]*L+n[1]*k+s[1]*l+r[1]*M,e[2]=t[2]*L+n[2]*k+s[2]*l+r[2]*M,e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[3]*s+n[7]*r+n[11]*a+n[15]||1;return e[0]=(n[0]*s+n[4]*r+n[8]*a+n[12])/i,e[1]=(n[1]*s+n[5]*r+n[9]*a+n[13])/i,e[2]=(n[2]*s+n[6]*r+n[10]*a+n[14])/i,e}static transformMat3(e,t,n){let s=t[0],r=t[1],a=t[2];return e[0]=s*n[0]+r*n[3]+a*n[6],e[1]=s*n[1]+r*n[4]+a*n[7],e[2]=s*n[2]+r*n[5]+a*n[8],e}static transformQuat(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3]*2,c=t[0],y=t[1],L=t[2],k=r*L-a*y,l=a*c-s*L,M=s*y-r*c,h=(r*M-a*l)*2,b=(a*k-s*M)*2,d=(s*l-r*k)*2;return e[0]=c+k*i+h,e[1]=y+l*i+b,e[2]=L+M*i+d,e}static rotateX(e,t,n,s){let r=n[1],a=n[2],i=t[1]-r,c=t[2]-a;return e[0]=t[0],e[1]=i*Math.cos(s)-c*Math.sin(s)+r,e[2]=i*Math.sin(s)+c*Math.cos(s)+a,e}static rotateY(e,t,n,s){let r=n[0],a=n[2],i=t[0]-r,c=t[2]-a;return e[0]=c*Math.sin(s)+i*Math.cos(s)+r,e[1]=t[1],e[2]=c*Math.cos(s)-i*Math.sin(s)+a,e}static rotateZ(e,t,n,s){let r=n[0],a=n[1],i=t[0]-r,c=t[1]-a;return e[0]=i*Math.cos(s)-c*Math.sin(s)+r,e[1]=i*Math.sin(s)+c*Math.cos(s)+a,e[2]=n[2],e}static angle(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2],y=Math.sqrt((n*n+s*s+r*r)*(a*a+i*i+c*c)),L=y&&A.dot(e,t)/y;return Math.acos(Math.min(Math.max(L,-1),1))}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e}static str(e){return`Vec3(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=t[0],i=t[1],c=t[2];return Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(s-i)<=1e-6*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-c)<=1e-6*Math.max(1,Math.abs(r),Math.abs(c))}};T.prototype.sub=T.prototype.subtract;T.prototype.mul=T.prototype.multiply;T.prototype.div=T.prototype.divide;T.prototype.dist=T.prototype.distance;T.prototype.sqrDist=T.prototype.squaredDistance;T.sub=T.subtract;T.mul=T.multiply;T.div=T.divide;T.dist=T.distance;T.sqrDist=T.squaredDistance;T.sqrLen=T.squaredLength;T.mag=T.magnitude;T.length=T.magnitude;T.len=T.magnitude;var q=class A extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get b(){return this[2]}set b(e){this[2]=e}get a(){return this[3]}set a(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return A.str(this)}copy(e){return super.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this[2]+=e[2],this[3]+=e[3],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this[2]-=e[2],this[3]-=e[3],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this[2]*=e[2],this[3]*=e[3],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this[2]/=e[2],this[3]/=e[3],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this[2]+=e[2]*t,this[3]+=e[3]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this[2]*=-1,this[3]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this[2]=1/this[2],this[3]=1/this[3],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this[2]=Math.abs(this[2]),this[3]=Math.abs(this[3]),this}dot(e){return this[0]*e[0]+this[1]*e[1]+this[2]*e[2]+this[3]*e[3]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t,n,s){return new A(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}static sub(e,t,n){return e}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}static mul(e,t,n){return e}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}static div(e,t,n){return e}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e[2]=t[2]+n[2]*s,e[3]=t[3]+n[3]*s,e}static distance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,s,r,a)}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return n*n+s*s+r*r+a*a}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1],s=e[2],r=e[3];return Math.sqrt(t*t+n*n+s*s+r*r)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1],s=e[2],r=e[3];return t*t+n*n+s*s+r*r}static sqrLen(e){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e}static normalize(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a;return i>0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=s*i,e[2]=r*i,e[3]=a*i,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static cross(e,t,n,s){let r=n[0]*s[1]-n[1]*s[0],a=n[0]*s[2]-n[2]*s[0],i=n[0]*s[3]-n[3]*s[0],c=n[1]*s[2]-n[2]*s[1],y=n[1]*s[3]-n[3]*s[1],L=n[2]*s[3]-n[3]*s[2],k=t[0],l=t[1],M=t[2],h=t[3];return e[0]=l*L-M*y+h*c,e[1]=-(k*L)+M*i-h*a,e[2]=k*y-l*i+h*r,e[3]=-(k*c)+l*a-M*r,e}static lerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e[2]=i+s*(n[2]-i),e[3]=c+s*(n[3]-c),e}static transformMat4(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3];return e[0]=n[0]*s+n[4]*r+n[8]*a+n[12]*i,e[1]=n[1]*s+n[5]*r+n[9]*a+n[13]*i,e[2]=n[2]*s+n[6]*r+n[10]*a+n[14]*i,e[3]=n[3]*s+n[7]*r+n[11]*a+n[15]*i,e}static transformQuat(e,t,n){let s=t[0],r=t[1],a=t[2],i=n[0],c=n[1],y=n[2],L=n[3],k=L*s+c*a-y*r,l=L*r+y*s-i*a,M=L*a+i*r-c*s,h=-i*s-c*r-y*a;return e[0]=k*L+h*-i+l*-y-M*-c,e[1]=l*L+h*-c+M*-i-k*-y,e[2]=M*L+h*-y+k*-c-l*-i,e[3]=t[3],e}static zero(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}static str(e){return`Vec4(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=t[0],c=t[1],y=t[2],L=t[3];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-c)<=1e-6*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(a-L)<=1e-6*Math.max(1,Math.abs(a),Math.abs(L))}};q.prototype.sub=q.prototype.subtract;q.prototype.mul=q.prototype.multiply;q.prototype.div=q.prototype.divide;q.prototype.dist=q.prototype.distance;q.prototype.sqrDist=q.prototype.squaredDistance;q.sub=q.subtract;q.mul=q.multiply;q.div=q.divide;q.dist=q.distance;q.sqrDist=q.squaredDistance;q.sqrLen=q.squaredLength;q.mag=q.magnitude;q.length=q.magnitude;q.len=q.magnitude;var ke,ie,ce,W,U,le,he,f=class f extends Float64Array{constructor(...e){switch(e.length){case 4:super(e);break;case 2:super(e[0],e[1],4);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t]):super(t,0,4);break}default:super(4),this[3]=1;break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get z(){return this[2]}set z(e){this[2]=e}get w(){return this[3]}set w(e){this[3]=e}get magnitude(){let e=this[0],t=this[1],n=this[2],s=this[3];return Math.sqrt(e*e+t*t+n*n+s*s)}get mag(){return this.magnitude}get str(){return f.str(this)}copy(e){return super.set(e),this}identity(){return this[0]=0,this[1]=0,this[2]=0,this[3]=1,this}multiply(e){return f.multiply(this,this,e)}mul(e){return this}rotateX(e){return f.rotateX(this,this,e)}rotateY(e){return f.rotateY(this,this,e)}rotateZ(e){return f.rotateZ(this,this,e)}invert(){return f.invert(this,this)}scale(e){return this[0]*=e,this[1]*=e,this[2]*=e,this[3]*=e,this}dot(e){return f.dot(this,e)}static get BYTE_LENGTH(){return 4*Float64Array.BYTES_PER_ELEMENT}static create(){return new f}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}static setAxisAngle(e,t,n){n*=.5;let s=Math.sin(n);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(n),e}static getAxisAngle(e,t){let n=Math.acos(t[3])*2,s=Math.sin(n/2);return s>1e-6?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),n}static getAngle(e,t){let n=f.dot(e,t);return Math.acos(2*n*n-1)}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,e}static rotateX(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+i*c,e[1]=r*y+a*c,e[2]=a*y-r*c,e[3]=i*y-s*c,e}static rotateY(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y-a*c,e[1]=r*y+i*c,e[2]=a*y+s*c,e[3]=i*y-r*c,e}static rotateZ(e,t,n){n*=.5;let s=t[0],r=t[1],a=t[2],i=t[3],c=Math.sin(n),y=Math.cos(n);return e[0]=s*y+r*c,e[1]=r*y-s*c,e[2]=a*y+i*c,e[3]=i*y-a*c,e}static calculateW(e,t){let n=t[0],s=t[1],r=t[2];return e[0]=n,e[1]=s,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-s*s-r*r)),e}static exp(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=Math.exp(a),y=i>0?c*Math.sin(i)/i:0;return e[0]=n*y,e[1]=s*y,e[2]=r*y,e[3]=c*Math.cos(i),e}static ln(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=Math.sqrt(n*n+s*s+r*r),c=i>0?Math.atan2(i,a)/i:0;return e[0]=n*c,e[1]=s*c,e[2]=r*c,e[3]=.5*Math.log(n*n+s*s+r*r+a*a),e}static pow(e,t,n){return f.ln(e,t),f.scale(e,e,n),f.exp(e,e),e}static slerp(e,t,n,s){let r=t[0],a=t[1],i=t[2],c=t[3],y=n[0],L=n[1],k=n[2],l=n[3],M,h,b=r*y+a*L+i*k+c*l;if(b<0&&(b=-b,y=-y,L=-L,k=-k,l=-l),1-b>1e-6){let d=Math.acos(b),m=Math.sin(d);M=Math.sin((1-s)*d)/m,h=Math.sin(s*d)/m}else M=1-s,h=s;return e[0]=M*r+h*y,e[1]=M*a+h*L,e[2]=M*i+h*k,e[3]=M*c+h*l,e}static invert(e,t){let n=t[0],s=t[1],r=t[2],a=t[3],i=n*n+s*s+r*r+a*a,c=i?1/i:0;return e[0]=-n*c,e[1]=-s*c,e[2]=-r*c,e[3]=a*c,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}static fromMat3(e,t){let n=t[0]+t[4]+t[8],s;if(n>0)s=Math.sqrt(n+1),e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;s=Math.sqrt(t[r*3+r]-t[a*3+a]-t[i*3+i]+1),e[r]=.5*s,s=.5/s,e[3]=(t[a*3+i]-t[i*3+a])*s,e[a]=(t[a*3+r]+t[r*3+a])*s,e[i]=(t[i*3+r]+t[r*3+i])*s}return e}static fromEuler(e,t,n,s,r=E(f,ke)){let a=.5*Math.PI/180;t*=a,n*=a,s*=a;let i=Math.sin(t),c=Math.cos(t),y=Math.sin(n),L=Math.cos(n),k=Math.sin(s),l=Math.cos(s);switch(r){case\"xyz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"xzy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l+i*y*k;break;case\"yxz\":e[0]=i*L*l+c*y*k,e[1]=c*y*l-i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;case\"yzx\":e[0]=i*L*l+c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l-i*y*k;break;case\"zxy\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k+i*y*l,e[3]=c*L*l-i*y*k;break;case\"zyx\":e[0]=i*L*l-c*y*k,e[1]=c*y*l+i*L*k,e[2]=c*L*k-i*y*l,e[3]=c*L*l+i*y*k;break;default:throw new Error(`Unknown angle order ${r}`)}return e}static str(e){return`Quat(${e.join(\", \")})`}static clone(e){return new f(e)}static fromValues(e,t,n,s){return new f(e,t,n,s)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static set(e,t,n,s,r){return e}static add(e,t,n){return e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}static lerp(e,t,n,s){return e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){return e}static exactEquals(e,t){return!1}static equals(e,t){return!1}static rotationTo(e,t,n){let s=T.dot(t,n);return s<-.999999?(T.cross(E(f,U),E(f,le),t),T.mag(E(f,U))<1e-6&&T.cross(E(f,U),E(f,he),t),T.normalize(E(f,U),E(f,U)),f.setAxisAngle(e,E(f,U),Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(T.cross(E(f,U),t,n),e[0]=E(f,U)[0],e[1]=E(f,U)[1],e[2]=E(f,U)[2],e[3]=1+s,f.normalize(e,e))}static sqlerp(e,t,n,s,r,a){return f.slerp(E(f,ie),t,r,a),f.slerp(E(f,ce),n,s,a),f.slerp(e,E(f,ie),E(f,ce),2*a*(1-a)),e}static setAxes(e,t,n,s){return E(f,W)[0]=n[0],E(f,W)[3]=n[1],E(f,W)[6]=n[2],E(f,W)[1]=s[0],E(f,W)[4]=s[1],E(f,W)[7]=s[2],E(f,W)[2]=-t[0],E(f,W)[5]=-t[1],E(f,W)[8]=-t[2],f.normalize(e,f.fromMat3(e,E(f,W)))}};ke=new WeakMap,ie=new WeakMap,ce=new WeakMap,W=new WeakMap,U=new WeakMap,le=new WeakMap,he=new WeakMap,Z(f,ke,\"zyx\"),Z(f,ie,new Float64Array(4)),Z(f,ce,new Float64Array(4)),Z(f,W,new Float64Array(9)),Z(f,U,new Float64Array(3)),Z(f,le,new Float64Array([1,0,0])),Z(f,he,new Float64Array([0,1,0]));var O=f;O.set=q.set;O.add=q.add;O.lerp=q.lerp;O.normalize=q.normalize;O.squaredLength=q.squaredLength;O.sqrLen=q.squaredLength;O.exactEquals=q.exactEquals;O.equals=q.equals;O.magnitude=q.magnitude;O.prototype.mul=O.prototype.multiply;O.mul=O.multiply;O.mag=O.magnitude;O.length=O.magnitude;O.len=O.magnitude;var ye,Le,j=class j extends Float64Array{constructor(...e){switch(e.length){case 8:super(e);break;case 2:super(e[0],e[1],8);break;case 1:{let t=e[0];typeof t==\"number\"?super([t,t,t,t,t,t,t,t]):super(t,0,8);break}default:super(8),this[3]=1;break}}get str(){return j.str(this)}copy(e){return super.set(e),this}static get BYTE_LENGTH(){return 8*Float64Array.BYTES_PER_ELEMENT}static create(){return new j}static clone(e){return new j(e)}static fromValues(e,t,n,s,r,a,i,c){return new j(e,t,n,s,r,a,i,c)}static fromRotationTranslationValues(e,t,n,s,r,a,i){let c=r*.5,y=a*.5,L=i*.5;return new j(e,t,n,s,c*s+y*n-L*t,y*s+L*e-c*n,L*s+c*t-y*e,-c*e-y*t-L*n)}static fromRotationTranslation(e,t,n){let s=n[0]*.5,r=n[1]*.5,a=n[2]*.5,i=t[0],c=t[1],y=t[2],L=t[3];return e[0]=i,e[1]=c,e[2]=y,e[3]=L,e[4]=s*L+r*y-a*c,e[5]=r*L+a*i-s*y,e[6]=a*L+s*c-r*i,e[7]=-s*i-r*c-a*y,e}static fromTranslation(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0]*.5,e[5]=t[1]*.5,e[6]=t[2]*.5,e[7]=0,e}static fromRotation(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static fromMat4(e,t){return G.getRotation(E(j,ye),t),G.getTranslation(E(j,Le),t),j.fromRotationTranslation(e,E(j,ye),E(j,Le))}static copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}static identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}static set(e,t,n,s,r,a,i,c,y){return e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i,e[6]=c,e[7]=y,e}static getReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static getDual(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}static setReal(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}static setDual(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}static getTranslation(e,t){let n=t[4],s=t[5],r=t[6],a=t[7],i=-t[0],c=-t[1],y=-t[2],L=t[3];return e[0]=(n*L+a*i+s*y-r*c)*2,e[1]=(s*L+a*c+r*i-n*y)*2,e[2]=(r*L+a*y+n*c-s*i)*2,e}static translate(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0]*.5,y=n[1]*.5,L=n[2]*.5,k=t[4],l=t[5],M=t[6],h=t[7];return e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=i*c+r*L-a*y+k,e[5]=i*y+a*c-s*L+l,e[6]=i*L+s*y-r*c+M,e[7]=-s*c-r*y-a*L+h,e}static rotateX(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateX(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateY(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateY(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateZ(e,t,n){let s=-t[0],r=-t[1],a=-t[2],i=t[3],c=t[4],y=t[5],L=t[6],k=t[7],l=c*i+k*s+y*a-L*r,M=y*i+k*r+L*s-c*a,h=L*i+k*a+c*r-y*s,b=k*i-c*s-y*r-L*a;return O.rotateZ(e,t,n),s=e[0],r=e[1],a=e[2],i=e[3],e[4]=l*i+b*s+M*a-h*r,e[5]=M*i+b*r+h*s-l*a,e[6]=h*i+b*a+l*r-M*s,e[7]=b*i-l*s-M*r-h*a,e}static rotateByQuatAppend(e,t,n){let s=n[0],r=n[1],a=n[2],i=n[3],c=t[0],y=t[1],L=t[2],k=t[3];return e[0]=c*i+k*s+y*a-L*r,e[1]=y*i+k*r+L*s-c*a,e[2]=L*i+k*a+c*r-y*s,e[3]=k*i-c*s-y*r-L*a,c=t[4],y=t[5],L=t[6],k=t[7],e[4]=c*i+k*s+y*a-L*r,e[5]=y*i+k*r+L*s-c*a,e[6]=L*i+k*a+c*r-y*s,e[7]=k*i-c*s-y*r-L*a,e}static rotateByQuatPrepend(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[0],y=n[1],L=n[2],k=n[3];return e[0]=s*k+i*c+r*L-a*y,e[1]=r*k+i*y+a*c-s*L,e[2]=a*k+i*L+s*y-r*c,e[3]=i*k-s*c-r*y-a*L,c=n[4],y=n[5],L=n[6],k=n[7],e[4]=s*k+i*c+r*L-a*y,e[5]=r*k+i*y+a*c-s*L,e[6]=a*k+i*L+s*y-r*c,e[7]=i*k-s*c-r*y-a*L,e}static rotateAroundAxis(e,t,n,s){if(Math.abs(s)<1e-6)return j.copy(e,t);let r=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);s*=.5;let a=Math.sin(s),i=a*n[0]/r,c=a*n[1]/r,y=a*n[2]/r,L=Math.cos(s),k=t[0],l=t[1],M=t[2],h=t[3];e[0]=k*L+h*i+l*y-M*c,e[1]=l*L+h*c+M*i-k*y,e[2]=M*L+h*y+k*c-l*i,e[3]=h*L-k*i-l*c-M*y;let b=t[4],d=t[5],m=t[6],o=t[7];return e[4]=b*L+o*i+d*y-m*c,e[5]=d*L+o*c+m*i-b*y,e[6]=m*L+o*y+b*c-d*i,e[7]=o*L-b*i-d*c-m*y,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}static multiply(e,t,n){let s=t[0],r=t[1],a=t[2],i=t[3],c=n[4],y=n[5],L=n[6],k=n[7],l=t[4],M=t[5],h=t[6],b=t[7],d=n[0],m=n[1],o=n[2],V=n[3];return e[0]=s*V+i*d+r*o-a*m,e[1]=r*V+i*m+a*d-s*o,e[2]=a*V+i*o+s*m-r*d,e[3]=i*V-s*d-r*m-a*o,e[4]=s*k+i*c+r*L-a*y+l*V+b*d+M*o-h*m,e[5]=r*k+i*y+a*c-s*L+M*V+b*m+h*d-l*o,e[6]=a*k+i*L+s*y-r*c+h*V+b*o+l*m-M*d,e[7]=i*k-s*c-r*y-a*L+b*V-l*d-M*m-h*o,e}static mul(e,t,n){return e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}static dot(e,t){return 0}static lerp(e,t,n,s){let r=1-s;return j.dot(t,n)<0&&(s=-s),e[0]=t[0]*r+n[0]*s,e[1]=t[1]*r+n[1]*s,e[2]=t[2]*r+n[2]*s,e[3]=t[3]*r+n[3]*s,e[4]=t[4]*r+n[4]*s,e[5]=t[5]*r+n[5]*s,e[6]=t[6]*r+n[6]*s,e[7]=t[7]*r+n[7]*s,e}static invert(e,t){let n=j.squaredLength(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}static conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}static magnitude(e){return 0}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){return 0}static sqrLen(e){return 0}static normalize(e,t){let n=j.squaredLength(t);if(n>0){n=Math.sqrt(n);let s=t[0]/n,r=t[1]/n,a=t[2]/n,i=t[3]/n,c=t[4],y=t[5],L=t[6],k=t[7],l=s*c+r*y+a*L+i*k;e[0]=s,e[1]=r,e[2]=a,e[3]=i,e[4]=(c-s*l)/n,e[5]=(y-r*l)/n,e[6]=(L-a*l)/n,e[7]=(k-i*l)/n}return e}static str(e){return`Quat2(${e.join(\", \")})`}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}static equals(e,t){let n=e[0],s=e[1],r=e[2],a=e[3],i=e[4],c=e[5],y=e[6],L=e[7],k=t[0],l=t[1],M=t[2],h=t[3],b=t[4],d=t[5],m=t[6],o=t[7];return Math.abs(n-k)<=1e-6*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-l)<=1e-6*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-M)<=1e-6*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-h)<=1e-6*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(c-d)<=1e-6*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(y-m)<=1e-6*Math.max(1,Math.abs(y),Math.abs(m))&&Math.abs(L-o)<=1e-6*Math.max(1,Math.abs(L),Math.abs(o))}};ye=new WeakMap,Le=new WeakMap,Z(j,ye,new Float64Array(4)),Z(j,Le,new Float64Array(3));var J=j;J.dot=O.dot;J.squaredLength=O.squaredLength;J.sqrLen=O.squaredLength;J.mag=O.magnitude;J.length=O.magnitude;J.len=O.magnitude;J.mul=J.multiply;var N=class A extends Float64Array{constructor(...e){switch(e.length){case 2:{let t=e[0];typeof t==\"number\"?super([t,e[1]]):super(t,e[1],2);break}case 1:{let t=e[0];typeof t==\"number\"?super([t,t]):super(t,0,2);break}default:super(2);break}}get x(){return this[0]}set x(e){this[0]=e}get y(){return this[1]}set y(e){this[1]=e}get r(){return this[0]}set r(e){this[0]=e}get g(){return this[1]}set g(e){this[1]=e}get magnitude(){return Math.hypot(this[0],this[1])}get mag(){return this.magnitude}get squaredMagnitude(){let e=this[0],t=this[1];return e*e+t*t}get sqrMag(){return this.squaredMagnitude}get str(){return A.str(this)}copy(e){return this.set(e),this}add(e){return this[0]+=e[0],this[1]+=e[1],this}subtract(e){return this[0]-=e[0],this[1]-=e[1],this}sub(e){return this}multiply(e){return this[0]*=e[0],this[1]*=e[1],this}mul(e){return this}divide(e){return this[0]/=e[0],this[1]/=e[1],this}div(e){return this}scale(e){return this[0]*=e,this[1]*=e,this}scaleAndAdd(e,t){return this[0]+=e[0]*t,this[1]+=e[1]*t,this}distance(e){return A.distance(this,e)}dist(e){return 0}squaredDistance(e){return A.squaredDistance(this,e)}sqrDist(e){return 0}negate(){return this[0]*=-1,this[1]*=-1,this}invert(){return this[0]=1/this[0],this[1]=1/this[1],this}abs(){return this[0]=Math.abs(this[0]),this[1]=Math.abs(this[1]),this}dot(e){return this[0]*e[0]+this[1]*e[1]}normalize(){return A.normalize(this,this)}static get BYTE_LENGTH(){return 2*Float64Array.BYTES_PER_ELEMENT}static create(){return new A}static clone(e){return new A(e)}static fromValues(e,t){return new A(e,t)}static copy(e,t){return e[0]=t[0],e[1]=t[1],e}static set(e,t,n){return e[0]=t,e[1]=n,e}static add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}static subtract(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}static sub(e,t,n){return[0,0]}static multiply(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}static mul(e,t,n){return[0,0]}static divide(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}static div(e,t,n){return[0,0]}static ceil(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}static floor(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}static min(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}static max(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}static round(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}static scale(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}static scaleAndAdd(e,t,n,s){return e[0]=t[0]+n[0]*s,e[1]=t[1]+n[1]*s,e}static distance(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}static dist(e,t){return 0}static squaredDistance(e,t){let n=t[0]-e[0],s=t[1]-e[1];return n*n+s*s}static sqrDist(e,t){return 0}static magnitude(e){let t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}static mag(e){return 0}static length(e){return 0}static len(e){return 0}static squaredLength(e){let t=e[0],n=e[1];return t*t+n*n}static sqrLen(e,t){return 0}static negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}static inverse(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}static abs(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e}static normalize(e,t){let n=t[0],s=t[1],r=n*n+s*s;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}static dot(e,t){return e[0]*t[0]+e[1]*t[1]}static cross(e,t,n){let s=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=s,e}static lerp(e,t,n,s){let r=t[0],a=t[1];return e[0]=r+s*(n[0]-r),e[1]=a+s*(n[1]-a),e}static transformMat2(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r,e[1]=n[1]*s+n[3]*r,e}static transformMat2d(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[2]*r+n[4],e[1]=n[1]*s+n[3]*r+n[5],e}static transformMat3(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[3]*r+n[6],e[1]=n[1]*s+n[4]*r+n[7],e}static transformMat4(e,t,n){let s=t[0],r=t[1];return e[0]=n[0]*s+n[4]*r+n[12],e[1]=n[1]*s+n[5]*r+n[13],e}static rotate(e,t,n,s){let r=t[0]-n[0],a=t[1]-n[1],i=Math.sin(s),c=Math.cos(s);return e[0]=r*c-a*i+n[0],e[1]=r*i+a*c+n[1],e}static angle(e,t){let n=e[0],s=e[1],r=t[0],a=t[1],i=Math.sqrt(n*n+s*s)*Math.sqrt(r*r+a*a),c=i&&(n*r+s*a)/i;return Math.acos(Math.min(Math.max(c,-1),1))}static zero(e){return e[0]=0,e[1]=0,e}static exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]}static equals(e,t){let n=e[0],s=e[1],r=t[0],a=t[1];return Math.abs(n-r)<=1e-6*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}static str(e){return`Vec2(${e.join(\", \")})`}};N.prototype.sub=N.prototype.subtract;N.prototype.mul=N.prototype.multiply;N.prototype.div=N.prototype.divide;N.prototype.dist=N.prototype.distance;N.prototype.sqrDist=N.prototype.squaredDistance;N.sub=N.subtract;N.mul=N.multiply;N.div=N.divide;N.dist=N.distance;N.sqrDist=N.squaredDistance;N.sqrLen=N.squaredLength;N.mag=N.magnitude;N.length=N.magnitude;N.len=N.magnitude;var me=!1;function ve(){if(me)return;let A=[\"xx\",\"xy\",\"yx\",\"yy\",\"xxx\",\"xxy\",\"xyx\",\"xyy\",\"yxx\",\"yxy\",\"yyx\",\"yyy\",\"xxxx\",\"xxxy\",\"xxyx\",\"xxyy\",\"xyxx\",\"xyxy\",\"xyyx\",\"xyyy\",\"yxxx\",\"yxxy\",\"yxyx\",\"yxyy\",\"yyxx\",\"yyxy\",\"yyyx\",\"yyyy\",\"rr\",\"rg\",\"gr\",\"gg\",\"rrr\",\"rrg\",\"rgr\",\"rgg\",\"grr\",\"grg\",\"ggr\",\"ggg\",\"rrrr\",\"rrrg\",\"rrgr\",\"rrgg\",\"rgrr\",\"rgrg\",\"rggr\",\"rggg\",\"grrr\",\"grrg\",\"grgr\",\"grgg\",\"ggrr\",\"ggrg\",\"gggr\",\"gggg\"],e=[\"xz\",\"yz\",\"zx\",\"zy\",\"zz\",\"xxz\",\"xyz\",\"xzx\",\"xzy\",\"xzz\",\"yxz\",\"yyz\",\"yzx\",\"yzy\",\"yzz\",\"zxx\",\"zxy\",\"zxz\",\"zyx\",\"zyy\",\"zyz\",\"zzx\",\"zzy\",\"zzz\",\"xxxz\",\"xxyz\",\"xxzx\",\"xxzy\",\"xxzz\",\"xyxz\",\"xyyz\",\"xyzx\",\"xyzy\",\"xyzz\",\"xzxx\",\"xzxy\",\"xzxz\",\"xzyx\",\"xzyy\",\"xzyz\",\"xzzx\",\"xzzy\",\"xzzz\",\"yxxz\",\"yxyz\",\"yxzx\",\"yxzy\",\"yxzz\",\"yyxz\",\"yyyz\",\"yyzx\",\"yyzy\",\"yyzz\",\"yzxx\",\"yzxy\",\"yzxz\",\"yzyx\",\"yzyy\",\"yzyz\",\"yzzx\",\"yzzy\",\"yzzz\",\"zxxx\",\"zxxy\",\"zxxz\",\"zxyx\",\"zxyy\",\"zxyz\",\"zxzx\",\"zxzy\",\"zxzz\",\"zyxx\",\"zyxy\",\"zyxz\",\"zyyx\",\"zyyy\",\"zyyz\",\"zyzx\",\"zyzy\",\"zyzz\",\"zzxx\",\"zzxy\",\"zzxz\",\"zzyx\",\"zzyy\",\"zzyz\",\"zzzx\",\"zzzy\",\"zzzz\",\"rb\",\"gb\",\"br\",\"bg\",\"bb\",\"rrb\",\"rgb\",\"rbr\",\"rbg\",\"rbb\",\"grb\",\"ggb\",\"gbr\",\"gbg\",\"gbb\",\"brr\",\"brg\",\"brb\",\"bgr\",\"bgg\",\"bgb\",\"bbr\",\"bbg\",\"bbb\",\"rrrb\",\"rrgb\",\"rrbr\",\"rrbg\",\"rrbb\",\"rgrb\",\"rggb\",\"rgbr\",\"rgbg\",\"rgbb\",\"rbrr\",\"rbrg\",\"rbrb\",\"rbgr\",\"rbgg\",\"rbgb\",\"rbbr\",\"rbbg\",\"rbbb\",\"grrb\",\"grgb\",\"grbr\",\"grbg\",\"grbb\",\"ggrb\",\"gggb\",\"ggbr\",\"ggbg\",\"ggbb\",\"gbrr\",\"gbrg\",\"gbrb\",\"gbgr\",\"gbgg\",\"gbgb\",\"gbbr\",\"gbbg\",\"gbbb\",\"brrr\",\"brrg\",\"brrb\",\"brgr\",\"brgg\",\"brgb\",\"brbr\",\"brbg\",\"brbb\",\"bgrr\",\"bgrg\",\"bgrb\",\"bggr\",\"bggg\",\"bggb\",\"bgbr\",\"bgbg\",\"bgbb\",\"bbrr\",\"bbrg\",\"bbrb\",\"bbgr\",\"bbgg\",\"bbgb\",\"bbbr\",\"bbbg\",\"bbbb\"],t=[\"xw\",\"yw\",\"zw\",\"wx\",\"wy\",\"wz\",\"ww\",\"xxw\",\"xyw\",\"xzw\",\"xwx\",\"xwy\",\"xwz\",\"xww\",\"yxw\",\"yyw\",\"yzw\",\"ywx\",\"ywy\",\"ywz\",\"yww\",\"zxw\",\"zyw\",\"zzw\",\"zwx\",\"zwy\",\"zwz\",\"zww\",\"wxx\",\"wxy\",\"wxz\",\"wxw\",\"wyx\",\"wyy\",\"wyz\",\"wyw\",\"wzx\",\"wzy\",\"wzz\",\"wzw\",\"wwx\",\"wwy\",\"wwz\",\"www\",\"xxxw\",\"xxyw\",\"xxzw\",\"xxwx\",\"xxwy\",\"xxwz\",\"xxww\",\"xyxw\",\"xyyw\",\"xyzw\",\"xywx\",\"xywy\",\"xywz\",\"xyww\",\"xzxw\",\"xzyw\",\"xzzw\",\"xzwx\",\"xzwy\",\"xzwz\",\"xzww\",\"xwxx\",\"xwxy\",\"xwxz\",\"xwxw\",\"xwyx\",\"xwyy\",\"xwyz\",\"xwyw\",\"xwzx\",\"xwzy\",\"xwzz\",\"xwzw\",\"xwwx\",\"xwwy\",\"xwwz\",\"xwww\",\"yxxw\",\"yxyw\",\"yxzw\",\"yxwx\",\"yxwy\",\"yxwz\",\"yxww\",\"yyxw\",\"yyyw\",\"yyzw\",\"yywx\",\"yywy\",\"yywz\",\"yyww\",\"yzxw\",\"yzyw\",\"yzzw\",\"yzwx\",\"yzwy\",\"yzwz\",\"yzww\",\"ywxx\",\"ywxy\",\"ywxz\",\"ywxw\",\"ywyx\",\"ywyy\",\"ywyz\",\"ywyw\",\"ywzx\",\"ywzy\",\"ywzz\",\"ywzw\",\"ywwx\",\"ywwy\",\"ywwz\",\"ywww\",\"zxxw\",\"zxyw\",\"zxzw\",\"zxwx\",\"zxwy\",\"zxwz\",\"zxww\",\"zyxw\",\"zyyw\",\"zyzw\",\"zywx\",\"zywy\",\"zywz\",\"zyww\",\"zzxw\",\"zzyw\",\"zzzw\",\"zzwx\",\"zzwy\",\"zzwz\",\"zzww\",\"zwxx\",\"zwxy\",\"zwxz\",\"zwxw\",\"zwyx\",\"zwyy\",\"zwyz\",\"zwyw\",\"zwzx\",\"zwzy\",\"zwzz\",\"zwzw\",\"zwwx\",\"zwwy\",\"zwwz\",\"zwww\",\"wxxx\",\"wxxy\",\"wxxz\",\"wxxw\",\"wxyx\",\"wxyy\",\"wxyz\",\"wxyw\",\"wxzx\",\"wxzy\",\"wxzz\",\"wxzw\",\"wxwx\",\"wxwy\",\"wxwz\",\"wxww\",\"wyxx\",\"wyxy\",\"wyxz\",\"wyxw\",\"wyyx\",\"wyyy\",\"wyyz\",\"wyyw\",\"wyzx\",\"wyzy\",\"wyzz\",\"wyzw\",\"wywx\",\"wywy\",\"wywz\",\"wyww\",\"wzxx\",\"wzxy\",\"wzxz\",\"wzxw\",\"wzyx\",\"wzyy\",\"wzyz\",\"wzyw\",\"wzzx\",\"wzzy\",\"wzzz\",\"wzzw\",\"wzwx\",\"wzwy\",\"wzwz\",\"wzww\",\"wwxx\",\"wwxy\",\"wwxz\",\"wwxw\",\"wwyx\",\"wwyy\",\"wwyz\",\"wwyw\",\"wwzx\",\"wwzy\",\"wwzz\",\"wwzw\",\"wwwx\",\"wwwy\",\"wwwz\",\"wwww\",\"ra\",\"ga\",\"ba\",\"ar\",\"ag\",\"ab\",\"aa\",\"rra\",\"rga\",\"rba\",\"rar\",\"rag\",\"rab\",\"raa\",\"gra\",\"gga\",\"gba\",\"gar\",\"gag\",\"gab\",\"gaa\",\"bra\",\"bga\",\"bba\",\"bar\",\"bag\",\"bab\",\"baa\",\"arr\",\"arg\",\"arb\",\"ara\",\"agr\",\"agg\",\"agb\",\"aga\",\"abr\",\"abg\",\"abb\",\"aba\",\"aar\",\"aag\",\"aab\",\"aaa\",\"rrra\",\"rrga\",\"rrba\",\"rrar\",\"rrag\",\"rrab\",\"rraa\",\"rgra\",\"rgga\",\"rgba\",\"rgar\",\"rgag\",\"rgab\",\"rgaa\",\"rbra\",\"rbga\",\"rbba\",\"rbar\",\"rbag\",\"rbab\",\"rbaa\",\"rarr\",\"rarg\",\"rarb\",\"rara\",\"ragr\",\"ragg\",\"ragb\",\"raga\",\"rabr\",\"rabg\",\"rabb\",\"raba\",\"raar\",\"raag\",\"raab\",\"raaa\",\"grra\",\"grga\",\"grba\",\"grar\",\"grag\",\"grab\",\"graa\",\"ggra\",\"ggga\",\"ggba\",\"ggar\",\"ggag\",\"ggab\",\"ggaa\",\"gbra\",\"gbga\",\"gbba\",\"gbar\",\"gbag\",\"gbab\",\"gbaa\",\"garr\",\"garg\",\"garb\",\"gara\",\"gagr\",\"gagg\",\"gagb\",\"gaga\",\"gabr\",\"gabg\",\"gabb\",\"gaba\",\"gaar\",\"gaag\",\"gaab\",\"gaaa\",\"brra\",\"brga\",\"brba\",\"brar\",\"brag\",\"brab\",\"braa\",\"bgra\",\"bgga\",\"bgba\",\"bgar\",\"bgag\",\"bgab\",\"bgaa\",\"bbra\",\"bbga\",\"bbba\",\"bbar\",\"bbag\",\"bbab\",\"bbaa\",\"barr\",\"barg\",\"barb\",\"bara\",\"bagr\",\"bagg\",\"bagb\",\"baga\",\"babr\",\"babg\",\"babb\",\"baba\",\"baar\",\"baag\",\"baab\",\"baaa\",\"arrr\",\"arrg\",\"arrb\",\"arra\",\"argr\",\"argg\",\"argb\",\"arga\",\"arbr\",\"arbg\",\"arbb\",\"arba\",\"arar\",\"arag\",\"arab\",\"araa\",\"agrr\",\"agrg\",\"agrb\",\"agra\",\"aggr\",\"aggg\",\"aggb\",\"agga\",\"agbr\",\"agbg\",\"agbb\",\"agba\",\"agar\",\"agag\",\"agab\",\"agaa\",\"abrr\",\"abrg\",\"abrb\",\"abra\",\"abgr\",\"abgg\",\"abgb\",\"abga\",\"abbr\",\"abbg\",\"abbb\",\"abba\",\"abar\",\"abag\",\"abab\",\"abaa\",\"aarr\",\"aarg\",\"aarb\",\"aara\",\"aagr\",\"aagg\",\"aagb\",\"aaga\",\"aabr\",\"aabg\",\"aabb\",\"aaba\",\"aaar\",\"aaag\",\"aaab\",\"aaaa\"],n={x:0,r:0,y:1,g:1,z:2,b:2,w:3,a:3};function s(r){switch(r.length){case 2:return function(){return new N(this[n[r[0]]],this[n[r[1]]])};case 3:return function(){return new T(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]])};case 4:return function(){return new q(this[n[r[0]]],this[n[r[1]]],this[n[r[2]]],this[n[r[3]]])}}throw new Error(\"Illegal swizzle length\")}for(let r of A){let a=s(r);Object.defineProperty(N.prototype,r,{get:a}),Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of e){let a=s(r);Object.defineProperty(T.prototype,r,{get:a}),Object.defineProperty(q.prototype,r,{get:a})}for(let r of t){let a=s(r);Object.defineProperty(q.prototype,r,{get:a})}me=!0}var xe=Math.PI/180,Re=180/Math.PI;function _e(A){return A*Re}function et(A){return A*xe}export{ve as EnableSwizzlesF64,v as Mat2,_ as Mat2d,u as Mat3,G as Mat4,O as Quat,J as Quat2,N as Vec2,T as Vec3,q as Vec4,_e as toDegree,et as toRadian};\n//# sourceMappingURL=gl-matrix-f64.min.js.map\n"],"names":["ne","C","_Float64Array","_this","_classCallCheck","_len","arguments","length","e","Array","_key","_callSuper","t","E","_assertThisInitialized","_inherits","_createClass","key","get","str","value","copy","set","identity","multiply","mul","transpose","invert","scale","rotate","Float64Array","BYTES_PER_ELEMENT","create","clone","fromValues","_len2","_key2","_construct","undefined","n","s","r","a","i","adjoint","determinant","add","subtract","sub","c","y","L","k","Math","sin","cos","fromRotation","fromScaling","frob","sqrt","multiplyScalar","multiplyScalarAndAdd","LDU","exactEquals","equals","abs","max","concat","join","_wrapNativeSuper","WeakMap","Z","v","prototype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;"} \ No newline at end of file diff --git a/esm-d-ts.config.js b/esm-d-ts.config.js index 16160d04..1fea6fe2 100644 --- a/esm-d-ts.config.js +++ b/esm-d-ts.config.js @@ -2,6 +2,11 @@ * Generates bundled type declaration for main and all sub-path exports: classic / common / f64 / swizzle, etc. */ +// When consuming `gl-matrix` from a Typescript project configured to output CJS Typescript explicitly requires a +// `.d.cts` declaration file to be present. This option simply emits a duplicate of `.d.mts` as `.d.cts` which is +// referenced in `package.json` for `require` export conditions. +const emitCTS = true; + // Enables handling `imports` from `package.json` as local package paths transforming them and marking them external in // bundling. const importsLocal = true; @@ -17,20 +22,20 @@ const dtsReplaceCDN = { "declare module '[^']*' \\{([\\s\\S]*?)^\\}": '$1' }; /** @type {import('@typhonjs-build-test/esm-d-ts').GenerateConfig[]} */ const configs = [ // Bundles main and all sub-path export types configured in `package.json` exports. - { input: './src/index.ts', output: './dist/index.d.mts', importsLocal }, - { input: './src/classic/index.ts', output: './dist/classic/index.d.mts', importsLocal }, - { input: './src/common/index.ts', output: './dist/common/index.d.mts', importsLocal }, - { input: './src/f64/index.ts', output: './dist/f64/index.d.mts', importsLocal }, - { input: './src/swizzle/index.ts', output: './dist/swizzle/index.d.mts', importsLocal }, - { input: './src/swizzle/f64/index.ts', output: './dist/swizzle/f64/index.d.mts', importsLocal }, - { input: './src/types/index.ts', output: './dist/types/index.d.mts', importsLocal }, - { input: './src/types/swizzle/index.ts', output: './dist/types/swizzle/index.d.mts', importsLocal, dtsReplace }, - { input: './src/types/swizzle/f64/index.ts', output: './dist/types/swizzle/f64/index.d.mts', importsLocal, dtsReplace }, - { input: './src/util/index.ts', output: './dist/util/index.d.mts', importsLocal }, + { input: './src/index.ts', output: './dist/index.d.mts', emitCTS, importsLocal }, + { input: './src/classic/index.ts', output: './dist/classic/index.d.mts', emitCTS, importsLocal }, + { input: './src/common/index.ts', output: './dist/common/index.d.mts', emitCTS, importsLocal }, + { input: './src/f64/index.ts', output: './dist/f64/index.d.mts', emitCTS, importsLocal }, + { input: './src/swizzle/index.ts', output: './dist/swizzle/index.d.mts', emitCTS, importsLocal }, + { input: './src/swizzle/f64/index.ts', output: './dist/swizzle/f64/index.d.mts', emitCTS, importsLocal }, + { input: './src/types/index.ts', output: './dist/types/index.d.mts', emitCTS, importsLocal }, + { input: './src/types/swizzle/index.ts', output: './dist/types/swizzle/index.d.mts', emitCTS, importsLocal, dtsReplace }, + { input: './src/types/swizzle/f64/index.ts', output: './dist/types/swizzle/f64/index.d.mts', emitCTS, importsLocal, dtsReplace }, + { input: './src/util/index.ts', output: './dist/util/index.d.mts', emitCTS, importsLocal }, // Bundles CDN types. - { input: './src/cdn/index.ts', output: './dist-cdn/types/gl-matrix-f32.d.mts', dtsReplace: dtsReplaceCDN }, - { input: './src/cdn/f64/index.ts', output: './dist-cdn/types/gl-matrix-f64.d.mts', dtsReplace: dtsReplaceCDN } + { input: './src/cdn/index.ts', output: './dist-cdn/types/gl-matrix-f32.d.mts', emitCTS, dtsReplace: dtsReplaceCDN }, + { input: './src/cdn/f64/index.ts', output: './dist-cdn/types/gl-matrix-f64.d.mts', emitCTS, dtsReplace: dtsReplaceCDN } ]; export default configs; diff --git a/package-lock.json b/package-lock.json index b2e90a24..27c4b0ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,18 +9,18 @@ "version": "4.0.0-beta.3", "license": "MIT", "devDependencies": { - "@babel/core": "^7.25.2", - "@babel/preset-env": "^7.25.4", + "@babel/core": "^7.26.0", + "@babel/preset-env": "^7.26.0", "@rollup/plugin-babel": "^6.0.4", - "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", - "@typhonjs-typedoc/typedoc-pkg": "^0.1.1", + "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.9", + "@typhonjs-typedoc/typedoc-pkg": "^0.2.0", "@vitest/coverage-v8": "^2.1.0", "@vitest/ui": "^2.1.0", - "esbuild": "^0.23.0", - "eslint": "^9.10.0", - "rollup": "^4.22.0", - "typescript": "^5.6.0", - "typescript-eslint": "^8.6.0", + "esbuild": "^0.24.0", + "eslint": "^9.16.0", + "rollup": "^4.28.0", + "typescript": "^5.7.0", + "typescript-eslint": "^8.17.0", "vitest": "^2.1.0" } }, @@ -29,6 +29,7 @@ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -38,12 +39,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -51,30 +54,32 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", - "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", + "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", - "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.0", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-module-transforms": "^7.25.2", - "@babel/helpers": "^7.25.0", - "@babel/parser": "^7.25.0", - "@babel/template": "^7.25.0", - "@babel/traverse": "^7.25.2", - "@babel/types": "^7.25.2", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -90,54 +95,59 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", - "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", + "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.25.6", + "@babel/parser": "^7.26.2", + "@babel/types": "^7.26.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", - "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", - "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz", + "integrity": "sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", - "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", + "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.2", - "@babel/helper-validator-option": "^7.24.8", - "browserslist": "^4.23.1", + "@babel/compat-data": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -146,17 +156,18 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.4.tgz", - "integrity": "sha512-ro/bFs3/84MDgDmMwbcHgDa8/E6J3QKNTk4xJJnVeFtGE+tL0K26E3pNxhYz2b67fJpt7Aphw5XcploKXuCvCQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", + "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.8", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/helper-replace-supers": "^7.25.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/traverse": "^7.25.4", + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/traverse": "^7.25.9", "semver": "^6.3.1" }, "engines": { @@ -167,13 +178,14 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", - "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz", + "integrity": "sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "regexpu-core": "^5.3.1", + "@babel/helper-annotate-as-pure": "^7.25.9", + "regexpu-core": "^6.1.1", "semver": "^6.3.1" }, "engines": { @@ -184,10 +196,11 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", - "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz", + "integrity": "sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -200,41 +213,43 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", - "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", + "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.8", - "@babel/types": "^7.24.8" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", - "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", - "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.2" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -244,35 +259,38 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", - "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", + "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", - "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", - "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz", + "integrity": "sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-wrap-function": "^7.25.0", - "@babel/traverse": "^7.25.0" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-wrap-function": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -282,14 +300,15 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", - "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", + "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.24.8", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -299,107 +318,100 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", - "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz", + "integrity": "sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", - "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", + "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", - "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", - "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz", + "integrity": "sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/template": "^7.25.0", - "@babel/traverse": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", - "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", - "dev": true, - "dependencies": { - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", - "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.25.6" + "@babel/types": "^7.26.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -409,13 +421,14 @@ } }, "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.3.tgz", - "integrity": "sha512-wUrcsxZg6rqBXG05HG1FPYgsP6EvwF4WpBbxIpWIIYnH8wG0gzx3yZY3dtEHas4sTAOGkbTsc9EGPxwff8lRoA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz", + "integrity": "sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.3" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -425,12 +438,13 @@ } }, "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.0.tgz", - "integrity": "sha512-Bm4bH2qsX880b/3ziJ8KD711LT7z4u8CFudmjqle65AZj/HNUFhEf90dqYv6O86buWvSBmeQDjv0Tn2aF/bIBA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz", + "integrity": "sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -440,12 +454,13 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", - "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz", + "integrity": "sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -455,14 +470,15 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", - "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz", + "integrity": "sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/plugin-transform-optional-chaining": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -472,13 +488,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.0.tgz", - "integrity": "sha512-tggFrk1AIShG/RUQbEwt2Tr/E+ObkfwrPjR6BjbRvsx24+PSjK8zrq0GWPNCjo8qpRx4DuJzlcvWJqlm+0h3kw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz", + "integrity": "sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.0" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -492,6 +509,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" }, @@ -499,76 +517,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.6.tgz", - "integrity": "sha512-aABl0jHw9bZ2karQ/uUD6XP4u0SG22SJrOHFoL6XB1R7dTovOP4TzTlsxOYC5yQ1pdscVK2JTUnF6QL3ARoAiQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz", + "integrity": "sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -578,138 +534,13 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz", - "integrity": "sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -723,6 +554,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.6" @@ -735,12 +567,13 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", - "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz", + "integrity": "sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -750,15 +583,15 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.4.tgz", - "integrity": "sha512-jz8cV2XDDTqjKPwVPJBIjORVEmSGYhdRa8e5k5+vN+uwcjSrSxUaebBRa4ko1jqNF2uxyg8G6XYk30Jv285xzg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz", + "integrity": "sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-remap-async-to-generator": "^7.25.0", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/traverse": "^7.25.4" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-remap-async-to-generator": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -768,14 +601,15 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz", - "integrity": "sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz", + "integrity": "sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-remap-async-to-generator": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -785,12 +619,13 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", - "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz", + "integrity": "sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -800,12 +635,13 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", - "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz", + "integrity": "sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -815,13 +651,14 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.4.tgz", - "integrity": "sha512-nZeZHyCWPfjkdU5pA/uHiTaDAFUEqkpzf1YoQT2NeSynCGYq9rxfyI3XpQbfx/a0hSnFH6TGlEXvae5Vi7GD8g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz", + "integrity": "sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.4", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -831,14 +668,14 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz", - "integrity": "sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz", + "integrity": "sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-class-static-block": "^7.14.5" + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -848,16 +685,17 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.4.tgz", - "integrity": "sha512-oexUfaQle2pF/b6E0dwsxQtAol9TLSO88kQvym6HHBWFliV2lGdrPieX+WgMRLSJDVzdYywk7jXbLPuO2KLTLg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz", + "integrity": "sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-replace-supers": "^7.25.0", - "@babel/traverse": "^7.25.4", + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/traverse": "^7.25.9", "globals": "^11.1.0" }, "engines": { @@ -868,13 +706,14 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", - "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz", + "integrity": "sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/template": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/template": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -884,12 +723,13 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", - "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz", + "integrity": "sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -899,13 +739,14 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", - "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz", + "integrity": "sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -915,12 +756,13 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", - "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz", + "integrity": "sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -930,13 +772,14 @@ } }, "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.0.tgz", - "integrity": "sha512-YLpb4LlYSc3sCUa35un84poXoraOiQucUTTu8X1j18JV+gNa8E0nyUf/CjZ171IRGr4jEguF+vzJU66QZhn29g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz", + "integrity": "sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.0", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -946,13 +789,13 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", - "integrity": "sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz", + "integrity": "sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -962,13 +805,14 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", - "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz", + "integrity": "sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -978,13 +822,13 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz", - "integrity": "sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz", + "integrity": "sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -994,13 +838,14 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", - "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz", + "integrity": "sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1010,14 +855,15 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.25.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", - "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz", + "integrity": "sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-compilation-targets": "^7.24.8", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.1" + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1027,13 +873,13 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz", - "integrity": "sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz", + "integrity": "sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-json-strings": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1043,12 +889,13 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", - "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz", + "integrity": "sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1058,13 +905,13 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz", - "integrity": "sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz", + "integrity": "sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1074,12 +921,13 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", - "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz", + "integrity": "sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1089,13 +937,14 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", - "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz", + "integrity": "sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1105,14 +954,15 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", - "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz", + "integrity": "sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.24.8", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-simple-access": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-simple-access": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1122,15 +972,16 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", - "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz", + "integrity": "sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.0", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1140,13 +991,14 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", - "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz", + "integrity": "sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1156,13 +1008,14 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", - "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz", + "integrity": "sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1172,12 +1025,13 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", - "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz", + "integrity": "sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1187,13 +1041,13 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz", - "integrity": "sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz", + "integrity": "sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1203,13 +1057,13 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz", - "integrity": "sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz", + "integrity": "sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1219,15 +1073,15 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.7.tgz", - "integrity": "sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz", + "integrity": "sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.24.7" + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/plugin-transform-parameters": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1237,13 +1091,14 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", - "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz", + "integrity": "sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1253,13 +1108,13 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz", - "integrity": "sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz", + "integrity": "sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1269,14 +1124,14 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", - "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz", + "integrity": "sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1286,12 +1141,13 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", - "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz", + "integrity": "sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1301,13 +1157,14 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.4.tgz", - "integrity": "sha512-ao8BG7E2b/URaUQGqN3Tlsg+M3KlHY6rJ1O1gXAEUnZoyNQnvKyH87Kfg+FoxSeyWUB8ISZZsC91C44ZuBFytw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz", + "integrity": "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.4", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1317,15 +1174,15 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz", - "integrity": "sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz", + "integrity": "sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1335,12 +1192,13 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", - "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz", + "integrity": "sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1350,12 +1208,13 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", - "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz", + "integrity": "sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.9", "regenerator-transform": "^0.15.2" }, "engines": { @@ -1365,13 +1224,31 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-regexp-modifiers": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz", + "integrity": "sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", - "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz", + "integrity": "sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1381,12 +1258,13 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", - "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz", + "integrity": "sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1396,13 +1274,14 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", - "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz", + "integrity": "sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1412,12 +1291,13 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", - "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz", + "integrity": "sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1427,12 +1307,13 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", - "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz", + "integrity": "sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1442,12 +1323,13 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", - "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz", + "integrity": "sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1457,12 +1339,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", - "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz", + "integrity": "sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1472,13 +1355,14 @@ } }, "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz", - "integrity": "sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz", + "integrity": "sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1488,13 +1372,14 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", - "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz", + "integrity": "sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1504,13 +1389,14 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.4.tgz", - "integrity": "sha512-qesBxiWkgN1Q+31xUE9RcMk79eOXXDCv6tfyGMRSs4RGlioSg2WVyQAm07k726cSE56pa+Kb0y9epX2qaXzTvA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz", + "integrity": "sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1520,93 +1406,80 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.4.tgz", - "integrity": "sha512-W9Gyo+KmcxjGahtt3t9fb14vFRWvPpu5pT6GBlovAK6BTBcxgjfVMSQCfJl4oi35ODrxP6xx2Wr8LNST57Mraw==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.25.4", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-validator-option": "^7.24.8", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3", - "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.0", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz", + "integrity": "sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.9", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.9", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.9", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.24.7", - "@babel/plugin-syntax-import-attributes": "^7.24.7", - "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-import-assertions": "^7.26.0", + "@babel/plugin-syntax-import-attributes": "^7.26.0", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.24.7", - "@babel/plugin-transform-async-generator-functions": "^7.25.4", - "@babel/plugin-transform-async-to-generator": "^7.24.7", - "@babel/plugin-transform-block-scoped-functions": "^7.24.7", - "@babel/plugin-transform-block-scoping": "^7.25.0", - "@babel/plugin-transform-class-properties": "^7.25.4", - "@babel/plugin-transform-class-static-block": "^7.24.7", - "@babel/plugin-transform-classes": "^7.25.4", - "@babel/plugin-transform-computed-properties": "^7.24.7", - "@babel/plugin-transform-destructuring": "^7.24.8", - "@babel/plugin-transform-dotall-regex": "^7.24.7", - "@babel/plugin-transform-duplicate-keys": "^7.24.7", - "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.0", - "@babel/plugin-transform-dynamic-import": "^7.24.7", - "@babel/plugin-transform-exponentiation-operator": "^7.24.7", - "@babel/plugin-transform-export-namespace-from": "^7.24.7", - "@babel/plugin-transform-for-of": "^7.24.7", - "@babel/plugin-transform-function-name": "^7.25.1", - "@babel/plugin-transform-json-strings": "^7.24.7", - "@babel/plugin-transform-literals": "^7.25.2", - "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", - "@babel/plugin-transform-member-expression-literals": "^7.24.7", - "@babel/plugin-transform-modules-amd": "^7.24.7", - "@babel/plugin-transform-modules-commonjs": "^7.24.8", - "@babel/plugin-transform-modules-systemjs": "^7.25.0", - "@babel/plugin-transform-modules-umd": "^7.24.7", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", - "@babel/plugin-transform-new-target": "^7.24.7", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", - "@babel/plugin-transform-numeric-separator": "^7.24.7", - "@babel/plugin-transform-object-rest-spread": "^7.24.7", - "@babel/plugin-transform-object-super": "^7.24.7", - "@babel/plugin-transform-optional-catch-binding": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.8", - "@babel/plugin-transform-parameters": "^7.24.7", - "@babel/plugin-transform-private-methods": "^7.25.4", - "@babel/plugin-transform-private-property-in-object": "^7.24.7", - "@babel/plugin-transform-property-literals": "^7.24.7", - "@babel/plugin-transform-regenerator": "^7.24.7", - "@babel/plugin-transform-reserved-words": "^7.24.7", - "@babel/plugin-transform-shorthand-properties": "^7.24.7", - "@babel/plugin-transform-spread": "^7.24.7", - "@babel/plugin-transform-sticky-regex": "^7.24.7", - "@babel/plugin-transform-template-literals": "^7.24.7", - "@babel/plugin-transform-typeof-symbol": "^7.24.8", - "@babel/plugin-transform-unicode-escapes": "^7.24.7", - "@babel/plugin-transform-unicode-property-regex": "^7.24.7", - "@babel/plugin-transform-unicode-regex": "^7.24.7", - "@babel/plugin-transform-unicode-sets-regex": "^7.25.4", + "@babel/plugin-transform-arrow-functions": "^7.25.9", + "@babel/plugin-transform-async-generator-functions": "^7.25.9", + "@babel/plugin-transform-async-to-generator": "^7.25.9", + "@babel/plugin-transform-block-scoped-functions": "^7.25.9", + "@babel/plugin-transform-block-scoping": "^7.25.9", + "@babel/plugin-transform-class-properties": "^7.25.9", + "@babel/plugin-transform-class-static-block": "^7.26.0", + "@babel/plugin-transform-classes": "^7.25.9", + "@babel/plugin-transform-computed-properties": "^7.25.9", + "@babel/plugin-transform-destructuring": "^7.25.9", + "@babel/plugin-transform-dotall-regex": "^7.25.9", + "@babel/plugin-transform-duplicate-keys": "^7.25.9", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9", + "@babel/plugin-transform-dynamic-import": "^7.25.9", + "@babel/plugin-transform-exponentiation-operator": "^7.25.9", + "@babel/plugin-transform-export-namespace-from": "^7.25.9", + "@babel/plugin-transform-for-of": "^7.25.9", + "@babel/plugin-transform-function-name": "^7.25.9", + "@babel/plugin-transform-json-strings": "^7.25.9", + "@babel/plugin-transform-literals": "^7.25.9", + "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", + "@babel/plugin-transform-member-expression-literals": "^7.25.9", + "@babel/plugin-transform-modules-amd": "^7.25.9", + "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/plugin-transform-modules-systemjs": "^7.25.9", + "@babel/plugin-transform-modules-umd": "^7.25.9", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9", + "@babel/plugin-transform-new-target": "^7.25.9", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9", + "@babel/plugin-transform-numeric-separator": "^7.25.9", + "@babel/plugin-transform-object-rest-spread": "^7.25.9", + "@babel/plugin-transform-object-super": "^7.25.9", + "@babel/plugin-transform-optional-catch-binding": "^7.25.9", + "@babel/plugin-transform-optional-chaining": "^7.25.9", + "@babel/plugin-transform-parameters": "^7.25.9", + "@babel/plugin-transform-private-methods": "^7.25.9", + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@babel/plugin-transform-property-literals": "^7.25.9", + "@babel/plugin-transform-regenerator": "^7.25.9", + "@babel/plugin-transform-regexp-modifiers": "^7.26.0", + "@babel/plugin-transform-reserved-words": "^7.25.9", + "@babel/plugin-transform-shorthand-properties": "^7.25.9", + "@babel/plugin-transform-spread": "^7.25.9", + "@babel/plugin-transform-sticky-regex": "^7.25.9", + "@babel/plugin-transform-template-literals": "^7.25.9", + "@babel/plugin-transform-typeof-symbol": "^7.25.9", + "@babel/plugin-transform-unicode-escapes": "^7.25.9", + "@babel/plugin-transform-unicode-property-regex": "^7.25.9", + "@babel/plugin-transform-unicode-regex": "^7.25.9", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.9", "@babel/preset-modules": "0.1.6-no-external-plugins", "babel-plugin-polyfill-corejs2": "^0.4.10", "babel-plugin-polyfill-corejs3": "^0.10.6", "babel-plugin-polyfill-regenerator": "^0.6.1", - "core-js-compat": "^3.37.1", + "core-js-compat": "^3.38.1", "semver": "^6.3.1" }, "engines": { @@ -1621,6 +1494,7 @@ "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/types": "^7.4.4", @@ -1630,17 +1504,12 @@ "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/@babel/regjsgen": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", - "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", - "dev": true - }, "node_modules/@babel/runtime": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", - "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "dev": true, + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1649,30 +1518,32 @@ } }, "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", - "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.6", - "@babel/parser": "^7.25.6", - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.6", + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1681,14 +1552,14 @@ } }, "node_modules/@babel/types": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", - "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1698,33 +1569,33 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.43.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz", - "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.49.0.tgz", + "integrity": "sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==", "dev": true, + "license": "MIT", "dependencies": { - "@types/eslint": "^8.56.5", - "@types/estree": "^1.0.5", - "@typescript-eslint/types": "^7.2.0", "comment-parser": "1.4.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~4.1.0" }, "engines": { "node": ">=16" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", - "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -1734,13 +1605,14 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", - "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1750,13 +1622,14 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", - "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1766,13 +1639,14 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", - "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1782,13 +1656,14 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", - "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1798,13 +1673,14 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", - "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1814,13 +1690,14 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", - "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1830,13 +1707,14 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", - "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1846,13 +1724,14 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", - "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1862,13 +1741,14 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", - "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1878,13 +1758,14 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", - "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1894,13 +1775,14 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", - "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1910,13 +1792,14 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", - "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1926,13 +1809,14 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", - "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1942,13 +1826,14 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", - "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1958,13 +1843,14 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", - "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1974,13 +1860,14 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", - "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1990,13 +1877,14 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", - "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -2006,13 +1894,14 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", - "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -2022,13 +1911,14 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", - "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -2038,13 +1928,14 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", - "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -2054,13 +1945,14 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", - "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2070,13 +1962,14 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", - "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2086,13 +1979,14 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", - "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2102,16 +1996,20 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, + "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } @@ -2121,6 +2019,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -2129,19 +2028,21 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^2.1.4", "debug": "^4.3.1", @@ -2151,11 +2052,22 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/core": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2179,6 +2091,7 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -2187,10 +2100,11 @@ } }, "node_modules/@eslint/js": { - "version": "9.10.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", - "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -2200,15 +2114,17 @@ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", - "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "levn": "^0.4.1" }, @@ -2216,11 +2132,63 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@gerrit0/mini-shiki": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.24.1.tgz", + "integrity": "sha512-PNP/Gjv3VqU7z7DjRgO3F9Ok5frTKqtpV+LJW1RzMcr2zpRk0ulhEWnbcNGXzPC7BZyWMIHrkfQX2GZRfxrn6Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@shikijs/engine-oniguruma": "^1.24.0", + "@shikijs/types": "^1.24.0", + "@shikijs/vscode-textmate": "^9.3.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -2230,10 +2198,11 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", - "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=18.18" }, @@ -2247,6 +2216,7 @@ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -2259,38 +2229,12 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2300,6 +2244,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -2314,6 +2259,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -2323,6 +2269,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -2331,13 +2278,15 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2348,6 +2297,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2361,6 +2311,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -2370,6 +2321,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2383,25 +2335,25 @@ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=14" } }, "node_modules/@polka/url": { - "version": "1.0.0-next.27", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.27.tgz", - "integrity": "sha512-MU0SYgcrBdSVLu7Tfow3VY4z1odzlaTYRjt3WQ0z8XbjDWReuy+EALt2HdjhrwD2HPiW2GY+KTSw4HLv4C/EOA==", - "dev": true + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", + "dev": true, + "license": "MIT" }, "node_modules/@rollup/plugin-alias": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz", - "integrity": "sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.1.tgz", + "integrity": "sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==", "dev": true, - "dependencies": { - "slash": "^4.0.0" - }, + "license": "MIT", "engines": { "node": ">=14.0.0" }, @@ -2419,6 +2371,7 @@ "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz", "integrity": "sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.18.6", "@rollup/pluginutils": "^5.0.1" @@ -2441,14 +2394,15 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", + "integrity": "sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -2463,279 +2417,299 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.4.tgz", - "integrity": "sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.0.tgz", + "integrity": "sha512-wLJuPLT6grGZsy34g4N1yRfYeouklTgPhH1gWXCYspenKYD0s3cR99ZevOGw5BexMNywkbV3UkjADisozBmpPQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.4.tgz", - "integrity": "sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.0.tgz", + "integrity": "sha512-eiNkznlo0dLmVG/6wf+Ifi/v78G4d4QxRhuUl+s8EWZpDewgk7PX3ZyECUXU0Zq/Ca+8nU8cQpNC4Xgn2gFNDA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.4.tgz", - "integrity": "sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.0.tgz", + "integrity": "sha512-lmKx9yHsppblnLQZOGxdO66gT77bvdBtr/0P+TPOseowE7D9AJoBw8ZDULRasXRWf1Z86/gcOdpBrV6VDUY36Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.4.tgz", - "integrity": "sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.0.tgz", + "integrity": "sha512-8hxgfReVs7k9Js1uAIhS6zq3I+wKQETInnWQtgzt8JfGx51R1N6DRVy3F4o0lQwumbErRz52YqwjfvuwRxGv1w==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.0.tgz", + "integrity": "sha512-lA1zZB3bFx5oxu9fYud4+g1mt+lYXCoch0M0V/xhqLoGatbzVse0wlSQ1UYOWKpuSu3gyN4qEc0Dxf/DII1bhQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.0.tgz", + "integrity": "sha512-aI2plavbUDjCQB/sRbeUZWX9qp12GfYkYSJOrdYTL/C5D53bsE2/nBPuoiJKoWp5SN78v2Vr8ZPnB+/VbQ2pFA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.4.tgz", - "integrity": "sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.0.tgz", + "integrity": "sha512-WXveUPKtfqtaNvpf0iOb0M6xC64GzUX/OowbqfiCSXTdi/jLlOmH0Ba94/OkiY2yTGTwteo4/dsHRfh5bDCZ+w==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.4.tgz", - "integrity": "sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.0.tgz", + "integrity": "sha512-yLc3O2NtOQR67lI79zsSc7lk31xjwcaocvdD1twL64PK1yNaIqCeWI9L5B4MFPAVGEVjH5k1oWSGuYX1Wutxpg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.4.tgz", - "integrity": "sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.0.tgz", + "integrity": "sha512-+P9G9hjEpHucHRXqesY+3X9hD2wh0iNnJXX/QhS/J5vTdG6VhNYMxJ2rJkQOxRUd17u5mbMLHM7yWGZdAASfcg==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.4.tgz", - "integrity": "sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.0.tgz", + "integrity": "sha512-1xsm2rCKSTpKzi5/ypT5wfc+4bOGa/9yI/eaOLW0oMs7qpC542APWhl4A37AENGZ6St6GBMWhCCMM6tXgTIplw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.4.tgz", - "integrity": "sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.0.tgz", + "integrity": "sha512-zgWxMq8neVQeXL+ouSf6S7DoNeo6EPgi1eeqHXVKQxqPy1B2NvTbaOUWPn/7CfMKL7xvhV0/+fq/Z/J69g1WAQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.4.tgz", - "integrity": "sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.0.tgz", + "integrity": "sha512-VEdVYacLniRxbRJLNtzwGt5vwS0ycYshofI7cWAfj7Vg5asqj+pt+Q6x4n+AONSZW/kVm+5nklde0qs2EUwU2g==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.4.tgz", - "integrity": "sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.0.tgz", + "integrity": "sha512-LQlP5t2hcDJh8HV8RELD9/xlYtEzJkm/aWGsauvdO2ulfl3QYRjqrKW+mGAIWP5kdNCBheqqqYIGElSRCaXfpw==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.4.tgz", - "integrity": "sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.0.tgz", + "integrity": "sha512-Nl4KIzteVEKE9BdAvYoTkW19pa7LR/RBrT6F1dJCV/3pbjwDcaOq+edkP0LXuJ9kflW/xOK414X78r+K84+msw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.4.tgz", - "integrity": "sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.0.tgz", + "integrity": "sha512-eKpJr4vBDOi4goT75MvW+0dXcNUqisK4jvibY9vDdlgLx+yekxSm55StsHbxUsRxSTt3JEQvlr3cGDkzcSP8bw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.4.tgz", - "integrity": "sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.0.tgz", + "integrity": "sha512-Vi+WR62xWGsE/Oj+mD0FNAPY2MEox3cfyG0zLpotZdehPFXwz6lypkGs5y38Jd/NVSbOD02aVad6q6QYF7i8Bg==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.4.tgz", - "integrity": "sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.0.tgz", + "integrity": "sha512-kN/Vpip8emMLn/eOza+4JwqDZBL6MPNpkdaEsgUtW1NYN3DZvZqSQrbKzJcTL6hd8YNmFTn7XGWMwccOcJBL0A==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.4.tgz", - "integrity": "sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.0.tgz", + "integrity": "sha512-Bvno2/aZT6usSa7lRDL2+hMjVAGjuqaymF1ApZm31JXzniR/hvr14jpU+/z4X6Gt5BPlzosscyJZGUvguXIqeQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, - "node_modules/@shikijs/core": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.7.tgz", - "integrity": "sha512-ZnIDxFu/yvje3Q8owSHaEHd+bu/jdWhHAaJ17ggjXofHx5rc4bhpCSW+OjC6smUBi5s5dd023jWtZ1gzMu/yrw==", - "dev": true, - "peer": true, - "dependencies": { - "@shikijs/engine-javascript": "1.17.7", - "@shikijs/engine-oniguruma": "1.17.7", - "@shikijs/types": "1.17.7", - "@shikijs/vscode-textmate": "^9.2.2", - "@types/hast": "^3.0.4", - "hast-util-to-html": "^9.0.2" - } - }, - "node_modules/@shikijs/engine-javascript": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.17.7.tgz", - "integrity": "sha512-wwSf7lKPsm+hiYQdX+1WfOXujtnUG6fnN4rCmExxa4vo+OTmvZ9B1eKauilvol/LHUPrQgW12G3gzem7pY5ckw==", - "dev": true, - "peer": true, - "dependencies": { - "@shikijs/types": "1.17.7", - "@shikijs/vscode-textmate": "^9.2.2", - "oniguruma-to-js": "0.4.3" - } - }, "node_modules/@shikijs/engine-oniguruma": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.17.7.tgz", - "integrity": "sha512-pvSYGnVeEIconU28NEzBXqSQC/GILbuNbAHwMoSfdTBrobKAsV1vq2K4cAgiaW1TJceLV9QMGGh18hi7cCzbVQ==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.0.tgz", + "integrity": "sha512-Eua0qNOL73Y82lGA4GF5P+G2+VXX9XnuUxkiUuwcxQPH4wom+tE39kZpBFXfUuwNYxHSkrSxpB1p4kyRW0moSg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@shikijs/types": "1.17.7", - "@shikijs/vscode-textmate": "^9.2.2" + "@shikijs/types": "1.24.0", + "@shikijs/vscode-textmate": "^9.3.0" } }, "node_modules/@shikijs/types": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.17.7.tgz", - "integrity": "sha512-+qA4UyhWLH2q4EFd+0z4K7GpERDU+c+CN2XYD3sC+zjvAr5iuwD1nToXZMt1YODshjkEGEDV86G7j66bKjqDdg==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.24.0.tgz", + "integrity": "sha512-aptbEuq1Pk88DMlCe+FzXNnBZ17LCiLIGWAeCWhoFDzia5Q5Krx3DgnULLiouSdd6+LUM39XwXGppqYE0Ghtug==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@shikijs/vscode-textmate": "^9.2.2", + "@shikijs/vscode-textmate": "^9.3.0", "@types/hast": "^3.0.4" } }, "node_modules/@shikijs/vscode-textmate": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.2.2.tgz", - "integrity": "sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.0.tgz", + "integrity": "sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@ts-morph/common": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", - "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.25.0.tgz", + "integrity": "sha512-kMnZz+vGGHi4GoHnLmMhGNjm44kGtKUXGnOvrKmMwAuvNjM/PgKVGfUnL7IDvK7Jb2QQ82jq3Zmp04Gy+r3Dkg==", "dev": true, + "license": "MIT", "dependencies": { - "fast-glob": "^3.3.2", - "minimatch": "^9.0.3", - "mkdirp": "^3.0.1", - "path-browserify": "^1.0.1" + "minimatch": "^9.0.4", + "path-browserify": "^1.0.1", + "tinyglobby": "^0.2.9" } }, "node_modules/@ts-morph/common/node_modules/brace-expansion": { @@ -2743,6 +2717,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -2752,6 +2727,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2766,29 +2742,22 @@ "version": "3.21.8", "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.8.tgz", "integrity": "sha512-6Bo9ZDrv0vfwe8Sg/ERc5VL0yU0gYvP4dgZi0fAXYkKHfyHaNqWRMcwYm3mu4sLsXbB8ZuXE75sR7qnaOL5JgQ==", - "dev": true - }, - "node_modules/@types/eslint": { - "version": "8.56.12", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz", - "integrity": "sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==", "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } + "license": "MIT" }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/hast": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "@types/unist": "*" @@ -2798,36 +2767,29 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "*" - } + "license": "MIT" }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.6.0.tgz", - "integrity": "sha512-UOaz/wFowmoh2G6Mr9gw60B1mm0MzUtm6Ic8G2yM1Le6gyj5Loi/N+O5mocugRGY+8OeeKmkMmbxNqUCq3B4Sg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", + "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.6.0", - "@typescript-eslint/type-utils": "8.6.0", - "@typescript-eslint/utils": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/type-utils": "8.17.0", + "@typescript-eslint/utils": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -2851,15 +2813,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.6.0.tgz", - "integrity": "sha512-eQcbCuA2Vmw45iGfcyG4y6rS7BhWfz9MQuk409WD47qMM+bKCGQWXxvoOs1DUp+T7UBMTtRTVT+kXr7Sh4O9Ow==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", + "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.6.0", - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/typescript-estree": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4" }, "engines": { @@ -2878,27 +2841,15 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.6.0.tgz", - "integrity": "sha512-ZuoutoS5y9UOxKvpc/GkvF4cuEmpokda4wRg64JEia27wX+PysIE9q+lzDtlHHgblwUWwo5/Qn+/WyTUvDwBHw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz", + "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0" + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2908,27 +2859,15 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.6.0.tgz", - "integrity": "sha512-dtePl4gsuenXVwC7dVNlb4mGDcKjDT/Ropsk4za/ouMBPplCLyznIaR+W65mvCvsyS97dymoBRrioEXI7k0XIg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz", + "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.6.0", - "@typescript-eslint/utils": "8.6.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/utils": "8.17.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -2939,6 +2878,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -2946,12 +2888,13 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.17.0.tgz", + "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==", "dev": true, + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2959,13 +2902,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.6.0.tgz", - "integrity": "sha512-MOVAzsKJIPIlLK239l5s06YXjNqpKTVhBVDnqUumQJja5+Y94V3+4VUFRA0G60y2jNnTVwRCkhyGQpavfsbq/g==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz", + "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/visitor-keys": "8.6.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2986,24 +2930,12 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -3013,6 +2945,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3028,6 +2961,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3036,15 +2970,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.6.0.tgz", - "integrity": "sha512-eNp9cWnYf36NaOVjkEUznf6fEgVy1TWpE0o52e4wtojjBx7D1UV2WAWGzR+8Y5lVFtpMLPwNbC67T83DWSph4A==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz", + "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.6.0", - "@typescript-eslint/types": "8.6.0", - "@typescript-eslint/typescript-estree": "8.6.0" + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3055,29 +2990,22 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.6.0.tgz", - "integrity": "sha512-wapVFfZg9H0qOYh4grNVQiMklJGluQrOUiOhYRrQWhx7BY/+I1IYb8BczWNbbUpO+pqy0rDciv3lQH5E1bCLrg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz", + "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.6.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.17.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3087,59 +3015,35 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz", - "integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@typhonjs-build-test/esm-d-ts": { - "version": "0.3.0-next.7", - "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.7.tgz", - "integrity": "sha512-xZS7Zz0LJZhdCV6z5NpwrKIMdghQdzypxSZ5iYB0FY+UQers5YkGW7BRs19XW8os0+LnP2ktZzWR2W5SkyHNuQ==", + "version": "0.3.0-next.9", + "resolved": "https://registry.npmjs.org/@typhonjs-build-test/esm-d-ts/-/esm-d-ts-0.3.0-next.9.tgz", + "integrity": "sha512-adxtMxsO7Bwk2BkgRDQjboFIers2IT1b55EWSow8lESlwq/KPsUhydXxTpoysRaUlp05WcstpztuJuCu45ZoVg==", "dev": true, + "license": "MPL-2.0", "dependencies": { - "@es-joy/jsdoccomment": "^0.43.0", - "@rollup/plugin-alias": "^5.1.0", - "@types/cytoscape": "^3.21.2", + "@es-joy/jsdoccomment": "^0.49.0", + "@rollup/plugin-alias": "^5.1.1", + "@types/cytoscape": "^3.21.8", "@typhonjs-build-test/rollup-plugin-pkg-imports": "^0.5.0", "@typhonjs-plugin/manager": "^0.1.2", "@typhonjs-utils/file-util": "^0.1.0", "@typhonjs-utils/logger-color": "^0.1.0", "@typhonjs-utils/object": "^0.1.0", "@typhonjs-utils/package-json": "^0.7.0", - "comment-parser": "^1.4.0", - "cytoscape": "^3.29.0", - "es-module-lexer": "^1.5.0", + "comment-parser": "^1.4.1", + "cytoscape": "^3.30.0", + "es-module-lexer": "^1.5.4", "fs-extra": "^11.2.0", - "glob-to-regexp": "^0.4.0", + "glob-to-regexp": "^0.4.1", "import-meta-resolve": "^4.1.0", - "prettier": "^3.2.0", + "prettier": "^3.3.3", "resolve.exports": "^2.0.2", - "rollup-plugin-dts": "^6.1.0", + "rollup-plugin-dts": "^6.1.1", "sade": "^1.8.1", - "ts-morph": "^22.0.0", - "type-fest": "^4.18.0", - "upath": "^2.0.1" + "ts-morph": "^24.0.0", + "type-fest": "^4.26.0", + "upath": "^2.0.0" }, "bin": { "esm-d-ts": "src/cli/index.js" @@ -3149,7 +3053,7 @@ }, "peerDependencies": { "rollup": "3.3 - 4", - "typescript": ">=5.1" + "typescript": ">=5.5" } }, "node_modules/@typhonjs-build-test/rollup-plugin-pkg-imports": { @@ -3157,6 +3061,7 @@ "resolved": "https://registry.npmjs.org/@typhonjs-build-test/rollup-plugin-pkg-imports/-/rollup-plugin-pkg-imports-0.5.0.tgz", "integrity": "sha512-YAcRIETyEw4zMuQsJNQrOFHo/lqml88lligtClSSAQXnGT6ez0jiluDhxjzkJAQ2NGdALh09CGNL/xZgtUecCQ==", "dev": true, + "license": "MPL-2.0", "dependencies": { "@typhonjs-utils/package-json": "^0.7.0", "glob-to-regexp": "^0.4.1", @@ -3175,6 +3080,7 @@ "resolved": "https://registry.npmjs.org/@typhonjs-plugin/manager/-/manager-0.1.2.tgz", "integrity": "sha512-bMtnjVlqeiPjmW/U+rBm5Mb+ZoZs7uKyZYN3Rtq0DXzndyMrIDBOiQyssSwGxpFVDC7V9yArvt0EoGWDxAIYLQ==", "dev": true, + "license": "MPL-2.0", "engines": { "node": ">=14.18" } @@ -3184,25 +3090,27 @@ "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/ts-lib-docs/-/ts-lib-docs-2024.9.18.tgz", "integrity": "sha512-LuyFXC9iC7DP0h5a3IbeLKMbRdD0Xl8CfdFA9zdUZXU5Rqp597CdCU42WwknXnX+MbNIkS6MK7+Om0L9Vn9Yxw==", "dev": true, + "license": "MPL-2.0", "peerDependencies": { "typedoc": ">=0.25.0" } }, "node_modules/@typhonjs-typedoc/typedoc-pkg": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.1.1.tgz", - "integrity": "sha512-mJLmMnhYGZCHJF4ks0pkzWRK4/53D84MWKjAx47yY9cmNNeKj6S95ZK43tePj+M3VyieQ3O6GND/v2jcrHhesQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-pkg/-/typedoc-pkg-0.2.0.tgz", + "integrity": "sha512-38kzFK85t7JUUI7iEGjMRco0mF2NSxvPxOCVssOWGL1UeK1APZh4FIP8JPyJycZ2hF3VlPJoi5G+t42bzneKUg==", "dev": true, + "license": "MPL-2.0", "dependencies": { "@typhonjs-typedoc/ts-lib-docs": "2024.9.18", - "@typhonjs-typedoc/typedoc-theme-dmt": "0.2.1", + "@typhonjs-typedoc/typedoc-theme-dmt": "0.3.0", "@typhonjs-utils/file-util": "^0.1.0", "@typhonjs-utils/logger-color": "^0.1.0", "@typhonjs-utils/object": "^0.1.0", "@typhonjs-utils/package-json": "^0.7.0", "glob": "^11.0.0", "is-glob": "^4.0.3", - "resolve.exports": "^2.0.2", + "resolve.exports": "^2.0.3", "sade": "^1.8.1", "upath": "^2" }, @@ -3213,32 +3121,127 @@ "node": ">=18" }, "peerDependencies": { - "typedoc": ">=0.26.6 < 0.27", + "typedoc": ">=0.27.3 < 0.28", "typescript": ">=5.1.0 <6" } }, - "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.2.1.tgz", - "integrity": "sha512-6z/hB7aCuakDjQZT5hafI3EhpxcA13rscEHMhpNKQNh5QtoxCTrenPBRlajCqYZycVGn0NgSAaDDEKMFefmBQg==", + "node_modules/@typhonjs-typedoc/typedoc-pkg/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { - "cheerio": "^1.0.0" - }, - "peerDependencies": { - "typedoc": ">=0.26.6" + "balanced-match": "^1.0.0" } }, - "node_modules/@typhonjs-utils/file-util": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", - "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", + "node_modules/@typhonjs-typedoc/typedoc-pkg/node_modules/glob": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, + "license": "ISC", "dependencies": { - "upath": "^2" + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" }, - "engines": { - "node": ">=16" + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-pkg/node_modules/jackspeak": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", + "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-pkg/node_modules/lru-cache": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", + "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-pkg/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-pkg/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typhonjs-typedoc/typedoc-theme-dmt": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@typhonjs-typedoc/typedoc-theme-dmt/-/typedoc-theme-dmt-0.3.0.tgz", + "integrity": "sha512-jAMB06rTz4gYDiWjlSTtcsHvtIApGfAgmlBJvTM7KdeXibecX6Gao0J9dyij+dNdWyaLO2s0Of9EVn/ZTRDwpw==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "cheerio": "^1.0.0" + }, + "peerDependencies": { + "typedoc": ">=0.27.3 <0.28" + } + }, + "node_modules/@typhonjs-utils/file-util": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@typhonjs-utils/file-util/-/file-util-0.1.0.tgz", + "integrity": "sha512-4dhQrk6M+oa3aaOhhQxS48KWt0xD9KyBqXi9yaOx6rcAzBGv37KIS6bHxtYqp7xOqHGrCF8K8K4XC2XbYMUpeA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "upath": "^2" + }, + "engines": { + "node": ">=16" } }, "node_modules/@typhonjs-utils/logger-color": { @@ -3246,6 +3249,7 @@ "resolved": "https://registry.npmjs.org/@typhonjs-utils/logger-color/-/logger-color-0.1.0.tgz", "integrity": "sha512-BWXSwxs5ZDVs4vi/YxJLLN3287+i4Z/KXqQuKUN5o5qWc4ioYU+ws9svZSL1XzqkLpF+j2oALhE8l0pmPydWxg==", "dev": true, + "license": "MPL-2.0", "engines": { "node": ">=14.18" } @@ -3255,6 +3259,7 @@ "resolved": "https://registry.npmjs.org/@typhonjs-utils/object/-/object-0.1.0.tgz", "integrity": "sha512-XCG2Qae6FZzzm81q0ya3D/xBRKlXF8lELi5T2E+nNYjqzi9T+2LTCUKR84dpo856wXAFn3CdTvDQKn5OVVnLlQ==", "dev": true, + "license": "MPL-2.0", "engines": { "node": ">=14.18" } @@ -3264,33 +3269,28 @@ "resolved": "https://registry.npmjs.org/@typhonjs-utils/package-json/-/package-json-0.7.0.tgz", "integrity": "sha512-aFoXJuGJqUuPJ+00/voU/iIc1bPDx0nJBGHt0ntyc1XmQOZDuwq7mLpHGsdIXZlF1lMSX/B9AFtlLATSyVWrVQ==", "dev": true, + "license": "MPL-2.0", "engines": { "node": ">=12" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "peer": true - }, "node_modules/@vitest/coverage-v8": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.1.tgz", - "integrity": "sha512-md/A7A3c42oTT8JUHSqjP5uKTWJejzUW4jalpvs+rZ27gsURsMU8DEb+8Jf8C6Kj2gwfSHJqobDNBuoqlm0cFw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.8.tgz", + "integrity": "sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==", "dev": true, + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.6", + "debug": "^4.3.7", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.1.7", - "magic-string": "^0.30.11", - "magicast": "^0.3.4", - "std-env": "^3.7.0", + "magic-string": "^0.30.12", + "magicast": "^0.3.5", + "std-env": "^3.8.0", "test-exclude": "^7.0.1", "tinyrainbow": "^1.2.0" }, @@ -3298,8 +3298,8 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "2.1.1", - "vitest": "2.1.1" + "@vitest/browser": "2.1.8", + "vitest": "2.1.8" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -3308,14 +3308,15 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.1.tgz", - "integrity": "sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.1", - "@vitest/utils": "2.1.1", - "chai": "^5.1.1", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -3323,21 +3324,21 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.1.tgz", - "integrity": "sha512-LNN5VwOEdJqCmJ/2XJBywB11DLlkbY0ooDJW3uRX5cZyYCrc4PI/ePX0iQhE3BiEGiQmK4GE7Q/PqCkkaiPnrA==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "^2.1.0-beta.1", + "@vitest/spy": "2.1.8", "estree-walker": "^3.0.3", - "magic-string": "^0.30.11" + "magic-string": "^0.30.12" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/spy": "2.1.1", - "msw": "^2.3.5", + "msw": "^2.4.9", "vite": "^5.0.0" }, "peerDependenciesMeta": { @@ -3354,15 +3355,17 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.1.tgz", - "integrity": "sha512-SjxPFOtuINDUW8/UkElJYQSFtnWX7tMksSGW0vfjxMneFqxVr8YJ979QpMbDW7g+BIiq88RAGDjf7en6rvLPPQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, + "license": "MIT", "dependencies": { "tinyrainbow": "^1.2.0" }, @@ -3371,12 +3374,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.1.tgz", - "integrity": "sha512-uTPuY6PWOYitIkLPidaY5L3t0JJITdGTSwBtwMjKzo5O6RCOEncz9PUN+0pDidX8kTHYjO0EwUIvhlGpnGpxmA==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.1", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -3384,13 +3388,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.1.tgz", - "integrity": "sha512-BnSku1WFy7r4mm96ha2FzN99AZJgpZOWrAhtQfoxjUU5YMRpq1zmHRq7a5K9/NjqonebO7iVDla+VvZS8BOWMw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.1", - "magic-string": "^0.30.11", + "@vitest/pretty-format": "2.1.8", + "magic-string": "^0.30.12", "pathe": "^1.1.2" }, "funding": { @@ -3398,46 +3403,49 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.1.tgz", - "integrity": "sha512-ZM39BnZ9t/xZ/nF4UwRH5il0Sw93QnZXd9NAZGRpIgj0yvVwPpLd702s/Cx955rGaMlyBQkZJ2Ir7qyY48VZ+g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, + "license": "MIT", "dependencies": { - "tinyspy": "^3.0.0" + "tinyspy": "^3.0.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/ui": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.1.tgz", - "integrity": "sha512-IIxo2LkQDA+1TZdPLYPclzsXukBWd5dX2CKpGqH8CCt8Wh0ZuDn4+vuQ9qlppEju6/igDGzjWF/zyorfsf+nHg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.8.tgz", + "integrity": "sha512-5zPJ1fs0ixSVSs5+5V2XJjXLmNzjugHRyV11RqxYVR+oMcogZ9qTuSfKW+OcTV0JeFNznI83BNylzH6SSNJ1+w==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.1", + "@vitest/utils": "2.1.8", "fflate": "^0.8.2", "flatted": "^3.3.1", "pathe": "^1.1.2", - "sirv": "^2.0.4", - "tinyglobby": "^0.2.6", + "sirv": "^3.0.0", + "tinyglobby": "^0.2.10", "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "2.1.1" + "vitest": "2.1.8" } }, "node_modules/@vitest/utils": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.1.tgz", - "integrity": "sha512-Y6Q9TsI+qJ2CC0ZKj6VBb+T8UPz593N113nnUykqwANqhgf3QkZeHFlusgKLTqrnVHbj/XDKZcDHol+dxVT+rQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.1", - "loupe": "^3.1.1", + "@vitest/pretty-format": "2.1.8", + "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -3445,10 +3453,11 @@ } }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -3461,6 +3470,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -3470,6 +3480,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3482,49 +3493,60 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", - "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", + "version": "0.4.12", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz", + "integrity": "sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og==", "dev": true, + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.6.2", + "@babel/helper-define-polyfill-provider": "^0.6.3", "semver": "^6.3.1" }, "peerDependencies": { @@ -3536,6 +3558,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz", "integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.2", "core-js-compat": "^3.38.0" @@ -3545,12 +3568,13 @@ } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz", - "integrity": "sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz", + "integrity": "sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.2" + "@babel/helper-define-polyfill-provider": "^0.6.3" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -3560,19 +3584,22 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3583,6 +3610,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -3591,9 +3619,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", - "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "funding": [ { @@ -3609,11 +3637,12 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001646", - "electron-to-chromium": "^1.5.4", + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -3627,6 +3656,7 @@ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3636,14 +3666,15 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001660", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz", - "integrity": "sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==", + "version": "1.0.30001686", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz", + "integrity": "sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA==", "dev": true, "funding": [ { @@ -3658,24 +3689,15 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] - }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + ], + "license": "CC-BY-4.0" }, "node_modules/chai": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", - "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, + "license": "MIT", "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", @@ -3688,39 +3710,20 @@ } }, "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/character-entities-html4": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", - "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", - "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", - "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", - "dev": true, - "peer": true, + "node": ">=10" + }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/check-error": { @@ -3728,6 +3731,7 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 16" } @@ -3737,6 +3741,7 @@ "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", "dev": true, + "license": "MIT", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -3762,6 +3767,7 @@ "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -3775,42 +3781,38 @@ } }, "node_modules/code-block-writer": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.2.tgz", - "integrity": "sha512-XfXzAGiStXSmCIwrkdfvc7FS5Dtj8yelCtyOf2p2skCAfvLd6zu0rGzuS9NSCO3bq1JKpFZ7tbKdKlcd5occQA==", - "dev": true + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "dev": true, + "license": "MIT" }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/comma-separated-tokens": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", - "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + "license": "MIT" }, "node_modules/comment-parser": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 12.0.0" } @@ -3819,21 +3821,24 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/core-js-compat": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", - "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", + "version": "3.39.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.39.0.tgz", + "integrity": "sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw==", "dev": true, + "license": "MIT", "dependencies": { - "browserslist": "^4.23.3" + "browserslist": "^4.24.2" }, "funding": { "type": "opencollective", @@ -3841,10 +3846,11 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -3859,6 +3865,7 @@ "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -3875,6 +3882,7 @@ "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">= 6" }, @@ -3883,10 +3891,11 @@ } }, "node_modules/cytoscape": { - "version": "3.30.2", - "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.30.2.tgz", - "integrity": "sha512-oICxQsjW8uSaRmn4UK/jkczKOqTrVqt5/1WL0POiJUT2EKNc9STM4hYFHv917yu55aTBMFNRzymlJhVAiWPCxw==", + "version": "3.30.4", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.30.4.tgz", + "integrity": "sha512-OxtlZwQl1WbwMmLiyPSEBuzeTIQnwZhJYYWFzZ2PhEHVFwpeaqNIkUzSiso00D98qk60l8Gwon2RP304d3BJ1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10" } @@ -3896,6 +3905,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -3913,6 +3923,7 @@ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -3921,37 +3932,15 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, - "peer": true, - "dependencies": { - "dequal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + "license": "MIT" }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -3971,13 +3960,15 @@ "type": "github", "url": "https://github.com/sponsors/fb55" } - ] + ], + "license": "BSD-2-Clause" }, "node_modules/domhandler": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -3993,6 +3984,7 @@ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -4006,25 +3998,29 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.25.tgz", - "integrity": "sha512-kMb204zvK3PsSlgvvwzI3wBIcAw15tRkYk+NQdsjdDtcQWTp2RABbMQ9rUBy8KNEOM+/E6ep+XC3AykiWZld4g==", - "dev": true + "version": "1.5.68", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.68.tgz", + "integrity": "sha512-FgMdJlma0OzUYlbrtZ4AeXjKxKPk6KT8WOP8BjcqxWtlg8qyJQjRzPJzUtUn5GBg1oQ26hFs7HOOHJMYiJRnvQ==", + "dev": true, + "license": "ISC" }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/encoding-sniffer": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", "dev": true, + "license": "MIT", "dependencies": { "iconv-lite": "^0.6.3", "whatwg-encoding": "^3.1.1" @@ -4038,6 +4034,7 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -4049,14 +4046,16 @@ "version": "1.5.4", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/esbuild": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", - "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -4064,30 +4063,30 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.23.1", - "@esbuild/android-arm": "0.23.1", - "@esbuild/android-arm64": "0.23.1", - "@esbuild/android-x64": "0.23.1", - "@esbuild/darwin-arm64": "0.23.1", - "@esbuild/darwin-x64": "0.23.1", - "@esbuild/freebsd-arm64": "0.23.1", - "@esbuild/freebsd-x64": "0.23.1", - "@esbuild/linux-arm": "0.23.1", - "@esbuild/linux-arm64": "0.23.1", - "@esbuild/linux-ia32": "0.23.1", - "@esbuild/linux-loong64": "0.23.1", - "@esbuild/linux-mips64el": "0.23.1", - "@esbuild/linux-ppc64": "0.23.1", - "@esbuild/linux-riscv64": "0.23.1", - "@esbuild/linux-s390x": "0.23.1", - "@esbuild/linux-x64": "0.23.1", - "@esbuild/netbsd-x64": "0.23.1", - "@esbuild/openbsd-arm64": "0.23.1", - "@esbuild/openbsd-x64": "0.23.1", - "@esbuild/sunos-x64": "0.23.1", - "@esbuild/win32-arm64": "0.23.1", - "@esbuild/win32-ia32": "0.23.1", - "@esbuild/win32-x64": "0.23.1" + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" } }, "node_modules/escalade": { @@ -4095,42 +4094,51 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { - "version": "9.10.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", - "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.10.0", - "@eslint/plugin-kit": "^0.1.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.16.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.2", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -4140,14 +4148,11 @@ "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -4168,10 +4173,11 @@ } }, "node_modules/eslint-scope": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", - "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -4184,10 +4190,11 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -4195,103 +4202,22 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "color-convert": "^2.0.1" + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/eslint/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/espree": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", - "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", - "dev": true, - "dependencies": { - "acorn": "^8.12.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { @@ -4299,6 +4225,7 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -4311,6 +4238,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -4323,6 +4251,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -4331,28 +4260,42 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } }, + "node_modules/expect-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", + "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -4369,6 +4312,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -4380,34 +4324,54 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, + "node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^4.0.0" }, @@ -4420,6 +4384,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -4432,6 +4397,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -4448,6 +4414,7 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -4457,16 +4424,18 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true, + "license": "ISC" }, "node_modules/foreground-child": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dev": true, + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -4483,6 +4452,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -4498,6 +4468,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -4511,6 +4482,7 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4520,38 +4492,28 @@ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": "20 || >=22" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -4561,6 +4523,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -4572,27 +4535,30 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/glob/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": "20 || >=22" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4603,6 +4569,7 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -4611,21 +4578,24 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/hasown": { @@ -4633,6 +4603,7 @@ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -4640,60 +4611,12 @@ "node": ">= 0.4" } }, - "node_modules/hast-util-to-html": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz", - "integrity": "sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-whitespace": "^3.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "stringify-entities": "^4.0.0", - "zwitch": "^2.0.4" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-whitespace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", - "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", - "dev": true, - "peer": true, - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/html-void-elements": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", - "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + "license": "MIT" }, "node_modules/htmlparser2": { "version": "9.1.0", @@ -4707,6 +4630,7 @@ "url": "https://github.com/sponsors/fb55" } ], + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -4719,6 +4643,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -4731,6 +4656,7 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -4740,6 +4666,7 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4756,6 +4683,7 @@ "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4766,6 +4694,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -4775,6 +4704,7 @@ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -4790,6 +4720,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4799,6 +4730,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4808,6 +4740,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -4820,30 +4753,24 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=8" } @@ -4853,6 +4780,7 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -4862,32 +4790,12 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/istanbul-lib-source-maps": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", @@ -4902,6 +4810,7 @@ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -4911,16 +4820,14 @@ } }, "node_modules/jackspeak": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", - "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": "20 || >=22" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -4932,13 +4839,15 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -4947,49 +4856,55 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", - "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", + "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.0.0" } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -5002,6 +4917,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -5014,6 +4930,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -5023,6 +4940,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -5036,6 +4954,7 @@ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "uc.micro": "^2.0.0" @@ -5046,6 +4965,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -5060,28 +4980,29 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/loupe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", - "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } @@ -5091,13 +5012,15 @@ "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "version": "0.30.14", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", + "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } @@ -5107,6 +5030,7 @@ "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/parser": "^7.25.4", "@babel/types": "^7.25.4", @@ -5118,6 +5042,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -5133,6 +5058,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -5145,6 +5071,7 @@ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "argparse": "^2.0.1", @@ -5158,33 +5085,12 @@ "markdown-it": "bin/markdown-it.mjs" } }, - "node_modules/mdast-util-to-hast": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", - "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", - "dev": true, - "peer": true, - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@ungap/structured-clone": "^1.0.0", - "devlop": "^1.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "trim-lines": "^3.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/merge2": { @@ -5192,109 +5098,17 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, - "node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "peer": true, - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", - "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "peer": true - }, - "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", - "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "peer": true, - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "peer": true - }, - "node_modules/micromark-util-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", - "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "peer": true - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -5303,11 +5117,25 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5320,30 +5148,17 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, - "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "dev": true, - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -5353,6 +5168,7 @@ "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } @@ -5361,12 +5177,13 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -5374,6 +5191,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -5385,19 +5203,22 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/node-releases": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0" }, @@ -5405,24 +5226,12 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/oniguruma-to-js": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.3.tgz", - "integrity": "sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==", - "dev": true, - "peer": true, - "dependencies": { - "regex": "^4.3.2" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -5440,6 +5249,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -5455,6 +5265,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -5466,16 +5277,18 @@ } }, "node_modules/package-json-from-dist": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -5484,24 +5297,26 @@ } }, "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", "dev": true, + "license": "MIT", "dependencies": { - "entities": "^4.4.0" + "entities": "^4.5.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" } }, "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", "dev": true, + "license": "MIT", "dependencies": { - "domhandler": "^5.0.2", + "domhandler": "^5.0.3", "parse5": "^7.0.0" }, "funding": { @@ -5513,6 +5328,7 @@ "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", "dev": true, + "license": "MIT", "dependencies": { "parse5": "^7.0.0" }, @@ -5524,13 +5340,15 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5540,6 +5358,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5548,70 +5367,74 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": "20 || >=22" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", - "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "engines": { - "node": "20 || >=22" - } + "license": "ISC" }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 14.16" } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "funding": [ { @@ -5627,9 +5450,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.1.0", + "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { @@ -5641,15 +5465,17 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -5660,22 +5486,12 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/property-information": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", - "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", - "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -5685,6 +5501,7 @@ "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -5708,19 +5525,22 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/regenerate-unicode-properties": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz", "integrity": "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==", "dev": true, + "license": "MIT", "dependencies": { "regenerate": "^1.4.2" }, @@ -5732,34 +5552,30 @@ "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/regenerator-transform": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/runtime": "^7.8.4" } }, - "node_modules/regex": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/regex/-/regex-4.3.2.tgz", - "integrity": "sha512-kK/AA3A9K6q2js89+VMymcboLOlF5lZRCYJv3gzszXFHBr6kO6qLGzbm+UIugBEV8SMMKCTR59txoY6ctRHYVw==", - "dev": true, - "peer": true - }, "node_modules/regexpu-core": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", - "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", + "integrity": "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/regjsgen": "^0.8.0", "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsparser": "^0.9.1", + "regenerate-unicode-properties": "^10.2.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.12.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.1.0" }, @@ -5767,32 +5583,32 @@ "node": ">=4" } }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "dev": true, + "license": "MIT" + }, "node_modules/regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "jsesc": "~0.5.0" + "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -5810,15 +5626,17 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } @@ -5828,18 +5646,20 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rollup": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.4.tgz", - "integrity": "sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.0.tgz", + "integrity": "sha512-G9GOrmgWHBma4YfCcX8PjH0qhXSdH8B4HDE2o4/jaxj93S4DPCIDoLcXz99eWMji4hB29UFCEd7B2gwGJDR9cQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -5849,22 +5669,24 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.22.4", - "@rollup/rollup-android-arm64": "4.22.4", - "@rollup/rollup-darwin-arm64": "4.22.4", - "@rollup/rollup-darwin-x64": "4.22.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.22.4", - "@rollup/rollup-linux-arm-musleabihf": "4.22.4", - "@rollup/rollup-linux-arm64-gnu": "4.22.4", - "@rollup/rollup-linux-arm64-musl": "4.22.4", - "@rollup/rollup-linux-powerpc64le-gnu": "4.22.4", - "@rollup/rollup-linux-riscv64-gnu": "4.22.4", - "@rollup/rollup-linux-s390x-gnu": "4.22.4", - "@rollup/rollup-linux-x64-gnu": "4.22.4", - "@rollup/rollup-linux-x64-musl": "4.22.4", - "@rollup/rollup-win32-arm64-msvc": "4.22.4", - "@rollup/rollup-win32-ia32-msvc": "4.22.4", - "@rollup/rollup-win32-x64-msvc": "4.22.4", + "@rollup/rollup-android-arm-eabi": "4.28.0", + "@rollup/rollup-android-arm64": "4.28.0", + "@rollup/rollup-darwin-arm64": "4.28.0", + "@rollup/rollup-darwin-x64": "4.28.0", + "@rollup/rollup-freebsd-arm64": "4.28.0", + "@rollup/rollup-freebsd-x64": "4.28.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.28.0", + "@rollup/rollup-linux-arm-musleabihf": "4.28.0", + "@rollup/rollup-linux-arm64-gnu": "4.28.0", + "@rollup/rollup-linux-arm64-musl": "4.28.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.28.0", + "@rollup/rollup-linux-riscv64-gnu": "4.28.0", + "@rollup/rollup-linux-s390x-gnu": "4.28.0", + "@rollup/rollup-linux-x64-gnu": "4.28.0", + "@rollup/rollup-linux-x64-musl": "4.28.0", + "@rollup/rollup-win32-arm64-msvc": "4.28.0", + "@rollup/rollup-win32-ia32-msvc": "4.28.0", + "@rollup/rollup-win32-x64-msvc": "4.28.0", "fsevents": "~2.3.2" } }, @@ -5873,6 +5695,7 @@ "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz", "integrity": "sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==", "dev": true, + "license": "LGPL-3.0-only", "dependencies": { "magic-string": "^0.30.10" }, @@ -5890,12 +5713,6 @@ "typescript": "^4.5 || ^5.0" } }, - "node_modules/rollup/node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5915,6 +5732,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -5924,6 +5742,7 @@ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", "dev": true, + "license": "MIT", "dependencies": { "mri": "^1.1.0" }, @@ -5935,13 +5754,15 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -5951,6 +5772,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -5963,36 +5785,24 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/shiki": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.17.7.tgz", - "integrity": "sha512-Zf6hNtWhFyF4XP5OOsXkBTEx9JFPiN0TQx4wSe+Vqeuczewgk2vT4IZhF4gka55uelm052BD5BaHavNqUNZd+A==", - "dev": true, - "peer": true, - "dependencies": { - "@shikijs/core": "1.17.7", - "@shikijs/engine-javascript": "1.17.7", - "@shikijs/engine-oniguruma": "1.17.7", - "@shikijs/types": "1.17.7", - "@shikijs/vscode-textmate": "^9.2.2", - "@types/hast": "^3.0.4" - } - }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, + "license": "ISC", "engines": { "node": ">=14" }, @@ -6001,29 +5811,18 @@ } }, "node_modules/sirv": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", - "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.0.tgz", + "integrity": "sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==", "dev": true, + "license": "MIT", "dependencies": { "@polka/url": "^1.0.0-next.24", "mrmime": "^2.0.0", "totalist": "^3.0.0" }, "engines": { - "node": ">= 10" - } - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=18" } }, "node_modules/source-map-js": { @@ -6031,38 +5830,31 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, - "node_modules/space-separated-tokens": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", - "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", - "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "dev": true, + "license": "MIT" }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, + "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -6081,6 +5873,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6090,29 +5883,42 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/string-width-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "engines": { - "node": ">=12" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, - "node_modules/string-width/node_modules/strip-ansi": { + "node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -6123,26 +5929,13 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/stringify-entities": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", - "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", - "dev": true, - "peer": true, - "dependencies": { - "character-entities-html4": "^2.0.0", - "character-entities-legacy": "^3.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/strip-ansi": { + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6150,15 +5943,12 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT", "engines": { "node": ">=8" } @@ -6168,6 +5958,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -6176,15 +5967,16 @@ } }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -6192,6 +5984,7 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -6204,6 +5997,7 @@ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^10.4.1", @@ -6218,56 +6012,17 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/test-exclude/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/test-exclude/node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/test-exclude/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true - }, "node_modules/test-exclude/node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -6278,84 +6033,40 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/test-exclude/node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", - "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", - "dev": true + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", + "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", + "dev": true, + "license": "MIT" }, "node_modules/tinyglobby": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.6.tgz", - "integrity": "sha512-NbBoFBpqfcgd1tCiO8Lkfdk+xrA7mlLR9zgvZcZWQQwU63XAfUePyd6wZBaU93Hqw347lHnwFzttAkemHzzz4g==", + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", "dev": true, + "license": "MIT", "dependencies": { - "fdir": "^6.3.0", + "fdir": "^6.4.2", "picomatch": "^4.0.2" }, "engines": { "node": ">=12.0.0" } }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.3.0.tgz", - "integrity": "sha512-QOnuT+BOtivR77wYvCWHfGt9s4Pz1VIMbD463vegT5MLqNXy8rYFT/lPVEqf/bhYeT6qmqrNHhsX+rWwe3rOCQ==", - "dev": true, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/tinypool": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", - "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", + "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", "dev": true, + "license": "MIT", "engines": { "node": "^18.0.0 || >=20.0.0" } @@ -6365,6 +6076,7 @@ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -6374,24 +6086,17 @@ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -6404,26 +6109,17 @@ "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/trim-lines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", - "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", - "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, @@ -6432,13 +6128,14 @@ } }, "node_modules/ts-morph": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", - "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", + "version": "24.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-24.0.0.tgz", + "integrity": "sha512-2OAOg/Ob5yx9Et7ZX4CvTCc0UFoZHwLEJ+dpDPSUi5TgwwlTlX47w+iFRrEwzUZwYACjq83cgjS/Da50Ga37uw==", "dev": true, + "license": "MIT", "dependencies": { - "@ts-morph/common": "~0.23.0", - "code-block-writer": "^13.0.1" + "@ts-morph/common": "~0.25.0", + "code-block-writer": "^13.0.3" } }, "node_modules/type-check": { @@ -6446,6 +6143,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -6454,10 +6152,11 @@ } }, "node_modules/type-fest": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", - "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.30.0.tgz", + "integrity": "sha512-G6zXWS1dLj6eagy6sVhOMQiLtJdxQBHIA9Z6HFUNLOlr6MFOgzV8wvmidtPONfPtEUv0uZsy77XJNzTAfwPDaA==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -6466,17 +6165,18 @@ } }, "node_modules/typedoc": { - "version": "0.26.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.7.tgz", - "integrity": "sha512-gUeI/Wk99vjXXMi8kanwzyhmeFEGv1LTdTQsiyIsmSYsBebvFxhbcyAx7Zjo4cMbpLGxM4Uz3jVIjksu/I2v6Q==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.3.tgz", + "integrity": "sha512-oWT7zDS5oIaxYL5yOikBX4cL99CpNAZn6mI24JZQxsYuIHbtguSSwJ7zThuzNNwSE0wqhlfTSd99HgqKu2aQXQ==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { + "@gerrit0/mini-shiki": "^1.24.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", "minimatch": "^9.0.5", - "shiki": "^1.16.2", - "yaml": "^2.5.1" + "yaml": "^2.6.1" }, "bin": { "typedoc": "bin/typedoc" @@ -6485,7 +6185,7 @@ "node": ">= 18" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { @@ -6493,6 +6193,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "balanced-match": "^1.0.0" @@ -6503,6 +6204,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "peer": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -6515,10 +6217,11 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6528,14 +6231,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.6.0.tgz", - "integrity": "sha512-eEhhlxCEpCd4helh3AO1hk0UP2MvbRi9CtIAJTVPQjuSXOOO2jsEacNi4UdcJzZJbeuVg1gMhtZ8UYb+NFYPrA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.17.0.tgz", + "integrity": "sha512-409VXvFd/f1br1DCbuKNFqQpXICoTB+V51afcwG1pn1a3Cp92MqAUges3YjwEdQ0cMUoCIodjVDAYzyD8h3SYA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.6.0", - "@typescript-eslint/parser": "8.6.0", - "@typescript-eslint/utils": "8.6.0" + "@typescript-eslint/eslint-plugin": "8.17.0", + "@typescript-eslint/parser": "8.17.0", + "@typescript-eslint/utils": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6544,6 +6248,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -6555,13 +6262,15 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/undici": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", - "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", + "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", "dev": true, + "license": "MIT", "engines": { "node": ">=18.17" } @@ -6571,6 +6280,7 @@ "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -6580,6 +6290,7 @@ "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", "dev": true, + "license": "MIT", "dependencies": { "unicode-canonical-property-names-ecmascript": "^2.0.0", "unicode-property-aliases-ecmascript": "^2.0.0" @@ -6593,6 +6304,7 @@ "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz", "integrity": "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -6602,88 +6314,17 @@ "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, - "node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-position": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", - "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -6693,15 +6334,16 @@ "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", "dev": true, + "license": "MIT", "engines": { "node": ">=4", "yarn": "*" } }, "node_modules/update-browserslist-db": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", - "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", "dev": true, "funding": [ { @@ -6717,9 +6359,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" }, "bin": { "update-browserslist-db": "cli.js" @@ -6733,45 +6376,17 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, - "node_modules/vfile": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", - "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-message": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", - "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", - "dev": true, - "peer": true, - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/vite": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.6.tgz", - "integrity": "sha512-IeL5f8OO5nylsgzd9tq4qD2QqI0k2CQLGrWD0rCN0EQJZpBK5vJAx0I+GDkMOXxQX/OfFHMuLIx6ddAxGX/k+Q==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -6827,13 +6442,15 @@ } }, "node_modules/vite-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.1.tgz", - "integrity": "sha512-N/mGckI1suG/5wQI35XeR9rsMsPqKXzq1CdUndzVstBj/HvyxxGctwnK6WX43NGt5L3Z5tcRf83g4TITKJhPrA==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, + "license": "MIT", "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.6", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", "vite": "^5.0.0" }, @@ -6855,6 +6472,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -6871,6 +6489,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -6887,6 +6506,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -6903,6 +6523,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -6919,6 +6540,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -6935,6 +6557,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -6951,6 +6574,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -6967,6 +6591,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -6983,6 +6608,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -6999,6 +6625,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7015,6 +6642,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7031,6 +6659,7 @@ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7047,6 +6676,7 @@ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7063,6 +6693,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7079,6 +6710,7 @@ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7095,6 +6727,7 @@ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7111,6 +6744,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -7127,6 +6761,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -7143,6 +6778,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -7159,6 +6795,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -7175,6 +6812,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -7191,6 +6829,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -7207,6 +6846,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -7221,6 +6861,7 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -7254,29 +6895,31 @@ } }, "node_modules/vitest": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.1.tgz", - "integrity": "sha512-97We7/VC0e9X5zBVkvt7SGQMGrRtn3KtySFQG5fpaMlS+l62eeXRQO633AYhSTC3z7IMebnPPNjGXVGNRFlxBA==", - "dev": true, - "dependencies": { - "@vitest/expect": "2.1.1", - "@vitest/mocker": "2.1.1", - "@vitest/pretty-format": "^2.1.1", - "@vitest/runner": "2.1.1", - "@vitest/snapshot": "2.1.1", - "@vitest/spy": "2.1.1", - "@vitest/utils": "2.1.1", - "chai": "^5.1.1", - "debug": "^4.3.6", - "magic-string": "^0.30.11", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", "pathe": "^1.1.2", - "std-env": "^3.7.0", + "std-env": "^3.8.0", "tinybench": "^2.9.0", - "tinyexec": "^0.3.0", - "tinypool": "^1.0.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.1", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" }, "bin": { @@ -7291,8 +6934,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.1", - "@vitest/ui": "2.1.1", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", "happy-dom": "*", "jsdom": "*" }, @@ -7322,6 +6965,7 @@ "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, + "license": "MIT", "dependencies": { "iconv-lite": "0.6.3" }, @@ -7334,6 +6978,7 @@ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" } @@ -7343,6 +6988,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -7358,6 +7004,7 @@ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, + "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -7374,6 +7021,7 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7383,6 +7031,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -7401,6 +7050,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -7413,50 +7063,29 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, + "license": "MIT", "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" } }, - "node_modules/wrap-ansi-cjs/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -7466,16 +7095,17 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "engines": { - "node": ">=12" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { @@ -7483,6 +7113,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -7490,32 +7121,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "dev": true, + "license": "ISC", "peer": true, "bin": { "yaml": "bin.mjs" @@ -7529,23 +7147,13 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zwitch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", - "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", - "dev": true, - "peer": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } } } } diff --git a/package.json b/package.json index ae1a6227..a50aecba 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,22 @@ { "version": "4.0.0-beta.3", "name": "gl-matrix", - "description": "Javascript Matrix and Vector library for High Performance 3D web apps", + "description": "Javascript Matrix and Vector library for High Performance 3D web apps.", "private": true, "sideEffects": false, "type": "module", "license": "MIT", "imports": { - "#gl-matrix": "./src/index.ts", + "#gl-matrix": { + "types": "./dist/index.d.mts", + "default": "./src/index.ts" + }, "#gl-matrix/classic": "./src/classic/index.ts", "#gl-matrix/common": "./src/common/index.ts", - "#gl-matrix/f64": "./src/f64/index.ts", + "#gl-matrix/f64": { + "types": "./dist/f64/index.d.mts", + "default": "./src/f64/index.ts" + }, "#gl-matrix/swizzle": "./src/swizzle/index.ts", "#gl-matrix/swizzle/f64": "./src/swizzle/f64/index.ts", "#gl-matrix/types": "./src/types/index.ts", @@ -20,72 +26,144 @@ }, "exports": { ".": { - "types": "./dist/index.d.mts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./cdn": { - "types": "./dist-cdn/types/gl-matrix-f32.d.mts", - "import": "./dist-cdn/esm/2022/gl-matrix-f32.js" + "import": { + "types": "./dist-cdn/types/gl-matrix-f32.d.mts", + "default": "./dist-cdn/esm/2022/gl-matrix-f32.js" + }, + "require": { + "types": "./dist-cdn/types/gl-matrix-f32.d.cts", + "default": "./dist-cdn/cjs/2022/gl-matrix-f32.cjs" + } }, "./cdn/f64": { - "types": "./dist-cdn/types/gl-matrix-f64.d.mts", - "import": "./dist-cdn/esm/2022/gl-matrix-f64.js" + "import": { + "types": "./dist-cdn/types/gl-matrix-f64.d.mts", + "default": "./dist-cdn/esm/2022/gl-matrix-f64.js" + }, + "require": { + "types": "./dist-cdn/types/gl-matrix-f64.d.cts", + "default": "./dist-cdn/cjs/2022/gl-matrix-f64.cjs" + } }, "./classic": { - "types": "./dist/classic/index.d.mts", - "import": "./dist/classic/index.js", - "require": "./dist/classic/index.cjs" + "import": { + "types": "./dist/classic/index.d.mts", + "default": "./dist/classic/index.js" + }, + "require": { + "types": "./dist/classic/index.d.cts", + "default": "./dist/classic/index.cjs" + } }, "./common": { - "types": "./dist/common/index.d.mts", - "import": "./dist/common/index.js", - "require": "./dist/common/index.cjs" + "import": { + "types": "./dist/common/index.d.mts", + "default": "./dist/common/index.js" + }, + "require": { + "types": "./dist/common/index.d.cts", + "default": "./dist/common/index.cjs" + } }, "./f64": { - "types": "./dist/f64/index.d.mts", - "import": "./dist/f64/index.js", - "require": "./dist/f64/index.cjs" + "import": { + "types": "./dist/f64/index.d.mts", + "default": "./dist/f64/index.js" + }, + "require": { + "types": "./dist/f64/index.d.cts", + "default": "./dist/f64/index.cjs" + } }, "./swizzle": { - "types": "./dist/swizzle/index.d.mts", - "import": "./dist/swizzle/index.js", - "require": "./dist/swizzle/index.cjs" + "import": { + "types": "./dist/swizzle/index.d.mts", + "default": "./dist/swizzle/index.js" + }, + "require": { + "types": "./dist/swizzle/index.d.cts", + "default": "./dist/swizzle/index.cjs" + } }, "./swizzle/f64": { - "types": "./dist/swizzle/f64/index.d.mts", - "import": "./dist/swizzle/f64/index.js", - "require": "./dist/swizzle/f64/index.cjs" + "import": { + "types": "./dist/swizzle/f64/index.d.mts", + "default": "./dist/swizzle/f64/index.js" + }, + "require": { + "types": "./dist/swizzle/f64/index.d.cts", + "default": "./dist/swizzle/f64/index.cjs" + } }, "./types": { - "types": "./dist/types/index.d.mts", - "import": "./dist/types/index.js", - "require": "./dist/types/index.cjs" + "import": { + "types": "./dist/types/index.d.mts", + "default": "./dist/types/index.js" + }, + "require": { + "types": "./dist/types/index.d.cts", + "default": "./dist/types/index.cjs" + } }, "./types/cdn/umd": { - "types": "./dist-cdn/types/globals-f32.d.mts", - "import": "./dist-cdn/types/index.js", - "require": "./dist-cdn/types/index.cjs" + "import": { + "types": "./dist-cdn/types/globals-f32.d.mts", + "default": "./dist-cdn/types/index.js" + }, + "require": { + "types": "./dist-cdn/types/globals-f32.d.cts", + "default": "./dist-cdn/types/index.cjs" + } }, "./types/cdn/umd/f64": { - "types": "./dist-cdn/types/globals-f64.d.mts", - "import": "./dist-cdn/types/index.js", - "require": "./dist-cdn/types/index.cjs" + "import": { + "types": "./dist-cdn/types/globals-f64.d.mts", + "default": "./dist-cdn/types/index.js" + }, + "require": { + "types": "./dist-cdn/types/globals-f64.d.cts", + "default": "./dist-cdn/types/index.cjs" + } }, "./types/swizzle": { - "types": "./dist/types/swizzle/index.d.mts", - "import": "./dist/types/swizzle/index.js", - "require": "./dist/types/swizzle/index.cjs" + "import": { + "types": "./dist/types/swizzle/index.d.mts", + "default": "./dist/types/swizzle/index.js" + }, + "require": { + "types": "./dist/types/swizzle/index.d.cts", + "default": "./dist/types/swizzle/index.cjs" + } }, "./types/swizzle/f64": { - "types": "./dist/types/swizzle/f64/index.d.mts", - "import": "./dist/types/swizzle/f64/index.js", - "require": "./dist/types/swizzle/f64/index.cjs" + "import": { + "types": "./dist/types/swizzle/f64/index.d.mts", + "default": "./dist/types/swizzle/f64/index.js" + }, + "require": { + "types": "./dist/types/swizzle/f64/index.d.cts", + "default": "./dist/types/swizzle/f64/index.cjs" + } }, "./util": { - "types": "./dist/util/index.d.mts", - "import": "./dist/util/index.js", - "require": "./dist/util/index.cjs" + "import": { + "types": "./dist/util/index.d.mts", + "default": "./dist/util/index.js" + }, + "require": { + "types": "./dist/util/index.d.cts", + "default": "./dist/util/index.cjs" + } } }, "main": "./dist-cdn/esm/2022/gl-matrix-f32.min.js", @@ -131,18 +209,18 @@ "types": "esm-d-ts gen -c" }, "devDependencies": { - "@babel/core": "^7.25.2", - "@babel/preset-env": "^7.25.4", + "@babel/core": "^7.26.0", + "@babel/preset-env": "^7.26.0", "@rollup/plugin-babel": "^6.0.4", - "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.7", - "@typhonjs-typedoc/typedoc-pkg": "^0.1.1", + "@typhonjs-build-test/esm-d-ts": "^0.3.0-next.9", + "@typhonjs-typedoc/typedoc-pkg": "^0.2.0", "@vitest/coverage-v8": "^2.1.0", "@vitest/ui": "^2.1.0", - "esbuild": "^0.23.0", - "eslint": "^9.10.0", - "rollup": "^4.22.0", - "typescript": "^5.6.0", - "typescript-eslint": "^8.6.0", + "esbuild": "^0.24.0", + "eslint": "^9.16.0", + "rollup": "^4.28.0", + "typescript": "^5.7.0", + "typescript-eslint": "^8.17.0", "vitest": "^2.1.0" } } diff --git a/scripts/build.js b/scripts/build.js index 53b53a66..ace42625 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -92,27 +92,43 @@ try { promises.push(esbuild.build(cdnEsbuildOptions)); - // Minified 2022 CDN bundles ------ + // [ESM] Minified 2022 CDN bundles ------ cdnEsbuildOptions.minify = true; cdnEsbuildOptions.outExtension = { '.js': '.min.js' }; promises.push(esbuild.build(cdnEsbuildOptions)); - // Minified 2016 CDN bundles ------ + // [ESM] Minified 2016 CDN bundles ------ cdnEsbuildOptions.outdir = 'dist-cdn/esm/2016'; cdnEsbuildOptions.target = 'es2016'; promises.push(esbuild.build(cdnEsbuildOptions)); - // 2016 CDN bundles --------------- + // [ESM] 2016 CDN bundles --------------- cdnEsbuildOptions.minify = false; cdnEsbuildOptions.outExtension = void 0; promises.push(esbuild.build(cdnEsbuildOptions)); + // [CJS] 2022 CDN bundles --------------- + + cdnEsbuildOptions.format = 'cjs'; + cdnEsbuildOptions.outdir = 'dist-cdn/cjs/2022'; + cdnEsbuildOptions.outExtension = { '.js': '.cjs' }; + cdnEsbuildOptions.target = 'es2022'; + + promises.push(esbuild.build(cdnEsbuildOptions)); + + // [CJS] Minified 2022 CDN bundles ------ + + cdnEsbuildOptions.minify = true; + cdnEsbuildOptions.outExtension = { '.js': '.min.cjs' }; + + promises.push(esbuild.build(cdnEsbuildOptions)); + // Await all ESBuild promises before continuing. await Promise.allSettled(promises);